Exemplo n.º 1
0
    def smtlib_solver(self, stream):
        smt_parser = SmtLibParser()
        name = self.args.solver
        if name == "auto":
            solver = Solver()
        else:
            solver = Solver(name=name)

        for cmd in smt_parser.get_command_generator(stream):
            r = evaluate_command(cmd, solver)
            self.print_result(cmd, r)
Exemplo n.º 2
0
    def smtlib_solver(self, stream):
        smt_parser = SmtLibParser()
        name = self.args.solver
        if name == "auto":
            solver = Solver()
        else:
            solver = Solver(name=name)

        for cmd in smt_parser.get_command_generator(stream):
            r = evaluate_command(cmd, solver)
            self.print_result(cmd, r)
Exemplo n.º 3
0
    def test_evaluate_command(self):
        class SmtLibIgnore(SmtLibIgnoreMixin):
            pass

        mock = SmtLibIgnore()
        for cmd_name in [
                smtcmd.SET_INFO, smtcmd.ASSERT, smtcmd.CHECK_SAT, smtcmd.EXIT,
                smtcmd.SET_LOGIC, smtcmd.DECLARE_CONST, smtcmd.PUSH, smtcmd.POP
        ]:

            evaluate_command(SmtLibCommand(cmd_name, [None, None]),
                             solver=mock)

        evaluate_command(SmtLibCommand(smtcmd.DECLARE_FUN, [None, None, None]),
                         solver=mock)

        evaluate_command(SmtLibCommand(smtcmd.DEFINE_FUN,
                                       [None, None, None, None]),
                         solver=mock)
Exemplo n.º 4
0
    def test_evaluate_command(self):
        class SmtLibIgnore(SmtLibIgnoreMixin):
            pass

        mock = SmtLibIgnore()
        for cmd_name in [
            smtcmd.SET_INFO,
            smtcmd.ASSERT,
            smtcmd.CHECK_SAT,
            smtcmd.EXIT,
            smtcmd.SET_LOGIC,
            smtcmd.DECLARE_CONST,
            smtcmd.PUSH,
            smtcmd.POP,
        ]:

            evaluate_command(SmtLibCommand(cmd_name, [None, None]), solver=mock)

        evaluate_command(SmtLibCommand(smtcmd.DECLARE_FUN, [None, None, None]), solver=mock)

        evaluate_command(SmtLibCommand(smtcmd.DEFINE_FUN, [None, None, None, None]), solver=mock)