Search in sources :

Example 1 with SearchListener

use of org.sat4j.specs.SearchListener 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

IConstr (org.sat4j.specs.IConstr)1 IVecInt (org.sat4j.specs.IVecInt)1 SearchListener (org.sat4j.specs.SearchListener)1