Package org.sat4j.core

Examples of org.sat4j.core.VecInt.push()


        processClause(clause);
        // taken from Niklas Een et al SAT 2007 paper
        // Adding the following redundant clause will improve unit propagation
        // y -> x2 or x3
        clause.clear();
        clause.push(-y).push(x2).push(x3);
        processClause(clause);
    }

    /**
     * Translate y <=> x1 /\ x2 /\ ... /\ xn into clauses.
View Full Code Here


    public void and(int y, IVecInt literals) throws ContradictionException {
        // y <=> AND x1 ... xn

        // y <= x1 .. xn
        IVecInt clause = new VecInt(literals.size() + 2);
        clause.push(y);
        for (int i = 0; i < literals.size(); i++) {
            clause.push(-literals.get(i));
        }
        processClause(clause);
        clause.clear();
View Full Code Here

        // y <= x1 .. xn
        IVecInt clause = new VecInt(literals.size() + 2);
        clause.push(y);
        for (int i = 0; i < literals.size(); i++) {
            clause.push(-literals.get(i));
        }
        processClause(clause);
        clause.clear();
        for (int i = 0; i < literals.size(); i++) {
            // y => xi
View Full Code Here

        processClause(clause);
        clause.clear();
        for (int i = 0; i < literals.size(); i++) {
            // y => xi
            clause.clear();
            clause.push(-y);
            clause.push(literals.get(i));
            processClause(clause);
        }
    }
View Full Code Here

        clause.clear();
        for (int i = 0; i < literals.size(); i++) {
            // y => xi
            clause.clear();
            clause.push(-y);
            clause.push(literals.get(i));
            processClause(clause);
        }
    }

    /**
 
View Full Code Here

     * @param x2
     * @throws ContradictionException
     */
    public void and(int y, int x1, int x2) throws ContradictionException {
        IVecInt clause = new VecInt(4);
        clause.push(-y);
        clause.push(x1);
        addClause(clause);
        clause.clear();
        clause.push(-y);
        clause.push(x2);
View Full Code Here

     * @throws ContradictionException
     */
    public void and(int y, int x1, int x2) throws ContradictionException {
        IVecInt clause = new VecInt(4);
        clause.push(-y);
        clause.push(x1);
        addClause(clause);
        clause.clear();
        clause.push(-y);
        clause.push(x2);
        addClause(clause);
View Full Code Here

        IVecInt clause = new VecInt(4);
        clause.push(-y);
        clause.push(x1);
        addClause(clause);
        clause.clear();
        clause.push(-y);
        clause.push(x2);
        addClause(clause);
        clause.clear();
        clause.push(y);
        clause.push(-x1);
View Full Code Here

        clause.push(-y);
        clause.push(x1);
        addClause(clause);
        clause.clear();
        clause.push(-y);
        clause.push(x2);
        addClause(clause);
        clause.clear();
        clause.push(y);
        clause.push(-x1);
        clause.push(-x2);
View Full Code Here

        clause.clear();
        clause.push(-y);
        clause.push(x2);
        addClause(clause);
        clause.clear();
        clause.push(y);
        clause.push(-x1);
        clause.push(-x2);
        addClause(clause);
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.