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:
parent
e5ca676251
commit
cd937c07f3
3 changed files with 8 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue