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