The main interaction with Z3 happens via the Context. NativeContext allows for efficient wrapper-reduced interaction with Z3 expressions. More...
NativeContext (Dictionary< string, string > settings) Constructor. More...t[0] + t[1] + ...
. More...
t[0] * t[1] * ...
. More...
t[0] - t[1] - ...
. More...
t1 / t2
. More...
t1 <= t2
More...
t1 < t2
More...
t1 >= t2
More...
t1 > t2
More...
not(a)
. More...
t[0] and t[1] and ...
. More...
t[0] or t[1] or ...
. More...
ite(t1, t2, t3)
. More...
t1 -> t2
. More...
t1 iff t2
. More...
The main interaction with Z3 happens via the Context. NativeContext allows for efficient wrapper-reduced interaction with Z3 expressions.
Definition at line 42 of file NativeContext.cs.
◆ NativeContext()The following parameters can be set:
Definition at line 62 of file NativeContext.cs.
65Debug.Assert(settings !=
null);
69IntPtr cfg = Native.Z3_mk_config();
70 foreach(KeyValuePair<string, string> kv
insettings)
71Native.Z3_set_param_value(cfg, kv.Key, kv.Value);
72m_ctx = Native.Z3_mk_context(cfg);
73Native.Z3_del_config(cfg);
◆ Dispose()Disposes of the context.
Definition at line 1371 of file NativeContext.cs.
1373 if(m_ctx != IntPtr.Zero)
1375m_n_err_handler =
null;
1377m_ctx = IntPtr.Zero;
1378Native.Z3_del_context(ctx);
1381GC.ReRegisterForFinalize(
this);
◆ EnableTrace() static void EnableTrace ( string tag ) inlinestaticEnable trace to file
Definition at line 1358 of file NativeContext.cs.
1360Debug.Assert(!
string.IsNullOrEmpty(tag));
1361Native.Z3_enable_trace(tag);
◆ GetAppArgs()Get the arguments for app
Definition at line 1145 of file NativeContext.cs.
1148var args =
new Z3_ast[numArgs];
1149 for(uint i = 0; i < numArgs; i++)
1151args[i] = GetAppArg(app, i);
uint GetNumArgs(Z3_app app)
Return number of arguments for app
◆ GetAppDecl() ◆ GetArraySortDomain()Get the domain IntPtr for Sort
Definition at line 1206 of file NativeContext.cs.
1208Debug.Assert(array != IntPtr.Zero);
1210 returnNative.Z3_get_array_sort_domain(nCtx, array);
◆ GetArraySortRange()Get the range IntPtr for Sort
Definition at line 1216 of file NativeContext.cs.
1218Debug.Assert(array != IntPtr.Zero);
1220 returnNative.Z3_get_array_sort_range(nCtx, array);
◆ GetAstKind()Get the AST kind from IntPtr
Definition at line 1113 of file NativeContext.cs.
1115Debug.Assert(ast != IntPtr.Zero);
1117 return(
Z3_ast_kind)Native.Z3_get_ast_kind(nCtx, ast);
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types.
Referenced by NativeModel.TryGetArrayValue().
◆ GetBvSortSize() uint GetBvSortSize ( Z3_sort bvSort ) inlineGet size of BitVector Sort
Definition at line 1196 of file NativeContext.cs.
1198Debug.Assert(bvSort != IntPtr.Zero);
1200 returnNative.Z3_get_bv_sort_size(nCtx, bvSort);
◆ GetDeclKind() ◆ GetDeclName()Get string name for Decl
Definition at line 1185 of file NativeContext.cs.
1187Debug.Assert(decl != IntPtr.Zero);
1189var namePtr = Native.Z3_get_decl_name(nCtx, decl);
1190 returnMarshal.PtrToStringAnsi(namePtr);
◆ GetDomain()Get domain for a funcdecl
Definition at line 1045 of file NativeContext.cs.
1047Debug.Assert(fdecl != IntPtr.Zero);
1049var sz = Native.Z3_get_domain_size(nCtx, fdecl);
1050var domain =
new Z3_sort[sz];
1051 for(uint i = 0; i < sz; i++)
1053domain[i] = Native.Z3_get_domain(nCtx, fdecl, i);
◆ GetNumArgs() uint GetNumArgs ( Z3_app app ) inline ◆ GetNumeralString() string GetNumeralString ( Z3_ast v ) inlineGet string for numeral ast
Definition at line 1304 of file NativeContext.cs.
1306Debug.Assert(v != IntPtr.Zero);
1307 returnNative.Z3_get_numeral_string(nCtx, v);
◆ GetRange()Get range for a funcdecl
Definition at line 1063 of file NativeContext.cs.
1065Debug.Assert(fdecl != IntPtr.Zero);
1067 returnNative.Z3_get_range(nCtx, fdecl);
◆ GetSort()Definition at line 1133 of file NativeContext.cs.
1135Debug.Assert(ast != IntPtr.Zero);
1137 returnNative.Z3_get_sort(nCtx, ast);
◆ GetSortKind()Get the sort kind from IntPtr
Definition at line 1103 of file NativeContext.cs.
1105Debug.Assert(sort != IntPtr.Zero);
1107 return(
Z3_sort_kind)Native.Z3_get_sort_kind(nCtx, sort);
Z3_sort_kind
The different kinds of Z3 types (See Z3_get_sort_kind).
◆ GetStatistics()Retrieve statistics as an array of entries
Definition at line 1407 of file NativeContext.cs.
1409Native.Z3_stats_inc_ref(nCtx, stats);
1410var result = Statistics.NativeEntries(nCtx, stats);
1411Native.Z3_stats_dec_ref(nCtx, stats);
◆ MkAdd()Create an expression representing t[0] + t[1] + ...
.
Definition at line 83 of file NativeContext.cs.
85Debug.Assert(t !=
null);
86Debug.Assert(t.All(a => a != IntPtr.Zero));
88 returnNative.Z3_mk_add(nCtx, (uint)(t?.
Length?? 0), t);
◆ MkAnd()Create an expression representing t[0] and t[1] and ...
.
Definition at line 221 of file NativeContext.cs.
223Debug.Assert(t !=
null);
224Debug.Assert(t.All(a => a != IntPtr.Zero));
226 returnNative.Z3_mk_and(nCtx, (uint)(t?.
Length?? 0), t);
◆ MkApp()Create a new function application.
Definition at line 466 of file NativeContext.cs.
468Debug.Assert(f != IntPtr.Zero);
469Debug.Assert(args ==
null|| args.All(a => a != IntPtr.Zero));
471 returnNative.Z3_mk_app(nCtx, f, (uint)(args?.
Length?? 0), args);
Referenced by NativeSolver.AssertInjective().
◆ MkArraySort()Create a new array sort.
Definition at line 381 of file NativeContext.cs.
383Debug.Assert(domain != IntPtr.Zero);
384Debug.Assert(
range!= IntPtr.Zero);
386 returnNative.Z3_mk_array_sort(nCtx, domain,
range);
expr range(expr const &lo, expr const &hi)
◆ MkBool() ◆ MkBound()Creates a new bound variable.
Definition at line 482 of file NativeContext.cs.
484Debug.Assert(sort != IntPtr.Zero);
486 returnNative.Z3_mk_bound(nCtx, index, sort);
Referenced by NativeSolver.AssertInjective().
◆ MkBvAdd()Two's complement addition.
The arguments must have the same bit-vector sort.
Definition at line 540 of file NativeContext.cs.
542Debug.Assert(t1 != IntPtr.Zero);
543Debug.Assert(t2 != IntPtr.Zero);
545 returnNative.Z3_mk_bvadd(nCtx, t1, t2);
◆ MkBvAnd()Bitwise conjunction.
The arguments must have a bit-vector sort.
Definition at line 495 of file NativeContext.cs.
497Debug.Assert(t1 != IntPtr.Zero);
498Debug.Assert(t2 != IntPtr.Zero);
500 returnNative.Z3_mk_bvand(nCtx, t1, t2);
◆ MkBvAshr()Arithmetic shift right
It is like logical shift right except that the most significant bits of the result always copy the most significant bit of the second argument.
NB. The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling.
The arguments must have a bit-vector sort.
Definition at line 649 of file NativeContext.cs.
651Debug.Assert(t1 != IntPtr.Zero);
652Debug.Assert(t2 != IntPtr.Zero);
654 returnNative.Z3_mk_bvashr(nCtx, t1, t2);
◆ MkBvExtract()Bit-vector extraction.
Extract the bits high down to low from a bitvector of size m
to yield a new bitvector of size n
, where n = high - low + 1
. The argument t must have a bit-vector sort.
Definition at line 557 of file NativeContext.cs.
559Debug.Assert(t != IntPtr.Zero);
561 returnNative.Z3_mk_extract(nCtx, high, low, t);
◆ MkBvLshr()Logical shift right
It is equivalent to unsigned division by 2^x
where x
is the value of t2 .
NB. The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling.
The arguments must have a bit-vector sort.
Definition at line 627 of file NativeContext.cs.
629Debug.Assert(t1 != IntPtr.Zero);
630Debug.Assert(t2 != IntPtr.Zero);
632 returnNative.Z3_mk_bvlshr(nCtx, t1, t2);
◆ MkBvMul()Two's complement multiplication.
The arguments must have the same bit-vector sort.
Definition at line 675 of file NativeContext.cs.
677Debug.Assert(t1 != IntPtr.Zero);
678Debug.Assert(t2 != IntPtr.Zero);
680 returnNative.Z3_mk_bvmul(nCtx, t1, t2);
◆ MkBvNeg()Standard two's complement unary minus.
The arguments must have a bit-vector sort.
Definition at line 518 of file NativeContext.cs.
520Debug.Assert(t != IntPtr.Zero);
522 returnNative.Z3_mk_bvneg(nCtx, t);
◆ MkBVNeg()Standard two's complement unary minus.
The arguments must have a bit-vector sort.
Definition at line 529 of file NativeContext.cs.
531Debug.Assert(t != IntPtr.Zero);
533 returnNative.Z3_mk_bvneg(nCtx, t);
◆ MkBvNot()Bitwise negation.
The argument must have a bit-vector sort.
Definition at line 507 of file NativeContext.cs.
509Debug.Assert(t != IntPtr.Zero);
511 returnNative.Z3_mk_bvnot(nCtx, t);
◆ MkBvOr()Bitwise disjunction.
The arguments must have a bit-vector sort.
Definition at line 771 of file NativeContext.cs.
773Debug.Assert(t1 != IntPtr.Zero);
774Debug.Assert(t2 != IntPtr.Zero);
776 returnNative.Z3_mk_bvor(nCtx, t1, t2);
◆ MkBvSdiv()Signed division.
It is defined in the following way:
floor
of t1/t2
if t2
is different from zero, and t1*t2 >= 0
.ceiling
of t1/t2
if t2
is different from zero, and t1*t2 < 0
.If t2
is zero, then the result is undefined. The arguments must have the same bit-vector sort.
Definition at line 713 of file NativeContext.cs.
715Debug.Assert(t1 != IntPtr.Zero);
716Debug.Assert(t2 != IntPtr.Zero);
718 returnNative.Z3_mk_bvsdiv(nCtx, t1, t2);
◆ MkBvShl()Shift left.
It is equivalent to multiplication by 2^x
where x
is the value of t2 .
NB. The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling.
The arguments must have a bit-vector sort.
Definition at line 607 of file NativeContext.cs.
609Debug.Assert(t1 != IntPtr.Zero);
610Debug.Assert(t2 != IntPtr.Zero);
612 returnNative.Z3_mk_bvshl(nCtx, t1, t2);
◆ MkBvSignExt()Bit-vector sign extension.
Sign-extends the given bit-vector to the (signed) equivalent bitvector of size m+i
, where m
is the size of the given bit-vector. The argument t must have a bit-vector sort.
Definition at line 572 of file NativeContext.cs.
574Debug.Assert(t != IntPtr.Zero);
576 returnNative.Z3_mk_sign_ext(nCtx, i, t);
◆ MkBvSlt()Two's complement signed less-than
The arguments must have the same bit-vector sort.
Definition at line 663 of file NativeContext.cs.
665Debug.Assert(t1 != IntPtr.Zero);
666Debug.Assert(t2 != IntPtr.Zero);
668 returnNative.Z3_mk_bvslt(nCtx, t1, t2);
◆ MkBvSort() ◆ MkBvSrem()Signed remainder.
It is defined as t1 - (t1 /s t2) * t2
, where /s
represents signed division. The most significant bit (sign) of the result is equal to the most significant bit of t1
.
If t2
is zero, then the result is undefined. The arguments must have the same bit-vector sort.
Definition at line 747 of file NativeContext.cs.
749Debug.Assert(t1 != IntPtr.Zero);
750Debug.Assert(t2 != IntPtr.Zero);
752 returnNative.Z3_mk_bvsrem(nCtx, t1, t2);
◆ MkBvSub()Two's complement subtraction.
The arguments must have the same bit-vector sort.
Definition at line 759 of file NativeContext.cs.
761Debug.Assert(t1 != IntPtr.Zero);
762Debug.Assert(t2 != IntPtr.Zero);
764 returnNative.Z3_mk_bvsub(nCtx, t1, t2);
◆ MkBvUdiv()Unsigned division.
It is defined as the floor of t1/t2
if t2
is different from zero. If t2
is zero, then the result is undefined. The arguments must have the same bit-vector sort.
Definition at line 692 of file NativeContext.cs.
694Debug.Assert(t1 != IntPtr.Zero);
695Debug.Assert(t2 != IntPtr.Zero);
697 returnNative.Z3_mk_bvudiv(nCtx, t1, t2);
◆ MkBvUle()Unsigned less-than-equal
The arguments must have the same bit-vector sort.
Definition at line 189 of file NativeContext.cs.
191Debug.Assert(t1 != IntPtr.Zero);
192Debug.Assert(t2 != IntPtr.Zero);
194 returnNative.Z3_mk_bvule(nCtx, t1, t2);
◆ MkBvUlt()Unsigned less-than
The arguments must have the same bit-vector sort.
Definition at line 175 of file NativeContext.cs.
177Debug.Assert(t1 != IntPtr.Zero);
178Debug.Assert(t2 != IntPtr.Zero);
180 returnNative.Z3_mk_bvult(nCtx, t1, t2);
◆ MkBvUrem()Unsigned remainder.
It is defined as t1 - (t1 /u t2) * t2
, where /u
represents unsigned division. If t2
is zero, then the result is undefined. The arguments must have the same bit-vector sort.
Definition at line 729 of file NativeContext.cs.
731Debug.Assert(t1 != IntPtr.Zero);
732Debug.Assert(t2 != IntPtr.Zero);
734 returnNative.Z3_mk_bvurem(nCtx, t1, t2);
◆ MkBvXor()Bitwise XOR.
The arguments must have a bit-vector sort.
Definition at line 783 of file NativeContext.cs.
785Debug.Assert(t1 !=
null);
786Debug.Assert(t2 != IntPtr.Zero);
788 returnNative.Z3_mk_bvxor(nCtx, t1, t2);
◆ MkBvZeroExt()Bit-vector zero extension.
Extend the given bit-vector with zeros to the (unsigned) equivalent bitvector of size m+i
, where m
is the size of the given bit-vector. The argument t must have a bit-vector sort.
Definition at line 588 of file NativeContext.cs.
590Debug.Assert(t != IntPtr.Zero);
592 returnNative.Z3_mk_zero_ext(nCtx, i, t);
◆ MkConst()Creates a new Constant of sort range and named name .
Definition at line 438 of file NativeContext.cs.
440Debug.Assert(!
string.IsNullOrEmpty(name));
441Debug.Assert(
range!= IntPtr.Zero);
Z3_symbol MkStringSymbol(string name)
Return a ptr to symbol for string
◆ MkConstArray()Create a constant array.
The resulting term is an array, such that a select
on an arbitrary index produces the value v
.
Definition at line 920 of file NativeContext.cs.
922Debug.Assert(domain != IntPtr.Zero);
923Debug.Assert(v != IntPtr.Zero);
925 returnNative.Z3_mk_const_array(nCtx, domain, v);
◆ MkConstDecl()Creates a new constant function declaration.
Definition at line 1032 of file NativeContext.cs.
1034Debug.Assert(
range!= IntPtr.Zero);
1036var symbol = Native.Z3_mk_string_symbol(nCtx, name);
1037 returnNative.Z3_mk_func_decl(nCtx, symbol, 0,
newIntPtr[0],
range);
◆ MkDefault()Access the array default value.
Produces the default range value, for arrays that can be represented as finite maps with a default range value.
Definition at line 978 of file NativeContext.cs.
980Debug.Assert(a !=
null);
982 returnNative.Z3_mk_array_default(nCtx, a);
◆ MkDiv()Create an expression representing t1 / t2
.
Definition at line 117 of file NativeContext.cs.
119Debug.Assert(t1 != IntPtr.Zero);
120Debug.Assert(t2 != IntPtr.Zero);
122 returnNative.Z3_mk_div(nCtx, t1, t2);
◆ MkEq() ◆ MkExists()Same as MkForAll but defaults to "forall" = false Create an existential Quantifier.
Definition at line 835 of file NativeContext.cs.
837 returnMkQuantifier(
false, sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
◆ MkFalse() ◆ MkForall()Create a universal Quantifier.
Creates a forall formula, where weight is the weight, patterns is an array of patterns, sorts is an array with the sorts of the bound variables, names is an array with the 'names' of the bound variables, and body is the body of the quantifier. Quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. Note that the bound variables are de-Bruijn indices created using MkBound. Z3 applies the convention that the last element in names and sorts refers to the variable with index 0, the second to last element of names and sorts refers to the variable with index 1, etc.
MkPattern
. noPatterns array containing the anti-patterns created using MkPattern
. quantifierID optional symbol to track quantifier. skolemID optional symbol to track skolem constants.
Definition at line 817 of file NativeContext.cs.
819 returnMkQuantifier(
true, sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
Referenced by NativeSolver.AssertInjective().
◆ MkFreshFuncDecl()Creates a fresh function declaration with a name prefixed with prefix .
Definition at line 1020 of file NativeContext.cs.
1022Debug.Assert(domain !=
null);
1023Debug.Assert(
range!= IntPtr.Zero);
1024Debug.Assert(domain.All(d => d != IntPtr.Zero));
1026 returnNative.Z3_mk_fresh_func_decl(nCtx, prefix, (uint)(domain?.
Length?? 0), domain,
range);
Referenced by NativeSolver.AssertInjective().
◆ MkFuncDecl() [1/2]Creates a new function declaration.
Definition at line 1006 of file NativeContext.cs.
1008Debug.Assert(!
string.IsNullOrEmpty(name));
1009Debug.Assert(
range!= IntPtr.Zero);
1010Debug.Assert(domain != IntPtr.Zero);
1012var symbol = Native.Z3_mk_string_symbol(nCtx, name);
1013var q =
new Z3_sort[] { domain };
1014 returnNative.Z3_mk_func_decl(nCtx, symbol, (uint)q.Length, q,
range);
◆ MkFuncDecl() [2/2]Creates a new function declaration.
Definition at line 992 of file NativeContext.cs.
994Debug.Assert(!
string.IsNullOrEmpty(name));
995Debug.Assert(
range!= IntPtr.Zero);
996Debug.Assert(domain !=
null);
997Debug.Assert(domain.All(d => d != IntPtr.Zero));
999var symbol = Native.Z3_mk_string_symbol(nCtx, name);
1000 returnNative.Z3_mk_func_decl(nCtx, symbol, (uint)(domain?.
Length?? 0), domain,
range);
◆ MkGe()Create an expression representing t1 >= t2
Definition at line 150 of file NativeContext.cs.
152Debug.Assert(t1 != IntPtr.Zero);
153Debug.Assert(t2 != IntPtr.Zero);
155 returnNative.Z3_mk_ge(nCtx, t1, t2);
◆ MkGt()Create an expression representing t1 > t2
Definition at line 161 of file NativeContext.cs.
163Debug.Assert(t1 != IntPtr.Zero);
164Debug.Assert(t2 != IntPtr.Zero);
166 returnNative.Z3_mk_gt(nCtx, t1, t2);
◆ MkIff()Create an expression representing t1 iff t2
.
Definition at line 425 of file NativeContext.cs.
427Debug.Assert(t1 != IntPtr.Zero);
428Debug.Assert(t2 != IntPtr.Zero);
430 returnNative.Z3_mk_iff(nCtx, t1, t2);
◆ MkImplies()Create an expression representing t1 -> t2
.
Definition at line 306 of file NativeContext.cs.
308Debug.Assert(t1 != IntPtr.Zero);
309Debug.Assert(t2 != IntPtr.Zero);
311 returnNative.Z3_mk_implies(nCtx, t1, t2);
◆ MkIte()Create an expression representing an if-then-else: ite(t1, t2, t3)
.
Definition at line 294 of file NativeContext.cs.
296Debug.Assert(t1 != IntPtr.Zero);
297Debug.Assert(t2 != IntPtr.Zero);
298Debug.Assert(t3 != IntPtr.Zero);
300 returnNative.Z3_mk_ite(nCtx, t1, t2, t3);
◆ MkLe()Create an expression representing t1 <= t2
Definition at line 128 of file NativeContext.cs.
130Debug.Assert(t1 != IntPtr.Zero);
131Debug.Assert(t2 != IntPtr.Zero);
133 returnNative.Z3_mk_le(nCtx, t1, t2);
◆ MkListSort()returns ListSort
Definition at line 352 of file NativeContext.cs.
357Debug.Assert(!
string.IsNullOrEmpty(name));
358Debug.Assert(elemSort != IntPtr.Zero);
360IntPtr nil = IntPtr.Zero, isnil = IntPtr.Zero,
361cons = IntPtr.Zero, iscons = IntPtr.Zero,
362head = IntPtr.Zero, tail = IntPtr.Zero;
364var symbol = Native.Z3_mk_string_symbol(nCtx, name);
365var sort = Native.Z3_mk_list_sort(nCtx, symbol, elemSort,
366ref nil, ref isnil, ref cons, ref iscons, ref head, ref tail);
◆ MkLt()Create an expression representing t1 < t2
Definition at line 139 of file NativeContext.cs.
141Debug.Assert(t1 != IntPtr.Zero);
142Debug.Assert(t2 != IntPtr.Zero);
144 returnNative.Z3_mk_lt(nCtx, t1, t2);
◆ MkMul()Create an expression representing t[0] * t[1] * ...
.
Definition at line 94 of file NativeContext.cs.
96Debug.Assert(t !=
null);
97Debug.Assert(t.All(a => a != IntPtr.Zero));
100 returnNative.Z3_mk_mul(nCtx, (uint)(ts?.
Length?? 0), ts);
◆ MkNot()Mk an expression representing not(a)
.
Definition at line 211 of file NativeContext.cs.
213Debug.Assert(a != IntPtr.Zero);
215 returnNative.Z3_mk_not(nCtx, a);
◆ MkNumeral() [1/3]Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer.
Definition at line 257 of file NativeContext.cs.
259Debug.Assert(sort != IntPtr.Zero);
261 returnNative.Z3_mk_int(nCtx, v, sort);
◆ MkNumeral() [2/3]Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer.
Definition at line 281 of file NativeContext.cs.
283Debug.Assert(sort !=
null);
285 returnNative.Z3_mk_int64(nCtx, v, sort);
◆ MkNumeral() [3/3]Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer.
Definition at line 269 of file NativeContext.cs.
271Debug.Assert(sort !=
null);
273 returnNative.Z3_mk_unsigned_int(nCtx, v, sort);
◆ MkOr()Create an expression representing t[0] or t[1] or ...
.
Definition at line 232 of file NativeContext.cs.
234Debug.Assert(t !=
null);
235Debug.Assert(t.All(a => a != IntPtr.Zero));
237 returnNative.Z3_mk_or(nCtx, (uint)(t?.
Length?? 0), t);
◆ MkPattern()Create a quantifier pattern.
Definition at line 1076 of file NativeContext.cs.
1078Debug.Assert(terms !=
null);
1079 if(terms ==
null|| terms.Length == 0)
1080 throw newZ3Exception(
"Cannot create a pattern from zero terms");
1082 returnNative.Z3_mk_pattern(nCtx, (uint)terms.Length, terms);
◆ MkReal()Create a real numeral.
Definition at line 246 of file NativeContext.cs.
248Debug.Assert(!
string.IsNullOrEmpty(v));
249 returnNative.Z3_mk_numeral(nCtx, v,
RealSort);
Z3_sort RealSort
Returns the "singleton" RealSort for this NativeContext
◆ MkSelect()Array read.
The argument array
is the array and index
is the index of the array that gets read.
The node array
must have an array sort [domain -> range]
, and index
must have the sort domain
. The sort of the result is range
.
Definition at line 963 of file NativeContext.cs.
965Debug.Assert(array != IntPtr.Zero);
966Debug.Assert(index != IntPtr.Zero);
968 returnNative.Z3_mk_select(nCtx, array, index);
◆ MkSimpleSolver()Creates a new (incremental) solver.
Definition at line 1091 of file NativeContext.cs.
1093 Z3_solvernSolver = Native.Z3_mk_simple_solver(nCtx);
1094 return newNativeSolver(
this, nSolver);
◆ MkStore()Array update.
The node a
must have an array sort [domain -> range]
, i
must have sort domain
, v
must have sort range. The sort of the result is [domain -> range]
. The semantics of this function is given by the theory of arrays described in the SMT-LIB standard. See http://smtlib.org for more details. The result of this function is an array that is equal to a
(with respect to select
) on all indices except for i
, where it maps to v
(and the select
of a
with respect to i
may be a different value).
Definition at line 943 of file NativeContext.cs.
945Debug.Assert(a != IntPtr.Zero);
946Debug.Assert(i != IntPtr.Zero);
947Debug.Assert(v != IntPtr.Zero);
949 returnNative.Z3_mk_store(nCtx, a, i, v);
◆ MkStringSymbol()Return a ptr to symbol for string
Definition at line 454 of file NativeContext.cs.
456Debug.Assert(!
string.IsNullOrEmpty(name));
458 returnNative.Z3_mk_string_symbol(nCtx, name);
Referenced by NativeContext.MkConst().
◆ MkSub()Create an expression representing t[0] - t[1] - ...
.
Definition at line 106 of file NativeContext.cs.
108Debug.Assert(t !=
null);
109Debug.Assert(t.All(a => a != IntPtr.Zero));
110var ts = t.ToArray();
111 returnNative.Z3_mk_sub(nCtx, (uint)(ts?.
Length?? 0), ts);
◆ MkTrue() ◆ MkTupleSort()Create a new tuple sort.
Definition at line 392 of file NativeContext.cs.
394Debug.Assert(name != IntPtr.Zero);
395Debug.Assert(fieldNames !=
null);
396Debug.Assert(fieldNames.All(fn => fn != IntPtr.Zero));
397Debug.Assert(fieldSorts ==
null|| fieldSorts.All(fs => fs != IntPtr.Zero));
399var numFields = (uint)(fieldNames?.
Length?? 0);
400constructor = IntPtr.Zero;
401 returnNative.Z3_mk_tuple_sort(nCtx, name, numFields, fieldNames, fieldSorts, ref constructor, projections);
◆ ToArray()Utility to convert a vector object of ast to a .Net array
Definition at line 1391 of file NativeContext.cs.
1393Native.Z3_ast_vector_inc_ref(nCtx, vec);
1394var sz = Native.Z3_ast_vector_size(nCtx, vec);
1395var result =
new Z3_ast[sz];
1396 for(uint i = 0; i < sz; ++i)
1397result[i] = Native.Z3_ast_vector_get(nCtx, vec, i);
1398Native.Z3_ast_vector_dec_ref(nCtx, vec);
◆ ToggleWarningMessages() void ToggleWarningMessages ( bool turnOn )Enable or disable warning messages
Get printable string representing Z3_ast
Definition at line 1315 of file NativeContext.cs.
1317Debug.Assert(ast != IntPtr.Zero);
1319 returnNative.Z3_ast_to_string(nCtx, ast);
◆ TryGetNumeralInt() bool TryGetNumeralInt ( Z3_ast v, out int i ) inlineTry to get integer from AST
Definition at line 1229 of file NativeContext.cs.
1231Debug.Assert(v != IntPtr.Zero);
1234 if(Native.Z3_get_numeral_int(nCtx, v, ref result) == 0)
◆ TryGetNumeralInt64() bool TryGetNumeralInt64 ( Z3_ast v, out long i ) inlineTry to get long from AST
Definition at line 1267 of file NativeContext.cs.
1269Debug.Assert(v != IntPtr.Zero);
1271 longresult = i = 0;
1272 if(Native.Z3_get_numeral_int64(nCtx, v, ref result) == 0)
◆ TryGetNumeralUInt() bool TryGetNumeralUInt ( Z3_ast v, out uint u ) inlineTry to get uint from AST
Definition at line 1248 of file NativeContext.cs.
1250Debug.Assert(v != IntPtr.Zero);
1252uint result = u = 0;
1253 if(Native.Z3_get_numeral_uint(nCtx, v, ref result) == 0)
◆ TryGetNumeralUInt64() bool TryGetNumeralUInt64 ( Z3_ast v, out ulong u ) inlineTry get ulong from AST
Definition at line 1286 of file NativeContext.cs.
1288Debug.Assert(v != IntPtr.Zero);
1290ulong result = u = 0;
1291 if(Native.Z3_get_numeral_uint64(nCtx, v, ref result) == 0)
◆ BoolSort ◆ IntSort ◆ PrintModeSelects the format used for pretty-printing expressions.
The default mode for pretty printing expressions is to produce SMT-LIB style output where common subexpressions are printed at each occurrence. The mode is called Z3_PRINT_SMTLIB_FULL. To print shared common subexpressions only once, use the Z3_PRINT_LOW_LEVEL mode. To print in way that conforms to SMT-LIB standards and uses let expressions to share common sub-expressions use Z3_PRINT_SMTLIB_COMPLIANT.
Definition at line 903 of file NativeContext.cs.
905 set{ Native.Z3_set_ast_print_mode(nCtx, (uint)value); }
◆ RealSortRetroSearch 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