Package solver

Examples of solver.Solver


     * @param LEFT  a boolean variable
     * @param RIGHT another boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolEq(BoolVar LEFT, BoolVar RIGHT) {
        Solver solver = LEFT.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int left_lit = sat.Literal(LEFT);
        int right_lit = sat.Literal(RIGHT);
        sat.addClause(SatSolver.negated(left_lit), right_lit);
        sat.addClause(left_lit, SatSolver.negated(right_lit));
        return true;
View Full Code Here


     * @param LEFT  a boolean variable
     * @param RIGHT another boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolLe(BoolVar LEFT, BoolVar RIGHT) {
        Solver solver = LEFT.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int left_lit = sat.Literal(LEFT);
        int right_lit = sat.Literal(RIGHT);
        sat.addClause(SatSolver.negated(left_lit), right_lit);
        return true;
    }
View Full Code Here

     * @param LEFT  a boolean variable
     * @param RIGHT another boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolLt(BoolVar LEFT, BoolVar RIGHT) {
        Solver solver = LEFT.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int left_lit = sat.Literal(LEFT);
        int right_lit = sat.Literal(RIGHT);
        sat.addClause(right_lit);
        sat.addClause(SatSolver.negated(left_lit), SatSolver.negated(right_lit));
        return true;
View Full Code Here

     * @param LEFT  a boolean variable
     * @param RIGHT another boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolNot(BoolVar LEFT, BoolVar RIGHT) {
        Solver solver = LEFT.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int left_lit = sat.Literal(LEFT);
        int right_lit = sat.Literal(RIGHT);
        sat.addClause(SatSolver.negated(left_lit), SatSolver.negated(right_lit));
        sat.addClause(left_lit, right_lit);
        return true;
View Full Code Here

     * @param BOOLVARS a list of boolean variables
     * @param TARGET   the reified boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolOrArrayEqVar(BoolVar[] BOOLVARS, BoolVar TARGET) {
        Solver solver = TARGET.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int target_lit = sat.Literal(TARGET);
        TIntList lits = new TIntArrayList(BOOLVARS.length + 1);
        for (int i = 0; i < BOOLVARS.length; i++) {
            lits.add(sat.Literal(BOOLVARS[i]));
        }
View Full Code Here

     * @param BOOLVARS a list of boolean variables
     * @param TARGET   the reified boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolAndArrayEqVar(BoolVar[] BOOLVARS, BoolVar TARGET) {
        Solver solver = TARGET.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int target_lit = sat.Literal(TARGET);
        TIntList lits = new TIntArrayList(BOOLVARS.length + 1);
        for (int i = 0; i < BOOLVARS.length; i++) {
            lits.add(SatSolver.negated(sat.Literal(BOOLVARS[i])));
        }
View Full Code Here

     * @param RIGHT  another boolean variable
     * @param TARGET the reified boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolOrEqVar(BoolVar LEFT, BoolVar RIGHT, BoolVar TARGET) {
        Solver solver = TARGET.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int left_lit = sat.Literal(LEFT);
        int right_lit = sat.Literal(RIGHT);
        int target_lit = sat.Literal(TARGET);
        sat.addClause(left_lit, right_lit, SatSolver.negated(target_lit));
        sat.addClause(SatSolver.negated(left_lit), target_lit);
View Full Code Here

     * @param RIGHT  another boolean variable
     * @param TARGET the reified boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolAndEqVar(BoolVar LEFT, BoolVar RIGHT, BoolVar TARGET) {
        Solver solver = TARGET.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int left_lit = sat.Literal(LEFT);
        int right_lit = sat.Literal(RIGHT);
        int target_lit = sat.Literal(TARGET);
        sat.addClause(SatSolver.negated(left_lit), SatSolver.negated(right_lit), target_lit);
        sat.addClause(left_lit, SatSolver.negated(target_lit));
View Full Code Here

     * @param RIGHT  another boolean variable
     * @param TARGET the reified boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolIsEqVar(BoolVar LEFT, BoolVar RIGHT, BoolVar TARGET) {
        Solver solver = TARGET.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int left_lit = sat.Literal(LEFT);
        int right_lit = sat.Literal(RIGHT);
        int target_lit = sat.Literal(TARGET);
        sat.addClause(SatSolver.negated(left_lit), right_lit, SatSolver.negated(target_lit));
        sat.addClause(left_lit, SatSolver.negated(right_lit), SatSolver.negated(target_lit));
View Full Code Here

     * @param RIGHT  another boolean variable
     * @param TARGET the reified boolean variable
     * @return true if the clause has been added to the clause store
     */
    public static boolean addBoolIsNeqVar(BoolVar LEFT, BoolVar RIGHT, BoolVar TARGET) {
        Solver solver = TARGET.getSolver();
        PropSat sat = solver.getMinisat().getPropSat();
        int left_lit = sat.Literal(LEFT);
        int right_lit = sat.Literal(RIGHT);
        int target_lit = sat.Literal(TARGET);
        sat.addClause(SatSolver.negated(left_lit), right_lit, target_lit);
        sat.addClause(left_lit, SatSolver.negated(right_lit), target_lit);
View Full Code Here

TOP

Related Classes of solver.Solver

Copyright © 2018 www.massapicom. 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.