Exemple #1
0
 def set_logic(self, logic):
     self._send_silent_command(SmtLibCommand(smtcmd.SET_LOGIC, [logic]))
Exemple #2
0
 def _cmd_reset(self, current, tokens):
     """(reset)"""
     self.parse_atoms(tokens, current, 0)
     return SmtLibCommand(current, [])
Exemple #3
0
 def set_option(self, name, value):
     self._send_silent_command(SmtLibCommand(smtcmd.SET_OPTION,
                                             [name, value]))
Exemple #4
0
 def test_smtlib_info_quoting(self):
     cmd = SmtLibCommand(smtcmd.SET_INFO,
                         [":source", "This\nis\nmultiline!"])
     output = cmd.serialize_to_string()
     self.assertEqual(output, "(set-info :source |This\nis\nmultiline!|)")
Exemple #5
0
 def _cmd_set_option(self, current, tokens):
     """(set-option <option>)"""
     elements = self.parse_atoms(tokens, current, 2)
     return SmtLibCommand(current, elements)
Exemple #6
0
 def reset_assertions(self):
     self._send_silent_command(SmtLibCommand(smtcmd.RESET_ASSERTIONS, []))
     return
Exemple #7
0
 def pop(self, levels=1):
     self.declared_vars.pop()
     self.declared_sorts.pop()
     self._send_silent_command(SmtLibCommand(smtcmd.POP, [levels]))
Exemple #8
0
 def _cmd_get_option(self, current, tokens):
     """(get-option <keyword>)"""
     keyword = self.parse_atoms(tokens, current, 1)
     return SmtLibCommand(current, keyword)
Exemple #9
0
 def _cmd_get_proof(self, current, tokens):
     """(get-proof)"""
     self.parse_atoms(tokens, current, 0)
     return SmtLibCommand(current, [])
Exemple #10
0
 def _cmd_get_info(self, current, tokens):
     """(get-info <info_flag>)"""
     keyword = self.parse_atoms(tokens, current, 1)
     return SmtLibCommand(current, keyword)
Exemple #11
0
 def _cmd_get_model(self, current, tokens):
     """(get-model)"""
     self.parse_atoms(tokens, current, 0)
     return SmtLibCommand(current, [])
Exemple #12
0
 def _cmd_get_value(self, current, tokens):
     """(get-value (<term>+)"""
     params = self.parse_expr_list(tokens, current)
     self.consume_closing(tokens, current)
     return SmtLibCommand(current, params)
Exemple #13
0
 def _cmd_check_sat(self, current, tokens):
     """(check-sat)"""
     self.parse_atoms(tokens, current, 0)
     return SmtLibCommand(current, [])
Exemple #14
0
 def _cmd_assert(self, current, tokens):
     """(assert <term>)"""
     expr = self.get_expression(tokens)
     self.consume_closing(tokens, current)
     return SmtLibCommand(current, [expr])
Exemple #15
0
 def _declare_sort(self, sort):
     cmd = SmtLibCommand(smtcmd.DECLARE_SORT, [sort])
     self._send_silent_command(cmd)
     self.declared_sorts[-1].add(sort)
Exemple #16
0
 def _cmd_get_unsat_core(self, current, tokens):
     """(get-unsat-core)"""
     self.parse_atoms(tokens, current, 0)
     return SmtLibCommand(current, [])
Exemple #17
0
 def _declare_variable(self, symbol):
     cmd = SmtLibCommand(smtcmd.DECLARE_FUN, [symbol])
     self._send_silent_command(cmd)
     self.declared_vars[-1].add(symbol)
Exemple #18
0
 def _cmd_check_sat_assuming(self, current, tokens):
     """(check-sat-assuming (<prop_literal>*) ) """
     params = self.parse_expr_list(tokens, current)
     self.consume_closing(tokens, current)
     return SmtLibCommand(current, params)
Exemple #19
0
 def push(self, levels=1):
     self.declared_vars.append(set())
     self.declared_sorts.append(set())
     self._send_silent_command(SmtLibCommand(smtcmd.PUSH, [levels]))
Exemple #20
0
 def _cmd_echo(self, current, tokens):
     """(echo <string>)"""
     elements = self.parse_atoms(tokens, current, 1)
     return SmtLibCommand(current, elements)
Exemple #21
0
 def get_value(self, item):
     self._send_command(SmtLibCommand(smtcmd.GET_VALUE, [item]))
     lst = self._get_value_answer()
     assert len(lst) == 1
     assert len(lst[0]) == 2
     return lst[0][1]
Exemple #22
0
 def _cmd_get_assignment(self, current, tokens):
     """(get-assignment)"""
     self.parse_atoms(tokens, current, 0)
     return SmtLibCommand(current, [])
Exemple #23
0
 def _cmd_get_assertions(self, current, tokens):
     """(get_assertions)"""
     self.parse_atoms(tokens, current, 0)
     return SmtLibCommand(current, [])
Exemple #24
0
 def _cmd_set_info(self, current, tokens):
     """(set-info <attribute>)"""
     elements = self.parse_atoms(tokens, current, 2)
     return SmtLibCommand(current, elements)