A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://z3prover.github.io/api/html/class_microsoft_1_1_z3_1_1_native_model.html below:

Z3: NativeModel Class Reference

A Model contains interpretations (assignments) of constants and functions. More...

A Model contains interpretations (assignments) of constants and functions.

Definition at line 36 of file NativeModel.cs.

◆ ConstFuncInterp()

Retrieves the interpretation (the assignment) of f in the model.

Parameters
f A function declaration of zero arity
Returns
An expression if the function has an interpretation in the model, null otherwise.

Definition at line 51 of file NativeModel.cs.

53  if

(Native.Z3_get_arity(ntvContext.nCtx, f) != 0)

54  throw new

Z3Exception(

"Non-zero arity functions have FunctionInterpretations as a model. Use FuncInterp."

);

56  return

Native.Z3_model_get_const_interp(ntvContext.nCtx, NativeObject, f);

◆ ConstInterp()

Retrieves the interpretation (the assignment) of a in the model.

Parameters
Returns
An expression if the constant has an interpretation in the model, null otherwise.
◆ Dispose()

Disposes of the underlying native Z3 object.

Definition at line 368 of file NativeModel.cs.

370  if

(NativeObject != IntPtr.Zero)

372

Native.Z3_model_dec_ref(ntvContext.nCtx, NativeObject);

373

NativeObject = IntPtr.Zero;

375

GC.SuppressFinalize(

this

);

◆ Double()

Evaluate expression to a double, assuming it is a numeral already.

Definition at line 232 of file NativeModel.cs.

234

var r =

Eval

(t,

true

);

235  return

Native.Z3_get_numeral_double(ntvContext.nCtx, r);

Z3_ast Eval(Z3_ast t, bool completion=false)

Evaluates the expression t in the current model.

◆ Eval()

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.

Parameters
t An expression completion When this flag is enabled, a model value will be assigned to any constant or function that does not have an interpretation in the model.
Returns
The evaluation of t in the model.

Definition at line 214 of file NativeModel.cs.

217

IntPtr v = IntPtr.Zero;

218  if

(Native.Z3_model_eval(ntvContext.nCtx, NativeObject, t, (

byte

)(completion ? 1 : 0), ref v) == (

byte

)0)

219  throw new

ModelEvaluationFailedException();

Referenced by NativeModel.Double(), and NativeModel.TryGetArrayValue().

◆ Evaluate() ◆ FuncInterp()

Retrieves the interpretation (the assignment) of a non-constant f in the model.

Parameters
f A function declaration of non-zero arity
Returns
A FunctionInterpretation if the function has an interpretation in the model, null otherwise.

Definition at line 64 of file NativeModel.cs.

68  if

(Native.Z3_get_arity(ntvContext.nCtx, f) == 0)

70

IntPtr n = Native.Z3_model_get_const_interp(ntvContext.nCtx, NativeObject, f);

78  if

(Native.Z3_is_as_array(ntvContext.nCtx, n) == 0)

79  throw new

Z3Exception(

"Argument was not an array constant"

);

80

var fd = Native.Z3_get_as_array_func_decl(ntvContext.nCtx, n);

81  return new

NativeFuncInterp(ntvContext,

this

, f, fd);

86  throw new

Z3Exception(

"Constant functions do not have a function interpretation; use ConstInterp"

);

91

IntPtr n = Native.Z3_model_get_func_interp(ntvContext.nCtx, NativeObject, f);

95  return new

NativeFuncInterp(ntvContext,

this

, f, n);

Z3_sort_kind

The different kinds of Z3 types (See Z3_get_sort_kind).

◆ ToString() override string ToString ( ) inline

Conversion of models to strings.

Returns
A string representation of the model.

Definition at line 339 of file NativeModel.cs.

341  return

Native.Z3_model_to_string(ntvContext.nCtx, NativeObject);

◆ TryGetArrayValue()

Convert the interpretation of t into a sequence of array updates

Parameters
Returns
null if the argument does evaluate to a sequence of stores to an array

Definition at line 272 of file NativeModel.cs.

274

var r =

Eval

(t,

true

);

276

var updates =

new

Dictionary<Z3_ast, Z3_ast>();

286

result =

new

ArrayValue();

287

result.Else = ntvContext.GetAppArg(r, 0);

288

result.Updates = updates.ToArray();

289

result.Domain = updates.Keys.ToArray();

290

result.Range = updates.Values.ToArray();

295

Debug.Assert(ntvContext.

GetNumArgs

(r) == 3);

296

updates[ntvContext.GetAppArg(r, 1)] = ntvContext.GetAppArg(r, 2);

297

r = ntvContext.GetAppArg(r, 0);

Z3_ast_kind GetAstKind(Z3_ast ast)

Get the AST kind from IntPtr

uint GetNumArgs(Z3_app app)

Return number of arguments for app

Z3_decl_kind GetDeclKind(Z3_func_decl decl)

Get the Decl kind from IntPtr

Z3_func_decl GetAppDecl(Z3_ast ast)

Get App Decl from IntPtr

Z3_ast_kind

The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types.

Z3_decl_kind

The different kinds of interpreted function kinds.

System.IntPtr Z3_func_decl

◆ ConstDecls

The function declarations of the constants in the model.

Definition at line 113 of file NativeModel.cs.

120  for

(uint i = 0; i < n; i++)

121

res[i] = Native.Z3_model_get_const_decl(ntvContext.nCtx, NativeObject, i);

uint NumConsts

The number of constants that have an interpretation in the model.

◆ Consts

Enumerate constants in model.

Definition at line 130 of file NativeModel.cs.

135  for

(uint i = 0; i < nc; ++i)

137

var f = Native.Z3_model_get_const_decl(ntvContext.nCtx, NativeObject, i);

138

IntPtr n = Native.Z3_model_get_const_interp(ntvContext.nCtx, NativeObject, f);

139  if

(n == IntPtr.Zero)

continue

;

140

yield

return new

KeyValuePair<Z3_func_decl, Z3_ast>(f, n);

◆ Decls

All symbols that have an interpretation in the model.

Definition at line 172 of file NativeModel.cs.

179

uint n = nFuncs + nConsts;

181  for

(uint i = 0; i < nConsts; i++)

182

res[i] = Native.Z3_model_get_const_decl(ntvContext.nCtx, NativeObject, i);

183  for

(uint i = 0; i < nFuncs; i++)

184

res[nConsts + i] = Native.Z3_model_get_func_decl(ntvContext.nCtx, NativeObject, i);

uint NumFuncs

The number of function interpretations in the model.

◆ FuncDecls

The function declarations of the function interpretations in the model.

Definition at line 156 of file NativeModel.cs.

163  for

(uint i = 0; i < n; i++)

164

res[i] = Native.Z3_model_get_func_decl(ntvContext.nCtx, NativeObject, i);

◆ NumConsts

The number of constants that have an interpretation in the model.

Definition at line 104 of file NativeModel.cs.

106  get

{

return

Native.Z3_model_get_num_consts(ntvContext.nCtx, NativeObject); }

◆ NumFuncs

The number of function interpretations in the model.

Definition at line 148 of file NativeModel.cs.

150  get

{

return

Native.Z3_model_get_num_funcs(ntvContext.nCtx, NativeObject); }

◆ NumSorts

The number of uninterpreted sorts that the model has an interpretation for.

Definition at line 309 of file NativeModel.cs.

309

{

get

{

return

Native.Z3_model_get_num_sorts(ntvContext.nCtx, NativeObject); } }

◆ Sorts

The 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.

See also
NumSorts

Definition at line 321 of file NativeModel.cs.

328  for

(uint i = 0; i < n; i++)

329

res[i] = Native.Z3_model_get_sort(ntvContext.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