class
Z3::Model
- Z3::Model
- Reference
- Object
Defined in:
z3/model.crConstructors
Instance Method Summary
- #[](expr)
-
#consts : Array(FuncDecl)
The declarations of the variables the model assigned -
#each_constis what yields the variables themselves -
#each(&)
Constants first, then functions - so what's yielded is a variable and its value, or a declaration and its interpretation, and both halves are unions
-
#each_const(&)
Yields each constant in the model as a
{variable, value}pair, sorted by name -
#each_func(&)
Yields each function as a
{declaration, interpretation}pair, sorted by name - #eval(expr : BoolExpr, complete = false)
- #eval(expr : IntExpr, complete = false)
- #eval(expr : BitvecExpr, complete = false)
- #eval(expr : CharExpr, complete = false)
- #eval(expr : FloatExpr, complete = false)
- #eval(expr : RealExpr, complete = false)
- #eval(expr : StringExpr, complete = false)
- #eval(expr : SeqExpr, complete = false)
- #eval(expr : RoundingModeExpr, complete = false)
- #func_interp(decl : FuncDecl) : FuncInterp
-
#funcs : Array(FuncDecl)
The uninterpreted functions the model decided the meaning of.
-
#has_interp?(decl : FuncDecl)
Whether the model says anything at all about this variable or function.
- #has_interp?(var : AnyExpr)
- #model_eval(expr, complete = false) : AnyExpr
-
#negate
A formula asserting the model must differ somewhere - useful for enumerating all solutions.
- #num_consts
- #num_funcs
-
#to_s(io)
This needs to go eventually
- #to_unsafe : LibZ3::Model
Constructor Detail
Instance Method Detail
The declarations of the variables the model assigned - #each_const is what
yields the variables themselves
Constants first, then functions - so what's yielded is a variable and its value, or a declaration and its interpretation, and both halves are unions
The uninterpreted functions the model decided the meaning of.
Recursive definitions are left out. Z3 puts every one made in the context into
every model, of every solver, whether or not the query so much as mentioned it -
define-fun-rec is context-global the way it is in an SMT-LIB script. It isn't
something this model decided, it's the definition handed straight back, and its
else branch is a body over de Bruijn variables which no Expr can hold.
Whether the model says anything at all about this variable or function. It's the
question #model_eval can't answer: without completion an unassigned variable
evaluates to itself, and with it Z3 invents a value rather than telling you it had to.
#eval without the sort coming back with it, for the cases where the expression's
class isn't known statically - an argument of a FuncDecl, say
A formula asserting the model must differ somewhere - useful for enumerating all solutions.
Only constants are negated. Saying "some function differs somewhere" needs a quantifier, so a model with functions in it can repeat under this.