当前位置: 首页>>代码示例>>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;未经允许,请勿转载。