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)
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)
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)