def _get_yices_rational_value(self, term): n = ctypes.c_int64() d = ctypes.c_uint64() status = libyices.yices_get_rational64_value( self.model, term, ctypes.byref(n), ctypes.byref(d)) assert status == 0, "Failed to read the variable from the model" return Fraction(n.value, d.value)
def _get_yices_rational_value(self, term): n = ctypes.c_int64() d = ctypes.c_uint64() status = libyices.yices_get_rational64_value( self.model, term, ctypes.byref(n), ctypes.byref(d)) if status != 0: raise InternalSolverError("Failed to read the variable from " \ "the model: %s" % \ libyices.yices_error_string()) return Fraction(n.value, d.value)