Package org.sat4j.core

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


        if (prefix == f.length - 1) {
            IVecInt clause = new VecInt(f.length + 1);
            for (int i = 0; i < f.length - 1; ++i) {
                clause.push(f[i]);
            }
            clause.push(f[f.length - 1] * (negation ? -1 : 1));
            processClause(clause);
            return;
        }

        if (negation) {
View Full Code Here


    @Override
    public int[] model() {
        int[] last = super.model();
        IVecInt clause = new VecInt(last.length);
        for (int q : last) {
            clause.push(-q);
        }
        try {
            // System.out.println("adding " + clause);
            addClause(clause);
        } catch (ContradictionException e) {
View Full Code Here

        try {
            do {
                prevmodel = super.model();
                vec.clear();
                for (int i = 1; i <= nVars(); i++) {
                    vec.push(-i);
                }
                int counter = 0;
                for (int q : prevmodel) {
                    if (q < 0) {
                        counter++;
View Full Code Here

                cube.clear();
                for (int q : prevmodel) {
                    if (q < 0) {
                        vec.push(-q);
                    } else {
                        cube.push(q);
                    }
                }
                addClause(vec);
            } while (isSatisfiable(cube));
        } catch (TimeoutException e) {
View Full Code Here

        while (!trivialfalsity && isSatisfiable(true)) {
            lowerBound++;
            int[] last = model();
            IVecInt clause = new VecInt(last.length);
            for (int q : last) {
                clause.push(-q);
            }
            try {
                // System.out.println("Sol number "+nbsols+" adding " + clause);
                addClause(clause);
            } catch (ContradictionException e) {
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.