예제 #1
0
 def pop(self, levels=1):
     for _ in xrange(levels):
         if self.failed_pushes > 0:
             self.failed_pushes -= 1
         else:
             c = yicespy.yices_pop(self.yices)
             if c != 0:
                 raise InternalSolverError("Error in pop: %s" % \
                                           yicespy.yices_error_string())
예제 #2
0
파일: yices.py 프로젝트: 0Chuzz/pysmt
 def pop(self, levels=1):
     for _ in xrange(levels):
         if self.failed_pushes > 0:
             self.failed_pushes -= 1
         else:
             c = yicespy.yices_pop(self.yices)
             if c != 0:
                 raise InternalSolverError("Error in pop: %s" % \
                                           yicespy.yices_error_string())
예제 #3
0
 def add_assertion(self, formula, named=None):
     self._assert_is_boolean(formula)
     term = self.converter.convert(formula)
     code = yicespy.yices_assert_formula(self.yices, term)
     if code != 0:
         msg = yicespy.yices_error_string()
         if code == -1 and "non-linear arithmetic" in msg:
             raise NonLinearError(formula)
         raise InternalSolverError("Yices returned non-zero code upon assert"\
                                   ": %s (code: %s)" % \
                                   (msg, code))
예제 #4
0
파일: yices.py 프로젝트: 0Chuzz/pysmt
 def add_assertion(self, formula, named=None):
     self._assert_is_boolean(formula)
     term = self.converter.convert(formula)
     code = yicespy.yices_assert_formula(self.yices, term)
     if code != 0:
         msg = yicespy.yices_error_string()
         if code == -1 and "non-linear arithmetic" in msg:
             raise NonLinearError(formula)
         raise InternalSolverError("Yices returned non-zero code upon assert"\
                                   ": %s (code: %s)" % \
                                   (msg, code))
예제 #5
0
 def push(self, levels=1):
     for _ in xrange(levels):
         c = yicespy.yices_push(self.yices)
         if c != 0:
             # 4 is STATUS_UNSAT
             if yicespy.yices_context_status(self.yices) == 4:
                 # Yices fails to push if the context is in UNSAT state
                 # (It makes no sense to conjoin formulae to False)
                 # PySMT allows this and we support it by counting the
                 # spurious push calls
                 self.failed_pushes += 1
             else:
                 raise InternalSolverError("Error in push: %s" % \
                                           yicespy.yices_error_string())
예제 #6
0
파일: yices.py 프로젝트: 0Chuzz/pysmt
 def push(self, levels=1):
     for _ in xrange(levels):
         c = yicespy.yices_push(self.yices)
         if c != 0:
             # 4 is STATUS_UNSAT
             if yicespy.yices_context_status(self.yices) == 4:
                 # Yices fails to push if the context is in UNSAT state
                 # (It makes no sense to conjoin formulae to False)
                 # PySMT allows this and we support it by counting the
                 # spurious push calls
                 self.failed_pushes += 1
             else:
                 raise InternalSolverError("Error in push: %s" % \
                                           yicespy.yices_error_string())
예제 #7
0
 def _check_term_result(self, res):
     if res == -1:
         err = yicespy.yices_error_string()
         raise InternalSolverError("Yices returned an error: " + err)
예제 #8
0
 def _check_error(self, res):
     if res != 0:
         err = yicespy.yices_error_string()
         raise InternalSolverError("Yices returned an error: " + err)
예제 #9
0
파일: yices.py 프로젝트: 0Chuzz/pysmt
 def _check_term_result(self, res):
     if res == -1:
         err = yicespy.yices_error_string()
         raise InternalSolverError("Yices returned an error: " + err)
예제 #10
0
파일: yices.py 프로젝트: 0Chuzz/pysmt
 def _check_error(self, res):
     if res != 0:
         err = yicespy.yices_error_string()
         raise InternalSolverError("Yices returned an error: " + err)