Exemple #1
0
    def test_get_logics_min(self):
        tests = [
            (pysmt.logics.AUFLIA,
             get_logic(arrays=True,
                       uninterpreted=True,
                       linear=True,
                       integer_arithmetic=True)),
            (pysmt.logics.AUFLIRA,
             get_logic(arrays=True,
                       uninterpreted=True,
                       linear=True,
                       integer_arithmetic=True,
                       real_arithmetic=True)),
            (pysmt.logics.AUFNIRA,
             get_logic(arrays=True,
                       uninterpreted=True,
                       linear=False,
                       integer_arithmetic=True,
                       real_arithmetic=True)),
            (pysmt.logics.LRA, get_logic(linear=True, real_arithmetic=True)),
            (pysmt.logics.QF_ABV,
             get_logic(quantifier_free=True, arrays=True, bit_vectors=True)),
            (pysmt.logics.QF_AUFBV,
             get_logic(quantifier_free=True,
                       arrays=True,
                       uninterpreted=True,
                       bit_vectors=True)),
            (pysmt.logics.QF_AUFLIA,
             get_logic(quantifier_free=True,
                       arrays=True,
                       uninterpreted=True,
                       linear=True,
                       integer_arithmetic=True)),
            (pysmt.logics.QF_UFLRA,
             get_logic(quantifier_free=True,
                       uninterpreted=True,
                       linear=True,
                       real_arithmetic=True)),
            (pysmt.logics.QF_RDL,
             get_logic(quantifier_free=True,
                       real_arithmetic=True,
                       real_difference=True)),
            (pysmt.logics.QF_UFIDL,
             get_logic(quantifier_free=True,
                       uninterpreted=True,
                       integer_arithmetic=True,
                       integer_difference=True)),
        ]

        for t in tests:
            self.assertEqual(t[0], t[1],
                              "Expected %s, got %s instead" % \
                              (t[0].name, t[1].name))
Exemple #2
0
    def test_get_logics_min(self):
        tests = [
            (pysmt.logics.AUFLIA, get_logic(arrays=True,
                                            uninterpreted=True,
                                            linear=True,
                                            integer_arithmetic=True)),
            (pysmt.logics.AUFLIRA, get_logic(arrays=True,
                                             uninterpreted=True,
                                             linear=True,
                                             integer_arithmetic=True,
                                             real_arithmetic=True)),
            (pysmt.logics.AUFNIRA, get_logic(arrays=True,
                                             uninterpreted=True,
                                             linear=False,
                                             integer_arithmetic=True,
                                             real_arithmetic=True)),
            (pysmt.logics.LRA, get_logic(linear=True,
                                         real_arithmetic=True)),
            (pysmt.logics.QF_ABV, get_logic(quantifier_free=True,
                                            arrays=True,
                                            bit_vectors=True)),
            (pysmt.logics.QF_AUFBV, get_logic(quantifier_free=True,
                                              arrays=True,
                                              uninterpreted=True,
                                              bit_vectors=True)),
            (pysmt.logics.QF_AUFLIA, get_logic(quantifier_free=True,
                                               arrays=True,
                                               uninterpreted=True,
                                               linear=True,
                                               integer_arithmetic=True)),
            (pysmt.logics.QF_UFLRA, get_logic(quantifier_free=True,
                                              uninterpreted=True,
                                              linear=True,
                                              real_arithmetic=True)),
            (pysmt.logics.QF_RDL, get_logic(quantifier_free=True,
                                            real_arithmetic=True,
                                            real_difference=True)),
            (pysmt.logics.QF_UFIDL, get_logic(quantifier_free=True,
                                              uninterpreted=True,
                                              integer_arithmetic=True,
                                              integer_difference=True)),
        ]

        for t in tests:
            self.assertEqual(t[0], t[1],
                              "Expected %s, got %s instead" % \
                              (t[0].name, t[1].name))
Exemple #3
0
def _build_logics(logics_params):
    logics = []
    for params in it.product(*logics_params.values()):
        args = dict(zip(logics_params.keys(), params))
        try:
            logic = get_logic(**args)
        except UndefinedLogicError:
            pass
        else:
            if logic in SMTLIB2_LOGICS:
                logics.append(logic)

    return logics
Exemple #4
0
 def test_get_logic(self):
     for l in pysmt.logics.LOGICS:
         l_out = get_logic(quantifier_free=l.quantifier_free,
                           arrays=l.theory.arrays,
                           bit_vectors=l.theory.bit_vectors,
                           floating_point=l.theory.floating_point,
                           integer_arithmetic=l.theory.integer_arithmetic,
                           real_arithmetic=l.theory.real_arithmetic,
                           integer_difference=l.theory.integer_difference,
                           real_difference=l.theory.real_difference,
                           linear=l.theory.linear,
                           uninterpreted=l.theory.uninterpreted)
         self.assertEqual(l_out, l,
                           "Expected %s, got %s instead" % \
                           (l, l_out))
Exemple #5
0
 def test_get_logic(self):
     for l in pysmt.logics.LOGICS:
         l_out = get_logic(quantifier_free=l.quantifier_free,
                           arrays=l.theory.arrays,
                           bit_vectors=l.theory.bit_vectors,
                           floating_point=l.theory.floating_point,
                           integer_arithmetic=l.theory.integer_arithmetic,
                           real_arithmetic=l.theory.real_arithmetic,
                           integer_difference=l.theory.integer_difference,
                           real_difference=l.theory.real_difference,
                           linear=l.theory.linear,
                           uninterpreted=l.theory.uninterpreted)
         self.assertEqual(l_out, l,
                           "Expected %s, got %s instead" % \
                           (l, l_out))