Z3
Data Structures | Public Member Functions
FuncInterp< R extends Sort > Class Template Reference
+ Inheritance diagram for FuncInterp< R extends Sort >:

Data Structures

class  Entry
 

Public Member Functions

int getNumEntries ()
 
Entry< R >[] getEntries ()
 
Expr< R > getElse ()
 
int getArity ()
 
String toString ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Z3Object
static long[] arrayToNative (Z3Object[] a)
 
static int arrayLength (Z3Object[] a)
 

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 28 of file FuncInterp.java.

Member Function Documentation

◆ getArity()

int getArity ( )
inline

The arity of the function interpretation

Exceptions
Z3Exceptionon error
Returns
an int

Definition at line 158 of file FuncInterp.java.

159  {
160  return Native.funcInterpGetArity(getContext().nCtx(), getNativeObject());
161  }

◆ getElse()

Expr<R> getElse ( )
inline

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

Exceptions
Z3Exception
Z3Exceptionon error
Returns
an Expr

Definition at line 147 of file FuncInterp.java.

148  {
149  return (Expr<R>) Expr.create(getContext(),
150  Native.funcInterpGetElse(getContext().nCtx(), getNativeObject()));
151  }

◆ getEntries()

Entry<R> [] getEntries ( )
inline

The entries in the function interpretation

Exceptions
Z3Exception
Z3Exceptionon error

Definition at line 130 of file FuncInterp.java.

131  {
132  int n = getNumEntries();
133  Entry<R>[] res = new Entry[n];
134  for (int i = 0; i < n; i++)
135  res[i] = new Entry<>(getContext(), Native.funcInterpGetEntry(getContext()
136  .nCtx(), getNativeObject(), i));
137  return res;
138  }

◆ getNumEntries()

int getNumEntries ( )
inline

The number of entries in the function interpretation.

Exceptions
Z3Exceptionon error
Returns
an int

Definition at line 119 of file FuncInterp.java.

120  {
121  return Native.funcInterpGetNumEntries(getContext().nCtx(), getNativeObject());
122  }

◆ toString()

String toString ( )
inline

A string representation of the function interpretation.

Definition at line 166 of file FuncInterp.java.

167  {
168  String res = "";
169  res += "[";
170  for (Entry<R> e : getEntries())
171  {
172  int n = e.getNumArgs();
173  if (n > 1)
174  res += "[";
175  Expr<?>[] args = e.getArgs();
176  for (int i = 0; i < n; i++)
177  {
178  if (i != 0)
179  res += ", ";
180  res += args[i];
181  }
182  if (n > 1)
183  res += "]";
184  res += " -> " + e.getValue() + ", ";
185  }
186  res += "else -> " + getElse();
187  res += "]";
188  return res;
189  }
def String(name, ctx=None)
Definition: z3py.py:11061