當前位置: 首頁>>代碼示例>>Java>>正文


Java GateTranslator類代碼示例

本文整理匯總了Java中org.sat4j.tools.GateTranslator的典型用法代碼示例。如果您正苦於以下問題:Java GateTranslator類的具體用法?Java GateTranslator怎麽用?Java GateTranslator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GateTranslator類屬於org.sat4j.tools包,在下文中一共展示了GateTranslator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    VecInt literals = new VecInt();
    for (Variable var : this.vars) {
        var.addToGateTranslator(translator);
        literals.push(var.getIndex());
    }

    this.vars = null;
    translator.xor(this.getIndex(), literals);

}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:17,代碼來源:XorN.java

示例2: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;

    VecInt lits = new VecInt();
    for (Variable var : this.vars) {
        var.addToGateTranslator(translator);
        lits.push(var.getIndex());
    }
    this.vars = null;
    translator.or(this.getIndex(), lits);

}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:17,代碼來源:OrN.java

示例3: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    this.p.addToGateTranslator(translator);
    this.q.addToGateTranslator(translator);
    True z = new True();
    z.addToGateTranslator(translator);

    translator.ite(this.getIndex(), this.p.getIndex(), this.q.getIndex(),
            z.getIndex());
    // Not operation = new Not(new And(this.p, new Not(this.q)));
    // operation.addToGateTranslator(translator);

}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:18,代碼來源:Implies.java

示例4: getSolvableProblem

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
/**
 * If already called, will return the previous solver!
 *
 * @param tunings
 *            enable tunings
 * @return the problem
 * @throws ContradictionException
 */
public IProblem getSolvableProblem(boolean tunings)
        throws ContradictionException {
    if (this.solver != null)
        return this.solver;

    this.solver = SolverFactory.newDefault();
    this.solver.setVerbose(true);

    GateTranslator translator = new GateTranslator(this.solver);
    System.out.println("Representing problem in Java");
    LogicStatement problem = this.getProblem();
    System.out.println("Adding to GateTranslator");
    problem.addToGateTranslator(translator);

    if (tunings) {
        System.out.println("Adding tunings to GateTranslator");
        this.getTunings().addToGateTranslator(translator);
    }

    // allow to free psis
    this.psiResults = null;
    return this.solver;
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:32,代碼來源:SlpProblem.java

示例5: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    addedToGateTranslator = true;

    System.out.println("Translating beta1");
    Variable[] andn = new Variable[k];
    for (int i = 0; i < k; i++) {
        Variable[] vars = new Variable[n + k];
        for (int j = 0; j < n; j++) {
            vars[j] = B[i][j];
        }
        for (int j = 0; j < k; j++) {
            vars[n + j] = C[i][j];
        }
        andn[i] = new ExactlyN(2, vars);
    }

    AndN a = new AndN(getIndex(), andn);
    a.addToGateTranslator(translator);
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:24,代碼來源:SlpProblem.java

示例6: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    translator.gateFalse(this.getIndex());
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:9,代碼來源:False.java

示例7: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    this.p.addToGateTranslator(translator);
    translator.not(this.getIndex(), this.p.getIndex());
    this.p = null;
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:11,代碼來源:Not.java

示例8: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    VecInt lits = new VecInt();
    for (Variable var : this.vars) {
        var.addToGateTranslator(translator);
        lits.push(var.getIndex());
    }
    this.vars = null;
    translator.addAtLeast(lits, this.n);
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:15,代碼來源:AtLeastN.java

示例9: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    VecInt lits = new VecInt();
    for (Variable lit : vars) {
        lit.addToGateTranslator(translator);
        lits.push(lit.getIndex());
    }
    vars = null;
    translator.addExactly(lits, n);

}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:16,代碼來源:ExactlyN.java

示例10: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    VecInt literals = new VecInt();
    for (Variable var : this.variables) {
        var.addToGateTranslator(translator);
        literals.push(var.getIndex());
    }
    this.variables = null;
    translator.and(this.getIndex(), literals);
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:15,代碼來源:AndN.java

示例11: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    translator.gateTrue(this.getIndex());
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:9,代碼來源:True.java

示例12: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    this.p.addToGateTranslator(translator);
    this.q.addToGateTranslator(translator);

    translator.iff(this.getIndex(),
            new VecInt(new int[] { this.p.getIndex(), this.q.getIndex() }));

    this.p = this.q = null;
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:15,代碼來源:Equivalent.java

示例13: addToGateTranslator

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
@Override
public void addToGateTranslator(GateTranslator translator)
        throws ContradictionException {
    if (this.addedToGateTranslator)
        return;
    this.addedToGateTranslator = true;
    VecInt lits = new VecInt();
    for (Variable var : this.vars) {
        var.addToGateTranslator(translator);
        lits.push(var.getIndex());
    }
    this.vars = null;
    translator.addAtMost(lits, this.n);
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:15,代碼來源:AtMostN.java

示例14: getDimacsSolver

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
/**
 * Try to get the dimacs representation
 *
 * Doesn't work because of exactly_2
 *
 * @param tunings
 * @return the Dimacs solver
 * @throws ContradictionException
 */
public ISolver getDimacsSolver(boolean tunings)
        throws ContradictionException {
    ISolver solver = new DimacsStringSolver();
    GateTranslator translator = new GateTranslator(solver);
    this.getProblem().addToGateTranslator(translator);
    if (tunings) {
        this.getTunings().addToGateTranslator(translator);
    }
    return solver;
}
 
開發者ID:thomwiggers,項目名稱:find-shortest-slp,代碼行數:20,代碼來源:SlpProblem.java

示例15: AIGReader

import org.sat4j.tools.GateTranslator; //導入依賴的package包/類
AIGReader(ISolver s) {
	solver = new GateTranslator(s);
}
 
開發者ID:axel-halin,項目名稱:Thesis-JHipster,代碼行數:4,代碼來源:AIGReader.java


注:本文中的org.sat4j.tools.GateTranslator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。