3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +00:00

return proper ast-option from get_const_interp function insetad of raising exceptions from inside the C API. Fixes discrepancy with documentation and behavior across extensions of the API. Issue #587

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-05-15 13:29:38 -07:00
parent e5ca676251
commit cd937c07f3
3 changed files with 8 additions and 3 deletions

View file

@ -5516,7 +5516,10 @@ class ModelRef(Z3PPObject):
decl = decl.decl()
try:
if decl.arity() == 0:
r = _to_expr_ref(Z3_model_get_const_interp(self.ctx.ref(), self.model, decl.ast), self.ctx)
_r = Z3_model_get_const_interp(self.ctx.ref(), self.model, decl.ast)
if _r.value is None:
return None
r = _to_expr_ref(_r, self.ctx)
if is_as_array(r):
return self.get_interp(get_as_array_func(r))
else: