Z3
Data Structures | Public Member Functions | Properties
FuncInterp Class Reference

A function interpretation is represented as a finite map and an 'else' value. Each entry in the finite map represents the value of a function given a set of arguments.
More...

+ Inheritance diagram for FuncInterp:

Data Structures

class  Entry
 An Entry object represents an element in the finite map used to encode a function interpretation. More...
 

Public Member Functions

override string ToString ()
 A string representation of the function interpretation. More...
 
- Public Member Functions inherited from Z3Object
void Dispose ()
 Disposes of the underlying native Z3 object. More...
 

Properties

uint NumEntries [get]
 The number of entries in the function interpretation. More...
 
Entry[] Entries [get]
 The entries in the function interpretation More...
 
Expr Else [get]
 The (symbolic) ‘else’ value of the function interpretation. More...
 
uint Arity [get]
 The arity of the function interpretation More...
 
- Properties inherited from Z3Object
Context Context [get]
 Access Context object More...
 

Detailed Description

A function interpretation is represented as a finite map and an 'else' value. Each entry in the finite map represents the value of a function given a set of arguments.

Definition at line 29 of file FuncInterp.cs.

Member Function Documentation

◆ ToString()

override string ToString ( )
inline

A string representation of the function interpretation.


Definition at line 151 of file FuncInterp.cs.

152  {
153  string res = "";
154  res += "[";
155  foreach (Entry e in Entries)
156  {
157  uint n = e.NumArgs;
158  if (n > 1) res += "[";
159  Expr[] args = e.Args;
160  for (uint i = 0; i < n; i++)
161  {
162  if (i != 0) res += ", ";
163  res += args[i];
164  }
165  if (n > 1) res += "]";
166  res += " -> " + e.Value + ", ";
167  }
168  res += "else -> " + Else;
169  res += "]";
170  return res;
171  }
Entry[] Entries
The entries in the function interpretation
Definition: FuncInterp.cs:116
Expr Else
The (symbolic) ‘else’ value of the function interpretation.
Definition: FuncInterp.cs:132

Property Documentation

◆ Arity

uint Arity
get

The arity of the function interpretation

Definition at line 143 of file FuncInterp.cs.

144  {
145  get { return Native.Z3_func_interp_get_arity(Context.nCtx, NativeObject); }
146  }
Context Context
Access Context object
Definition: Z3Object.cs:111

◆ Else

Expr Else
get

The (symbolic) ‘else’ value of the function interpretation.

Definition at line 131 of file FuncInterp.cs.

132  {
133  get
134  {
135 
136  return Expr.Create(Context, Native.Z3_func_interp_get_else(Context.nCtx, NativeObject));
137  }
138  }

Referenced by FuncInterp.ToString().

◆ Entries

Entry [] Entries
get

The entries in the function interpretation

Definition at line 115 of file FuncInterp.cs.

116  {
117  get
118  {
119 
120  uint n = NumEntries;
121  Entry[] res = new Entry[n];
122  for (uint i = 0; i < n; i++)
123  res[i] = new Entry(Context, Native.Z3_func_interp_get_entry(Context.nCtx, NativeObject, i));
124  return res;
125  }
126  }
uint NumEntries
The number of entries in the function interpretation.
Definition: FuncInterp.cs:108

Referenced by FuncInterp.ToString().

◆ NumEntries

uint NumEntries
get

The number of entries in the function interpretation.

Definition at line 107 of file FuncInterp.cs.

108  {
109  get { return Native.Z3_func_interp_get_num_entries(Context.nCtx, NativeObject); }
110  }