A Model contains interpretations (assignments) of constants and functions. More...
A Model contains interpretations (assignments) of constants and functions.
Definition at line 29 of file Model.cs.
◆ ConstInterp() [1/2]Retrieves the interpretation (the assignment) of a in the model.
Definition at line 36 of file Model.cs.
38Debug.Assert(a !=
null);
Expr ConstInterp(Expr a)
Retrieves the interpretation (the assignment) of a in the model.
Context Context
Access Context object
◆ ConstInterp() [2/2]Retrieves the interpretation (the assignment) of f in the model.
Definition at line 49 of file Model.cs.
51Debug.Assert(f !=
null);
55 throw newZ3Exception(
"Non-zero arity functions have FunctionInterpretations as a model. Use FuncInterp.");
57IntPtr n = Native.Z3_model_get_const_interp(
Context.nCtx, NativeObject, f.NativeObject);
61 returnExpr.Create(
Context, n);
◆ Double()Evaluate expression to a double, assuming it is a numeral already.
Definition at line 244 of file Model.cs.
245 usingvar r =
Eval(t,
true);
246 returnNative.Z3_get_numeral_double(
Context.nCtx, r.NativeObject);
Expr Eval(Expr t, bool completion=false)
Evaluates the expression t in the current model.
◆ Eval() Expr Eval ( Expr t, bool completion =false
) inline
Evaluates the expression t in the current model.
This function may fail if t contains quantifiers, is partial (MODEL_PARTIAL enabled), or if t is not well-sorted. In this case a ModelEvaluationFailedException
is thrown.
Definition at line 220 of file Model.cs.
222Debug.Assert(t !=
null);
224IntPtr v = IntPtr.Zero;
225 if(Native.Z3_model_eval(
Context.nCtx, NativeObject, t.NativeObject, (
byte)(completion ? 1 : 0), ref v) == (
byte)0)
226 throw newModelEvaluationFailedException();
228 returnExpr.Create(
Context, v);
Referenced by Model.Double(), and Model.Evaluate().
◆ Evaluate() Expr Evaluate ( Expr t, bool completion =false
) inline
Alias for Eval
.
Definition at line 234 of file Model.cs.
236Debug.Assert(t !=
null);
238 return Eval(t, completion);
◆ FuncInterp()Retrieves the interpretation (the assignment) of a non-constant f in the model.
Definition at line 69 of file Model.cs.
71Debug.Assert(f !=
null);
79IntPtr n = Native.Z3_model_get_const_interp(
Context.nCtx, NativeObject, f.NativeObject);
87 if(Native.Z3_is_as_array(
Context.nCtx, n) == 0)
88 throw newZ3Exception(
"Argument was not an array constant");
89IntPtr fd = Native.Z3_get_as_array_func_decl(
Context.nCtx, n);
90 usingvar decl =
newFuncDecl(
Context, fd);
96 throw newZ3Exception(
"Constant functions do not have a function interpretation; use ConstInterp");
101IntPtr n = Native.Z3_model_get_func_interp(
Context.nCtx, NativeObject, f.NativeObject);
102 if(n == IntPtr.Zero)
FuncInterp FuncInterp(FuncDecl f)
Retrieves the interpretation (the assignment) of a non-constant f in the model.
Z3_sort_kind
The different kinds of Z3 types (See Z3_get_sort_kind).
◆ SortUniverse()The finite set of distinct values that represent the interpretation for sort s .
Definition at line 283 of file Model.cs.
285Debug.Assert(s !=
null);
287 usingASTVector av =
newASTVector(
Context, Native.Z3_model_get_sort_universe(
Context.nCtx, NativeObject, s.NativeObject));
288 returnav.ToExprArray();
◆ ToString() override string ToString ( ) inlineConversion of models to strings.
Definition at line 295 of file Model.cs.
297 returnNative.Z3_model_to_string(
Context.nCtx, NativeObject);
◆ ConstDeclsThe function declarations of the constants in the model.
Definition at line 120 of file Model.cs.
126FuncDecl[] res =
newFuncDecl[n];
127 for(uint i = 0; i < n; i++)
128res[i] =
newFuncDecl(
Context, Native.Z3_model_get_const_decl(
Context.nCtx, NativeObject, i));
uint NumConsts
The number of constants that have an interpretation in the model.
◆ ConstsEnumerate constants in model.
Definition at line 136 of file Model.cs.
141 for(uint i = 0; i < nc; ++i)
143var f =
newFuncDecl(
Context, Native.Z3_model_get_const_decl(
Context.nCtx, NativeObject, i));
144IntPtr n = Native.Z3_model_get_const_interp(
Context.nCtx, NativeObject, f.NativeObject);
145 if(n == IntPtr.Zero)
continue;
146yield
return newKeyValuePair<FuncDecl, Expr>(f, Expr.Create(
Context, n));
◆ DeclsAll symbols that have an interpretation in the model.
Definition at line 178 of file Model.cs.
185uint n = nFuncs + nConsts;
186FuncDecl[] res =
newFuncDecl[n];
187 for(uint i = 0; i < nConsts; i++)
188res[i] =
newFuncDecl(
Context, Native.Z3_model_get_const_decl(
Context.nCtx, NativeObject, i));
189 for(uint i = 0; i < nFuncs; i++)
190res[nConsts + i] =
newFuncDecl(
Context, Native.Z3_model_get_func_decl(
Context.nCtx, NativeObject, i));
uint NumFuncs
The number of function interpretations in the model.
◆ FuncDeclsThe function declarations of the function interpretations in the model.
Definition at line 162 of file Model.cs.
168FuncDecl[] res =
newFuncDecl[n];
169 for(uint i = 0; i < n; i++)
170res[i] =
newFuncDecl(
Context, Native.Z3_model_get_func_decl(
Context.nCtx, NativeObject, i));
◆ NumConstsThe number of constants that have an interpretation in the model.
Definition at line 112 of file Model.cs.
114 get{
returnNative.Z3_model_get_num_consts(
Context.nCtx, NativeObject); }
◆ NumFuncsThe number of function interpretations in the model.
Definition at line 154 of file Model.cs.
156 get{
returnNative.Z3_model_get_num_funcs(
Context.nCtx, NativeObject); }
◆ NumSortsThe number of uninterpreted sorts that the model has an interpretation for.
Definition at line 252 of file Model.cs.
252{
get{
returnNative.Z3_model_get_num_sorts(
Context.nCtx, NativeObject); } }
◆ SortsThe uninterpreted sorts that the model has an interpretation for.
Z3 also provides an interpretation for uninterpreted sorts used in a formula. The interpretation for a sort is a finite set of distinct values. We say this finite set is the "universe" of the sort.
Definition at line 264 of file Model.cs.
270Sort[] res =
newSort[n];
271 for(uint i = 0; i < n; i++)
272res[i] = Sort.Create(
Context, Native.Z3_model_get_sort(
Context.nCtx, NativeObject, i));
uint NumSorts
The number of uninterpreted sorts that the model has an interpretation for.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4