예제 #1
0
    def test_get_implicant_sat(self):
        varA = Symbol("A", BOOL)
        varX = Symbol("X", REAL)
        f = And(varA, Equals(varX, Real(8)))

        for solver in get_env().factory.all_solvers(logic=QF_LRA):
            res = get_implicant(f, solver_name=solver)
            self.assertIsNotNone(res, "Formula was expected to be SAT")
            self.assertValid(Implies(res, f), logic=QF_LRA)
예제 #2
0
파일: test_solving.py 프로젝트: pysmt/pysmt
 def test_examples_get_implicant(self):
     for (f, _, satisfiability, logic) in get_example_formulae():
         if logic.quantifier_free:
             for sname in get_env().factory.all_solvers(logic=logic):
                 f_i = get_implicant(f, logic=logic, solver_name=sname)
                 if satisfiability:
                     self.assertValid(Implies(f_i, f), logic=logic, msg=(f_i, f))
                 else:
                     self.assertIsNone(f_i)
예제 #3
0
파일: test_solving.py 프로젝트: pysmt/pysmt
    def test_get_implicant_sat(self):
        varA = Symbol("A", BOOL)
        varX = Symbol("X", REAL)
        f = And(varA, Equals(varX, Real(8)))

        for solver in get_env().factory.all_solvers(logic=QF_LRA):
            res = get_implicant(f, solver_name=solver)
            self.assertIsNotNone(res, "Formula was expected to be SAT")
            self.assertValid(Implies(res, f), logic=QF_LRA)
예제 #4
0
 def test_examples_get_implicant(self):
     for (f, _, satisfiability, logic) in get_example_formulae():
         if logic.quantifier_free:
             for sname in get_env().factory.all_solvers(logic=logic):
                 f_i = get_implicant(f, logic=logic, solver_name=sname)
                 if satisfiability:
                     self.assertValid(Implies(f_i, f), logic=logic, msg=(f_i, f))
                 else:
                     self.assertIsNone(f_i)
예제 #5
0
    def test_get_implicant_unsat(self):
        varA = Symbol("A", BOOL)
        varB = Symbol("B", BOOL)

        f = And(varA, Not(varB))
        g = f.substitute({varB: varA})

        for solver in get_env().factory.all_solvers(logic=QF_BOOL):
            res = get_implicant(g, solver_name=solver)
            self.assertIsNone(res, "Formula was expected to be UNSAT")
예제 #6
0
    def test_get_implicant_unsat(self):
        varA = Symbol("A", BOOL)
        varB = Symbol("B", BOOL)

        f = And(varA, Not(varB))
        g = f.substitute({varB:varA})

        for solver in get_env().factory.all_solvers(logic=QF_BOOL):
            res = get_implicant(g, solver_name=solver)
            self.assertIsNone(res, "Formula was expected to be UNSAT")
예제 #7
0
 def test_examples_get_implicant(self):
     for (f, _, satisfiability, logic) in get_example_formulae():
         if logic.quantifier_free:
             for sname in get_env().factory.all_solvers(logic=logic):
                 try:
                     f_i = get_implicant(f, logic=logic, solver_name=sname)
                     if satisfiability:
                         self.assertValid(Implies(f_i, f), logic=logic, msg=f)
                     else:
                         self.assertIsNone(f_i)
                 except ConvertExpressionError as ex:
                     # Some solvers do not support ARRAY_VALUE
                     self.assertEqual(ex.expression.node_type(), op.ARRAY_VALUE)
                     self.assertTrue(sname in ["cvc4", "btor"])
예제 #8
0
 def test_examples_get_implicant(self):
     for (f, _, satisfiability, logic) in get_example_formulae():
         if logic.quantifier_free:
             for sname in get_env().factory.all_solvers(logic=logic):
                 try:
                     f_i = get_implicant(f, logic=logic, solver_name=sname)
                     if satisfiability:
                         self.assertValid(Implies(f_i, f),
                                          logic=logic,
                                          msg=(f_i, f))
                     else:
                         self.assertIsNone(f_i)
                 except ConvertExpressionError as ex:
                     # Some solvers do not support ARRAY_VALUE
                     self.assertEqual(ex.expression.node_type(),
                                      op.ARRAY_VALUE)
                     self.assertTrue(sname in ["cvc4", "btor"])