Search in sources :

Example 11 with IVecInt

use of org.sat4j.specs.IVecInt in project spoon by INRIA.

the class Solver method propagate.

/**
 * @return null if not conflict is found, else a conflicting constraint.
 */
public final Constr propagate() {
    IVecInt ltrail = this.trail;
    SolverStats lstats = this.stats;
    IOrder lorder = this.order;
    SearchListener lslistener = this.slistener;
    // cannot cache that value.
    while (this.qhead < ltrail.size()) {
        lstats.propagations++;
        int p = ltrail.get(this.qhead++);
        lslistener.propagating(toDimacs(p), null);
        lorder.assignLiteral(p);
        Constr confl = reduceClausesForFalsifiedLiteral(p);
        if (confl != null) {
            return confl;
        }
    }
    return null;
}
Also used : SearchListener(org.sat4j.specs.SearchListener) IVecInt(org.sat4j.specs.IVecInt) IConstr(org.sat4j.specs.IConstr)

Aggregations

IVecInt (org.sat4j.specs.IVecInt)11 VecInt (org.sat4j.core.VecInt)7 IConstr (org.sat4j.specs.IConstr)3 ArrayList (java.util.ArrayList)1 IteratorInt (org.sat4j.specs.IteratorInt)1 SearchListener (org.sat4j.specs.SearchListener)1