Z3
Public Member Functions | Protected Member Functions
Expr< R extends Sort > Class Template Reference
+ Inheritance diagram for Expr< R extends Sort >:

Public Member Functions

Expr< R > simplify ()
 
Expr< R > simplify (Params p)
 
FuncDecl< R > getFuncDecl ()
 
Z3_lbool getBoolValue ()
 
int getNumArgs ()
 
Expr<?>[] getArgs ()
 
Expr< R > update (Expr<?>[] args)
 
Expr< R > substitute (Expr<?>[] from, Expr<?>[] to)
 
Expr< R > substitute (Expr<?> from, Expr<?> to)
 
Expr< R > substituteVars (Expr<?>[] to)
 
Expr< R > translate (Context ctx)
 
String toString ()
 
boolean isNumeral ()
 
boolean isWellSorted ()
 
getSort ()
 
boolean isConst ()
 
boolean isIntNum ()
 
boolean isRatNum ()
 
boolean isAlgebraicNumber ()
 
boolean isBool ()
 
boolean isTrue ()
 
boolean isFalse ()
 
boolean isEq ()
 
boolean isDistinct ()
 
boolean isITE ()
 
boolean isAnd ()
 
boolean isOr ()
 
boolean isIff ()
 
boolean isXor ()
 
boolean isNot ()
 
boolean isImplies ()
 
boolean isInt ()
 
boolean isReal ()
 
boolean isArithmeticNumeral ()
 
boolean isLE ()
 
boolean isGE ()
 
boolean isLT ()
 
boolean isGT ()
 
boolean isAdd ()
 
boolean isSub ()
 
boolean isUMinus ()
 
boolean isMul ()
 
boolean isDiv ()
 
boolean isIDiv ()
 
boolean isRemainder ()
 
boolean isModulus ()
 
boolean isIntToReal ()
 
boolean isRealToInt ()
 
boolean isRealIsInt ()
 
boolean isArray ()
 
boolean isStore ()
 
boolean isSelect ()
 
boolean isConstantArray ()
 
boolean isDefaultArray ()
 
boolean isArrayMap ()
 
boolean isAsArray ()
 
boolean isSetUnion ()
 
boolean isSetIntersect ()
 
boolean isSetDifference ()
 
boolean isSetComplement ()
 
boolean isSetSubset ()
 
boolean isBV ()
 
boolean isBVNumeral ()
 
boolean isBVBitOne ()
 
boolean isBVBitZero ()
 
boolean isBVUMinus ()
 
boolean isBVAdd ()
 
boolean isBVSub ()
 
boolean isBVMul ()
 
boolean isBVSDiv ()
 
boolean isBVUDiv ()
 
boolean isBVSRem ()
 
boolean isBVURem ()
 
boolean isBVSMod ()
 
boolean isBVULE ()
 
boolean isBVSLE ()
 
boolean isBVUGE ()
 
boolean isBVSGE ()
 
boolean isBVULT ()
 
boolean isBVSLT ()
 
boolean isBVUGT ()
 
boolean isBVSGT ()
 
boolean isBVAND ()
 
boolean isBVOR ()
 
boolean isBVNOT ()
 
boolean isBVXOR ()
 
boolean isBVNAND ()
 
boolean isBVNOR ()
 
boolean isBVXNOR ()
 
boolean isBVConcat ()
 
boolean isBVSignExtension ()
 
boolean isBVZeroExtension ()
 
boolean isBVExtract ()
 
boolean isBVRepeat ()
 
boolean isBVReduceOR ()
 
boolean isBVReduceAND ()
 
boolean isBVComp ()
 
boolean isBVShiftLeft ()
 
boolean isBVShiftRightLogical ()
 
boolean isBVShiftRightArithmetic ()
 
boolean isBVRotateLeft ()
 
boolean isBVRotateRight ()
 
boolean isBVRotateLeftExtended ()
 
boolean isBVRotateRightExtended ()
 
boolean isIntToBV ()
 
boolean isBVToInt ()
 
boolean isBVCarry ()
 
boolean isBVXOR3 ()
 
boolean isLabel ()
 
boolean isLabelLit ()
 
boolean isString ()
 
String getString ()
 
boolean isConcat ()
 
boolean isOEQ ()
 
boolean isProofTrue ()
 
boolean isProofAsserted ()
 
boolean isProofGoal ()
 
boolean isProofModusPonens ()
 
boolean isProofReflexivity ()
 
boolean isProofSymmetry ()
 
boolean isProofTransitivity ()
 
boolean isProofTransitivityStar ()
 
boolean isProofMonotonicity ()
 
boolean isProofQuantIntro ()
 
boolean isProofDistributivity ()
 
boolean isProofAndElimination ()
 
boolean isProofOrElimination ()
 
boolean isProofRewrite ()
 
boolean isProofRewriteStar ()
 
boolean isProofPullQuant ()
 
boolean isProofPushQuant ()
 
boolean isProofElimUnusedVars ()
 
boolean isProofDER ()
 
boolean isProofQuantInst ()
 
boolean isProofHypothesis ()
 
boolean isProofLemma ()
 
boolean isProofUnitResolution ()
 
boolean isProofIFFTrue ()
 
boolean isProofIFFFalse ()
 
boolean isProofCommutativity ()
 
boolean isProofDefAxiom ()
 
boolean isProofDefIntro ()
 
boolean isProofApplyDef ()
 
boolean isProofIFFOEQ ()
 
boolean isProofNNFPos ()
 
boolean isProofNNFNeg ()
 
boolean isProofSkolemize ()
 
boolean isProofModusPonensOEQ ()
 
boolean isProofTheoryLemma ()
 
boolean isRelation ()
 
boolean isRelationStore ()
 
boolean isEmptyRelation ()
 
boolean isIsEmptyRelation ()
 
boolean isRelationalJoin ()
 
boolean isRelationUnion ()
 
boolean isRelationWiden ()
 
boolean isRelationProject ()
 
boolean isRelationFilter ()
 
boolean isRelationNegationFilter ()
 
boolean isRelationRename ()
 
boolean isRelationComplement ()
 
boolean isRelationSelect ()
 
boolean isRelationClone ()
 
boolean isFiniteDomain ()
 
boolean isFiniteDomainLT ()
 
int getIndex ()
 
- Public Member Functions inherited from AST
boolean equals (Object o)
 
int compareTo (AST other)
 
int hashCode ()
 
int getId ()
 
Z3_ast_kind getASTKind ()
 
boolean isExpr ()
 
boolean isApp ()
 
boolean isVar ()
 
boolean isQuantifier ()
 
boolean isSort ()
 
boolean isFuncDecl ()
 
String getSExpr ()
 

Protected Member Functions

 Expr (Context ctx, long obj)
 

Additional Inherited Members

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

Detailed Description

Expressions are terms.

Definition at line 31 of file Expr.java.

Constructor & Destructor Documentation

◆ Expr()

Expr ( Context  ctx,
long  obj 
)
inlineprotected

Constructor for Expr

Exceptions
Z3Exceptionon error

Definition at line 2097 of file Expr.java.

2097  {
2098  super(ctx, obj);
2099  }

Member Function Documentation

◆ getArgs()

Expr<?> [] getArgs ( )
inline

The arguments of the expression.

Exceptions
Z3Exceptionon error
Returns
an Expr[]

Definition at line 106 of file Expr.java.

107  {
108  int n = getNumArgs();
109  Expr<?>[] res = new Expr[n];
110  for (int i = 0; i < n; i++) {
111  res[i] = Expr.create(getContext(),
112  Native.getAppArg(getContext().nCtx(), getNativeObject(), i));
113  }
114  return res;
115  }

Referenced by FuncInterp< R extends Sort >.toString().

◆ getBoolValue()

Z3_lbool getBoolValue ( )
inline

Indicates whether the expression is the true or false expression or something else (Z3_L_UNDEF).

Exceptions
Z3Exceptionon error
Returns
a Z3_lbool

Definition at line 85 of file Expr.java.

86  {
87  return Z3_lbool.fromInt(Native.getBoolValue(getContext().nCtx(),
88  getNativeObject()));
89  }

◆ getFuncDecl()

FuncDecl<R> getFuncDecl ( )
inline

The function declaration of the function that is applied in this expression.

Returns
a FuncDecl
Exceptions
Z3Exceptionon error

Definition at line 73 of file Expr.java.

74  {
75  return new FuncDecl<>(getContext(), Native.getAppDecl(getContext().nCtx(),
76  getNativeObject()));
77  }

◆ getIndex()

int getIndex ( )
inline

The de-Bruijn index of a bound variable. Remarks: Bound variables are indexed by de-Bruijn indices. It is perhaps easiest to explain the meaning of de-Bruijn indices by indicating the compilation process from non-de-Bruijn formulas to de-Bruijn format.

abs(forall (x1) phi) = forall (x1) abs1(phi, x1, 0)
abs(forall (x1, x2) phi) = abs(forall (x1) abs(forall (x2) phi))
abs1(x, x, n) = b_n
abs1(y, x, n) = y
abs1(f(t1,...,tn), x, n) = f(abs1(t1,x,n), ..., abs1(tn,x,n))
abs1(forall (x1) phi, x, n) = forall (x1) (abs1(phi, x, n+1))

The last line is significant: the index of a bound variable is different depending on the scope in which it appears. The deeper x appears, the higher is its index.

Exceptions
Z3Exceptionon error
Returns
an int

Definition at line 2084 of file Expr.java.

2085  {
2086  if (!isVar()) {
2087  throw new Z3Exception("Term is not a bound variable.");
2088  }
2089 
2090  return Native.getIndexValue(getContext().nCtx(), getNativeObject());
2091  }

◆ getNumArgs()

int getNumArgs ( )
inline

The number of arguments of the expression.

Exceptions
Z3Exceptionon error
Returns
an int

Definition at line 96 of file Expr.java.

97  {
98  return Native.getAppNumArgs(getContext().nCtx(), getNativeObject());
99  }

◆ getSort()

R getSort ( )
inline

The Sort of the term.

Exceptions
Z3Exceptionon error
Returns
a sort

Definition at line 236 of file Expr.java.

237  {
238  return (R) Sort.create(getContext(),
239  Native.getSort(getContext().nCtx(), getNativeObject()));
240  }

◆ getString()

String getString ( )
inline

Retrieve string corresponding to string constant. Remark: the expression should be a string constant, (isString() should return true).

Exceptions
Z3Exceptionon error
Returns
a string

Definition at line 1289 of file Expr.java.

1290  {
1291  return Native.getString(getContext().nCtx(), getNativeObject());
1292  }

◆ isAdd()

boolean isAdd ( )
inline

Indicates whether the term is addition (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 481 of file Expr.java.

482  {
483  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ADD;
484  }

◆ isAlgebraicNumber()

boolean isAlgebraicNumber ( )
inline

Indicates whether the term is an algebraic number

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 277 of file Expr.java.

278  {
279  return Native.isAlgebraicNumber(getContext().nCtx(), getNativeObject());
280  }

◆ isAnd()

boolean isAnd ( )
inline

Indicates whether the term is an n-ary conjunction

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 350 of file Expr.java.

351  {
352  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_AND;
353  }

◆ isArithmeticNumeral()

boolean isArithmeticNumeral ( )
inline

Indicates whether the term is an arithmetic numeral.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 431 of file Expr.java.

432  {
433  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ANUM;
434  }

◆ isArray()

boolean isArray ( )
inline

Indicates whether the term is of an array sort.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 592 of file Expr.java.

593  {
594  return (Native.isApp(getContext().nCtx(), getNativeObject()) && Z3_sort_kind
595  .fromInt(Native.getSortKind(getContext().nCtx(),
596  Native.getSort(getContext().nCtx(), getNativeObject()))) == Z3_sort_kind.Z3_ARRAY_SORT);
597  }

◆ isArrayMap()

boolean isArrayMap ( )
inline

Indicates whether the term is an array map. Remarks: It satisfies mapf[i] = f(a1[i],...,a_n[i]) for every i.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 649 of file Expr.java.

650  {
651  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ARRAY_MAP;
652  }

◆ isAsArray()

boolean isAsArray ( )
inline

Indicates whether the term is an as-array term. Remarks: An as-array term * is n array value that behaves as the function graph of the function * passed as parameter.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 660 of file Expr.java.

661  {
662  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_AS_ARRAY;
663  }

◆ isBool()

boolean isBool ( )
inline

Indicates whether the term has Boolean sort.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 287 of file Expr.java.

288  {
289  return (isExpr() && Native.isEqSort(getContext().nCtx(),
290  Native.mkBoolSort(getContext().nCtx()),
291  Native.getSort(getContext().nCtx(), getNativeObject())));
292  }

◆ isBV()

boolean isBV ( )
inline

Indicates whether the terms is of bit-vector sort.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 720 of file Expr.java.

721  {
722  return Native.getSortKind(getContext().nCtx(),
723  Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_BV_SORT
724  .toInt();
725  }

◆ isBVAdd()

boolean isBVAdd ( )
inline

Indicates whether the term is a bit-vector addition (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 772 of file Expr.java.

773  {
774  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BADD;
775  }

◆ isBVAND()

boolean isBVAND ( )
inline

Indicates whether the term is a bit-wise AND

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 983 of file Expr.java.

984  {
985  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BAND;
986  }

◆ isBVBitOne()

boolean isBVBitOne ( )
inline

Indicates whether the term is a one-bit bit-vector with value one

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 742 of file Expr.java.

743  {
744  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BIT1;
745  }

◆ isBVBitZero()

boolean isBVBitZero ( )
inline

Indicates whether the term is a one-bit bit-vector with value zero

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 752 of file Expr.java.

753  {
754  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BIT0;
755  }

◆ isBVCarry()

boolean isBVCarry ( )
inline

Indicates whether the term is a bit-vector carry Remarks: Compute the * carry bit in a full-adder. The meaning is given by the equivalence (carry * l1 l2 l3) <=> (or (and l1 l2) (and l1 l3) (and l2 l3)))

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1232 of file Expr.java.

1233  {
1234  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_CARRY;
1235  }

◆ isBVComp()

boolean isBVComp ( )
inline

Indicates whether the term is a bit-vector comparison

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1123 of file Expr.java.

1124  {
1125  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BCOMP;
1126  }

◆ isBVConcat()

boolean isBVConcat ( )
inline

Indicates whether the term is a bit-vector concatenation (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1053 of file Expr.java.

1054  {
1055  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_CONCAT;
1056  }

◆ isBVExtract()

boolean isBVExtract ( )
inline

Indicates whether the term is a bit-vector extraction

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1083 of file Expr.java.

1084  {
1085  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_EXTRACT;
1086  }

◆ isBVMul()

boolean isBVMul ( )
inline

Indicates whether the term is a bit-vector multiplication (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 792 of file Expr.java.

793  {
794  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BMUL;
795  }

◆ isBVNAND()

boolean isBVNAND ( )
inline

Indicates whether the term is a bit-wise NAND

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1023 of file Expr.java.

1024  {
1025  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNAND;
1026  }

◆ isBVNOR()

boolean isBVNOR ( )
inline

Indicates whether the term is a bit-wise NOR

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1033 of file Expr.java.

1034  {
1035  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNOR;
1036  }

◆ isBVNOT()

boolean isBVNOT ( )
inline

Indicates whether the term is a bit-wise NOT

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1003 of file Expr.java.

1004  {
1005  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNOT;
1006  }

◆ isBVNumeral()

boolean isBVNumeral ( )
inline

Indicates whether the term is a bit-vector numeral

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 732 of file Expr.java.

733  {
734  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNUM;
735  }

◆ isBVOR()

boolean isBVOR ( )
inline

Indicates whether the term is a bit-wise OR

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 993 of file Expr.java.

994  {
995  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BOR;
996  }

◆ isBVReduceAND()

boolean isBVReduceAND ( )
inline

Indicates whether the term is a bit-vector reduce AND

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1113 of file Expr.java.

1114  {
1115  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BREDAND;
1116  }

◆ isBVReduceOR()

boolean isBVReduceOR ( )
inline

Indicates whether the term is a bit-vector reduce OR

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1103 of file Expr.java.

1104  {
1105  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BREDOR;
1106  }

◆ isBVRepeat()

boolean isBVRepeat ( )
inline

Indicates whether the term is a bit-vector repetition

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1093 of file Expr.java.

1094  {
1095  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_REPEAT;
1096  }

◆ isBVRotateLeft()

boolean isBVRotateLeft ( )
inline

Indicates whether the term is a bit-vector rotate left

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1163 of file Expr.java.

1164  {
1165  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ROTATE_LEFT;
1166  }

◆ isBVRotateLeftExtended()

boolean isBVRotateLeftExtended ( )
inline

Indicates whether the term is a bit-vector rotate left (extended) Remarks: Similar to Z3_OP_ROTATE_LEFT, but it is a binary operator instead of a parametric one.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1185 of file Expr.java.

1186  {
1187  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_EXT_ROTATE_LEFT;
1188  }

◆ isBVRotateRight()

boolean isBVRotateRight ( )
inline

Indicates whether the term is a bit-vector rotate right

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1173 of file Expr.java.

1174  {
1175  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ROTATE_RIGHT;
1176  }

◆ isBVRotateRightExtended()

boolean isBVRotateRightExtended ( )
inline

Indicates whether the term is a bit-vector rotate right (extended) Remarks: Similar to Z3_OP_ROTATE_RIGHT, but it is a binary operator instead of a parametric one.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1197 of file Expr.java.

1198  {
1199  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_EXT_ROTATE_RIGHT;
1200  }

◆ isBVSDiv()

boolean isBVSDiv ( )
inline

Indicates whether the term is a bit-vector signed division (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 802 of file Expr.java.

803  {
804  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSDIV;
805  }

◆ isBVSGE()

boolean isBVSGE ( )
inline

Indicates whether the term is a signed bit-vector greater-than-or-equal

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 933 of file Expr.java.

934  {
935  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SGEQ;
936  }

◆ isBVSGT()

boolean isBVSGT ( )
inline

Indicates whether the term is a signed bit-vector greater-than

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 973 of file Expr.java.

974  {
975  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SGT;
976  }

◆ isBVShiftLeft()

boolean isBVShiftLeft ( )
inline

Indicates whether the term is a bit-vector shift left

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1133 of file Expr.java.

1134  {
1135  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSHL;
1136  }

◆ isBVShiftRightArithmetic()

boolean isBVShiftRightArithmetic ( )
inline

Indicates whether the term is a bit-vector arithmetic shift left

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1153 of file Expr.java.

1154  {
1155  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BASHR;
1156  }

◆ isBVShiftRightLogical()

boolean isBVShiftRightLogical ( )
inline

Indicates whether the term is a bit-vector logical shift right

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1143 of file Expr.java.

1144  {
1145  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BLSHR;
1146  }

◆ isBVSignExtension()

boolean isBVSignExtension ( )
inline

Indicates whether the term is a bit-vector sign extension

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1063 of file Expr.java.

1064  {
1065  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SIGN_EXT;
1066  }

◆ isBVSLE()

boolean isBVSLE ( )
inline

Indicates whether the term is a signed bit-vector less-than-or-equal

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 912 of file Expr.java.

913  {
914  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SLEQ;
915  }

◆ isBVSLT()

boolean isBVSLT ( )
inline

Indicates whether the term is a signed bit-vector less-than

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 953 of file Expr.java.

954  {
955  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SLT;
956  }

◆ isBVSMod()

boolean isBVSMod ( )
inline

Indicates whether the term is a bit-vector signed modulus

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 842 of file Expr.java.

843  {
844  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSMOD;
845  }

◆ isBVSRem()

boolean isBVSRem ( )
inline

Indicates whether the term is a bit-vector signed remainder (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 822 of file Expr.java.

823  {
824  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSREM;
825  }

◆ isBVSub()

boolean isBVSub ( )
inline

Indicates whether the term is a bit-vector subtraction (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 782 of file Expr.java.

783  {
784  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSUB;
785  }

◆ isBVToInt()

boolean isBVToInt ( )
inline

Indicates whether the term is a coercion from bit-vector to integer

Remarks: This function is not supported by the decision procedures. Only * the most rudimentary simplification rules are applied to this * function.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1221 of file Expr.java.

1222  {
1223  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BV2INT;
1224  }

◆ isBVUDiv()

boolean isBVUDiv ( )
inline

Indicates whether the term is a bit-vector unsigned division (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 812 of file Expr.java.

813  {
814  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BUDIV;
815  }

◆ isBVUGE()

boolean isBVUGE ( )
inline

Indicates whether the term is an unsigned bit-vector greater-than-or-equal

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 923 of file Expr.java.

924  {
925  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_UGEQ;
926  }

◆ isBVUGT()

boolean isBVUGT ( )
inline

Indicates whether the term is an unsigned bit-vector greater-than

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 963 of file Expr.java.

964  {
965  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_UGT;
966  }

◆ isBVULE()

boolean isBVULE ( )
inline

Indicates whether the term is an unsigned bit-vector less-than-or-equal

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 902 of file Expr.java.

903  {
904  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ULEQ;
905  }

◆ isBVULT()

boolean isBVULT ( )
inline

Indicates whether the term is an unsigned bit-vector less-than

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 943 of file Expr.java.

944  {
945  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ULT;
946  }

◆ isBVUMinus()

boolean isBVUMinus ( )
inline

Indicates whether the term is a bit-vector unary minus

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 762 of file Expr.java.

763  {
764  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNEG;
765  }

◆ isBVURem()

boolean isBVURem ( )
inline

Indicates whether the term is a bit-vector unsigned remainder (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 832 of file Expr.java.

833  {
834  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BUREM;
835  }

◆ isBVXNOR()

boolean isBVXNOR ( )
inline

Indicates whether the term is a bit-wise XNOR

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1043 of file Expr.java.

1044  {
1045  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BXNOR;
1046  }

◆ isBVXOR()

boolean isBVXOR ( )
inline

Indicates whether the term is a bit-wise XOR

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1013 of file Expr.java.

1014  {
1015  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BXOR;
1016  }

◆ isBVXOR3()

boolean isBVXOR3 ( )
inline

Indicates whether the term is a bit-vector ternary XOR Remarks: The * meaning is given by the equivalence (xor3 l1 l2 l3) <=> (xor (xor * l1 l2) l3)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1243 of file Expr.java.

1244  {
1245  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_XOR3;
1246  }

◆ isBVZeroExtension()

boolean isBVZeroExtension ( )
inline

Indicates whether the term is a bit-vector zero extension

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1073 of file Expr.java.

1074  {
1075  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ZERO_EXT;
1076  }

◆ isConcat()

boolean isConcat ( )
inline

TBD: sketch for #2522, 'Pointer' seems deprecated and instead approach seems to be around Set/Get CharArrayRegion and updating Native.cpp code generation to produce the char[].

public char[] getNativeString() { Native.IntPtr len = new Native.IntPtr(); long s = Native.getLstring(getContext().nCtx(), getNativeObject(), len); char[] result = new char[len.value]; Pointer ptr = Pointer.createConstant(s); for (int i = 0; i < len.value; ++i) result[i] = ptr.getChar(i); return result; } Check whether expression is a concatenation

Returns
a boolean

Definition at line 1314 of file Expr.java.

1315  {
1316  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SEQ_CONCAT;
1317  }

◆ isConst()

boolean isConst ( )
inline

Indicates whether the term represents a constant.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 247 of file Expr.java.

248  {
249  return isApp() && getNumArgs() == 0 && getFuncDecl().getDomainSize() == 0;
250  }

◆ isConstantArray()

boolean isConstantArray ( )
inline

Indicates whether the term is a constant array. Remarks: For example, * select(const(v),i) = v holds for every v and i. The function is * unary.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 626 of file Expr.java.

627  {
628  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_CONST_ARRAY;
629  }

◆ isDefaultArray()

boolean isDefaultArray ( )
inline

Indicates whether the term is a default array. Remarks: For example default(const(v)) = v. The function is unary.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 637 of file Expr.java.

638  {
639  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ARRAY_DEFAULT;
640  }

◆ isDistinct()

boolean isDistinct ( )
inline

Indicates whether the term is an n-ary distinct predicate (every argument is mutually distinct).

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 330 of file Expr.java.

331  {
332  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_DISTINCT;
333  }

◆ isDiv()

boolean isDiv ( )
inline

Indicates whether the term is division (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 521 of file Expr.java.

522  {
523  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_DIV;
524  }

◆ isEmptyRelation()

boolean isEmptyRelation ( )
inline

Indicates whether the term is an empty relation

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1894 of file Expr.java.

1895  {
1896  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_EMPTY;
1897  }

◆ isEq()

boolean isEq ( )
inline

Indicates whether the term is an equality predicate.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 319 of file Expr.java.

320  {
321  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_EQ;
322  }

◆ isFalse()

boolean isFalse ( )
inline

Indicates whether the term is the constant false.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 309 of file Expr.java.

310  {
311  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FALSE;
312  }

◆ isFiniteDomain()

boolean isFiniteDomain ( )
inline

Indicates whether the term is of an array sort.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 2048 of file Expr.java.

2049  {
2050  return (Native.isApp(getContext().nCtx(), getNativeObject()) && Native
2051  .getSortKind(getContext().nCtx(),
2052  Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_FINITE_DOMAIN_SORT
2053  .toInt());
2054  }

◆ isFiniteDomainLT()

boolean isFiniteDomainLT ( )
inline

Indicates whether the term is a less than predicate over a finite domain.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 2061 of file Expr.java.

2062  {
2063  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FD_LT;
2064  }

◆ isGE()

boolean isGE ( )
inline

Indicates whether the term is a greater-than-or-equal

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 451 of file Expr.java.

452  {
453  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_GE;
454  }

◆ isGT()

boolean isGT ( )
inline

Indicates whether the term is a greater-than

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 471 of file Expr.java.

472  {
473  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_GT;
474  }

◆ isIDiv()

boolean isIDiv ( )
inline

Indicates whether the term is integer division (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 531 of file Expr.java.

532  {
533  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_IDIV;
534  }

◆ isIff()

boolean isIff ( )
inline

Indicates whether the term is an if-and-only-if (Boolean equivalence, binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 371 of file Expr.java.

372  {
373  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_IFF;
374  }

◆ isImplies()

boolean isImplies ( )
inline

Indicates whether the term is an implication

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 401 of file Expr.java.

402  {
403  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_IMPLIES;
404  }

◆ isInt()

boolean isInt ( )
inline

Indicates whether the term is of integer sort.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 411 of file Expr.java.

412  {
413  return Native.getSortKind(getContext().nCtx(), Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_INT_SORT.toInt();
414  }

◆ isIntNum()

boolean isIntNum ( )
inline

Indicates whether the term is an integer numeral.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 257 of file Expr.java.

258  {
259  return isNumeral() && isInt();
260  }

◆ isIntToBV()

boolean isIntToBV ( )
inline

Indicates whether the term is a coercion from integer to bit-vector

Remarks: This function is not supported by the decision procedures. Only * the most rudimentary simplification rules are applied to this * function.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1209 of file Expr.java.

1210  {
1211  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_INT2BV;
1212  }

◆ isIntToReal()

boolean isIntToReal ( )
inline

Indicates whether the term is a coercion of integer to real (unary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 561 of file Expr.java.

562  {
563  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_TO_REAL;
564  }

◆ isIsEmptyRelation()

boolean isIsEmptyRelation ( )
inline

Indicates whether the term is a test for the emptiness of a relation

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1904 of file Expr.java.

1905  {
1906  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_IS_EMPTY;
1907  }

◆ isITE()

boolean isITE ( )
inline

Indicates whether the term is a ternary if-then-else term

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 340 of file Expr.java.

341  {
342  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ITE;
343  }

◆ isLabel()

boolean isLabel ( )
inline

Indicates whether the term is a label (used by the Boogie Verification condition generator). Remarks: The label has two parameters, a string and a Boolean polarity. It takes one argument, a formula.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1256 of file Expr.java.

1257  {
1258  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_LABEL;
1259  }

◆ isLabelLit()

boolean isLabelLit ( )
inline

Indicates whether the term is a label literal (used by the Boogie Verification condition generator). Remarks: A label literal has a set of string parameters. It takes no arguments.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1269 of file Expr.java.

1270  {
1271  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_LABEL_LIT;
1272  }

◆ isLE()

boolean isLE ( )
inline

Indicates whether the term is a less-than-or-equal

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 441 of file Expr.java.

442  {
443  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_LE;
444  }

◆ isLT()

boolean isLT ( )
inline

Indicates whether the term is a less-than

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 461 of file Expr.java.

462  {
463  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_LT;
464  }

◆ isModulus()

boolean isModulus ( )
inline

Indicates whether the term is modulus (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 551 of file Expr.java.

552  {
553  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_MOD;
554  }

◆ isMul()

boolean isMul ( )
inline

Indicates whether the term is multiplication (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 511 of file Expr.java.

512  {
513  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_MUL;
514  }

◆ isNot()

boolean isNot ( )
inline

Indicates whether the term is a negation

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 391 of file Expr.java.

392  {
393  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_NOT;
394  }

◆ isNumeral()

boolean isNumeral ( )
inline

Indicates whether the term is a numeral

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 215 of file Expr.java.

216  {
217  return Native.isNumeralAst(getContext().nCtx(), getNativeObject());
218  }

◆ isOEQ()

boolean isOEQ ( )
inline

Indicates whether the term is a binary equivalence modulo namings. Remarks: This binary predicate is used in proof terms. It captures equisatisfiability and equivalence modulo renamings.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1326 of file Expr.java.

1327  {
1328  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_OEQ;
1329  }

◆ isOr()

boolean isOr ( )
inline

Indicates whether the term is an n-ary disjunction

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 360 of file Expr.java.

361  {
362  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_OR;
363  }

◆ isProofAndElimination()

boolean isProofAndElimination ( )
inline

Indicates whether the term is a proof by elimination of AND Remarks: * Given a proof for (and l_1 ... l_n), produces a proof for l_i T1: (and * l_1 ... l_n) [and-elim T1]: l_i

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1486 of file Expr.java.

1487  {
1488  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_AND_ELIM;
1489  }

◆ isProofApplyDef()

boolean isProofApplyDef ( )
inline

Indicates whether the term is a proof for application of a definition Remarks: [apply-def T1]: F ~ n F is 'equivalent' to n, given that T1 is a proof that n is a name for F.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1745 of file Expr.java.

1746  {
1747  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_APPLY_DEF;
1748  }

◆ isProofAsserted()

boolean isProofAsserted ( )
inline

Indicates whether the term is a proof for a fact asserted by the user.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1346 of file Expr.java.

1347  {
1348  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_ASSERTED;
1349  }

◆ isProofCommutativity()

boolean isProofCommutativity ( )
inline

Indicates whether the term is a proof by commutativity Remarks: [comm]: (= (f a b) (f b a))

f is a commutative operator.

This proof object has no antecedents. Remark: if f is bool, then = is iff.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1684 of file Expr.java.

1685  {
1686  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_COMMUTATIVITY;
1687  }

◆ isProofDefAxiom()

boolean isProofDefAxiom ( )
inline

Indicates whether the term is a proof for Tseitin-like axioms Remarks: Proof object used to justify Tseitin's like axioms:

(or (not (and p q)) p) (or (not (and p q)) q) (or (not (and p q r)) p) (or (not (and p q r)) q) (or (not (and p q r)) r) ... (or (and p q) (not p) (not q)) (or (not (or p q)) p q) (or (or p q) (not p)) (or (or p q) (not q)) (or (not (iff p q)) (not p) q) (or (not (iff p q)) p (not q)) (or (iff p q) (not p) (not q)) (or (iff p q) p q) (or (not (ite a b c)) (not a) b) (or (not (ite a b c)) a c) (or (ite a b c) (not a) (not b)) (or (ite a b c) a (not c)) (or (not (not a)) (not a)) (or (not a) a)

This proof object has no antecedents. Note: all axioms are propositional tautologies. Note also that 'and' and 'or' can take multiple arguments. You can recover the propositional tautologies by unfolding the Boolean connectives in the axioms a small bounded number of steps (=3).

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1710 of file Expr.java.

1711  {
1712  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_DEF_AXIOM;
1713  }

◆ isProofDefIntro()

boolean isProofDefIntro ( )
inline

Indicates whether the term is a proof for introduction of a name Remarks: Introduces a name for a formula/term. Suppose e is an expression with free variables x, and def-intro introduces the name n(x). The possible cases are:

When e is of Boolean type: [def-intro]: (and (or n (not e)) (or (not n) e))

or: [def-intro]: (or (not n) e) when e only occurs positively.

When e is of the form (ite cond th el): [def-intro]: (and (or (not cond) (= n th)) (or cond (= n el)))

Otherwise: [def-intro]: (= n e)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1733 of file Expr.java.

1734  {
1735  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_DEF_INTRO;
1736  }

◆ isProofDER()

boolean isProofDER ( )
inline

Indicates whether the term is a proof for destructive equality resolution Remarks: A proof for destructive equality resolution: (iff (forall (x) (or (not (= x t)) P[x])) P[t]) if x does not occur in t.

This proof object has no antecedents.

Several variables can be eliminated simultaneously.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1592 of file Expr.java.

1593  {
1594  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_DER;
1595  }

◆ isProofDistributivity()

boolean isProofDistributivity ( )
inline

Indicates whether the term is a distributivity proof object. Remarks: Given that f (= or) distributes over g (= and), produces a proof for (= (f a (g c d)) (g (f a c) (f a d))) If f and g are associative, this proof also justifies the following equality: (= (f (g a b) (g c d)) (g (f a c) (f a d) (f b c) (f b d))) where each f and g can have arbitrary number of arguments.

This proof object has no antecedents. Remark. This rule is used by the CNF conversion pass and instantiated by f = or, and g = and.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1475 of file Expr.java.

1476  {
1477  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_DISTRIBUTIVITY;
1478  }

◆ isProofElimUnusedVars()

boolean isProofElimUnusedVars ( )
inline

Indicates whether the term is a proof for elimination of unused variables. Remarks: A proof for (iff (forall (x_1 ... x_n y_1 ... y_m) p[x_1 ... x_n]) (forall (x_1 ... x_n) p[x_1 ... x_n]))

It is used to justify the elimination of unused variables. This proof object has no antecedents.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1576 of file Expr.java.

1577  {
1578  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_ELIM_UNUSED_VARS;
1579  }

◆ isProofGoal()

boolean isProofGoal ( )
inline

Indicates whether the term is a proof for a fact (tagged as goal) asserted by the user.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1357 of file Expr.java.

1358  {
1359  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_GOAL;
1360  }

◆ isProofHypothesis()

boolean isProofHypothesis ( )
inline

Indicates whether the term is a hypothesis marker. Remarks: Mark a hypothesis in a natural deduction style proof.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1616 of file Expr.java.

1617  {
1618  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_HYPOTHESIS;
1619  }

◆ isProofIFFFalse()

boolean isProofIFFFalse ( )
inline

Indicates whether the term is a proof by iff-false Remarks: T1: (not p) [iff-false T1]: (iff p false)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1667 of file Expr.java.

1668  {
1669  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_IFF_FALSE;
1670  }

◆ isProofIFFOEQ()

boolean isProofIFFOEQ ( )
inline

Indicates whether the term is a proof iff-oeq Remarks: T1: (iff p q) [iff~ T1]: (~ p q)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1757 of file Expr.java.

1758  {
1759  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_IFF_OEQ;
1760  }

◆ isProofIFFTrue()

boolean isProofIFFTrue ( )
inline

Indicates whether the term is a proof by iff-true Remarks: T1: p [iff-true T1]: (iff p true)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1655 of file Expr.java.

1656  {
1657  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_IFF_TRUE;
1658  }

◆ isProofLemma()

boolean isProofLemma ( )
inline

Indicates whether the term is a proof by lemma Remarks: T1: false [lemma T1]: (or (not l_1) ... (not l_n))

This proof object has one antecedent: a hypothetical proof for false. It converts the proof in a proof for (or (not l_1) ... (not l_n)), when T1 contains the hypotheses: l_1, ..., l_n.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1632 of file Expr.java.

1633  {
1634  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_LEMMA;
1635  }

◆ isProofModusPonens()

boolean isProofModusPonens ( )
inline

Indicates whether the term is proof via modus ponens Remarks: Given a proof for p and a proof for (implies p q), produces a proof for q. T1: p T2: (implies p q) [mp T1 T2]: q The second antecedents may also be a proof for (iff p q).

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1371 of file Expr.java.

1372  {
1373  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_MODUS_PONENS;
1374  }

◆ isProofModusPonensOEQ()

boolean isProofModusPonensOEQ ( )
inline

Indicates whether the term is a proof by modus ponens for equi-satisfiability. Remarks: Modus ponens style rule for equi-satisfiability. T1: p T2: (~ p q) [mp~ T1 T2]: q

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1835 of file Expr.java.

1836  {
1837  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_MODUS_PONENS_OEQ;
1838  }

◆ isProofMonotonicity()

boolean isProofMonotonicity ( )
inline

Indicates whether the term is a monotonicity proof object. Remarks: T1: (R t_1 s_1) ... Tn: (R t_n s_n) [monotonicity T1 ... Tn]: (R (f t_1 ... t_n) (f s_1 ... s_n)) Remark: if t_i == s_i, then the antecedent Ti is suppressed. That is, reflexivity proofs are suppressed to save space.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1445 of file Expr.java.

1446  {
1447  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_MONOTONICITY;
1448  }

◆ isProofNNFNeg()

boolean isProofNNFNeg ( )
inline

Indicates whether the term is a proof for a negative NNF step Remarks: Proof for a (negative) NNF step. Examples:

T1: (not s_1) ~ r_1 ... Tn: (not s_n) ~ r_n [nnf-neg T1 ... Tn]: (not (and s_1 ... s_n)) ~ (or r_1 ... r_n) and T1: (not s_1) ~ r_1 ... Tn: (not s_n) ~ r_n [nnf-neg T1 ... Tn]: (not (or s_1 ... s_n)) ~ (and r_1 ... r_n) and T1: (not s_1) ~ r_1 T2: (not s_2) ~ r_2 T3: s_1 ~ r_1' T4: s_2 ~ r_2' [nnf-neg T1 T2 T3 T4]: (~ (not (iff s_1 s_2)) (and (or r_1 r_2) (or r_1' r_2')))

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1804 of file Expr.java.

1805  {
1806  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_NNF_NEG;
1807  }

◆ isProofNNFPos()

boolean isProofNNFPos ( )
inline

Indicates whether the term is a proof for a positive NNF step Remarks: Proof for a (positive) NNF step. Example:

T1: (not s_1) ~ r_1 T2: (not s_2) ~ r_2 T3: s_1 ~ r_1' T4: s_2 ~ r_2'

r_2)))

The negation normal form steps NNF_POS and NNF_NEG are used in the following cases: (a) When creating the NNF of a positive force quantifier. The quantifier is retained (unless the bound variables are eliminated). Example T1: q ~ q_new [nnf-pos T1]: (~ (forall (x R) q) (forall (x R) q_new))

(b) When recursively creating NNF over Boolean formulas, where the top-level connective is changed during NNF conversion. The relevant Boolean connectives for NNF_POS are 'implies', 'iff', 'xor', 'ite'. NNF_NEG furthermore handles the case where negation is pushed over Boolean connectives 'and' and 'or'.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1785 of file Expr.java.

1786  {
1787  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_NNF_POS;
1788  }

◆ isProofOrElimination()

boolean isProofOrElimination ( )
inline

Indicates whether the term is a proof by elimination of not-or Remarks: * Given a proof for (not (or l_1 ... l_n)), produces a proof for (not l_i). * T1: (not (or l_1 ... l_n)) [not-or-elim T1]: (not l_i)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1497 of file Expr.java.

1498  {
1499  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_NOT_OR_ELIM;
1500  }

◆ isProofPullQuant()

boolean isProofPullQuant ( )
inline

Indicates whether the term is a proof for pulling quantifiers out. Remarks: A proof for (iff (f (forall (x) q(x)) r) (forall (x) (f (q x) r))). This proof object has no antecedents.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1545 of file Expr.java.

1546  {
1547  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_PULL_QUANT;
1548  }

◆ isProofPushQuant()

boolean isProofPushQuant ( )
inline

Indicates whether the term is a proof for pushing quantifiers in. Remarks: A proof for: (iff (forall (x_1 ... x_m) (and p_1[x_1 ... x_m] ... p_n[x_1 ... x_m])) (and (forall (x_1 ... x_m) p_1[x_1 ... x_m]) ... (forall (x_1 ... x_m) p_n[x_1 ... x_m]))) This proof object has no antecedents

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1560 of file Expr.java.

1561  {
1562  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_PUSH_QUANT;
1563  }

◆ isProofQuantInst()

boolean isProofQuantInst ( )
inline

Indicates whether the term is a proof for quantifier instantiation

Remarks: A proof of (or (not (forall (x) (P x))) (P a))

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1604 of file Expr.java.

1605  {
1606  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_QUANT_INST;
1607  }

◆ isProofQuantIntro()

boolean isProofQuantIntro ( )
inline

Indicates whether the term is a quant-intro proof Remarks: Given a proof * for (~ p q), produces a proof for (~ (forall (x) p) (forall (x) q)). T1: * (~ p q) [quant-intro T1]: (~ (forall (x) p) (forall (x) q))

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1456 of file Expr.java.

1457  {
1458  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_QUANT_INTRO;
1459  }

◆ isProofReflexivity()

boolean isProofReflexivity ( )
inline

Indicates whether the term is a proof for (R t t), where R is a reflexive relation. Remarks: This proof object has no antecedents. The only reflexive relations that are used are equivalence modulo namings, equality and equivalence. That is, R is either '~', '=' or 'iff'.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1386 of file Expr.java.

1387  {
1388  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_REFLEXIVITY;
1389  }

◆ isProofRewrite()

boolean isProofRewrite ( )
inline

Indicates whether the term is a proof by rewriting Remarks: A proof for a local rewriting step (= t s). The head function symbol of t is interpreted.

This proof object has no antecedents. The conclusion of a rewrite rule is either an equality (= t s), an equivalence (iff t s), or equi-satisfiability (~ t s). Remark: if f is bool, then = is iff.

Examples: (= (+ x 0) x) (= (+ x 1 2) (+ 3 x)) (iff (or x false) x)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1517 of file Expr.java.

1518  {
1519  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_REWRITE;
1520  }

◆ isProofRewriteStar()

boolean isProofRewriteStar ( )
inline

Indicates whether the term is a proof by rewriting Remarks: A proof for rewriting an expression t into an expression s. This proof object can have n antecedents. The antecedents are proofs for equalities used as substitution rules. The object is used in a few cases . The cases are: - When applying contextual simplification (CONTEXT_SIMPLIFIER=true) - When converting bit-vectors to Booleans (BIT2BOOL=true)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1533 of file Expr.java.

1534  {
1535  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_REWRITE_STAR;
1536  }

◆ isProofSkolemize()

boolean isProofSkolemize ( )
inline

Indicates whether the term is a proof for a Skolemization step Remarks: Proof for:

(p x y)) (p (sk y) y))

This proof object has no antecedents.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1822 of file Expr.java.

1823  {
1824  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_SKOLEMIZE;
1825  }

◆ isProofSymmetry()

boolean isProofSymmetry ( )
inline

Indicates whether the term is proof by symmetricity of a relation

Remarks: Given an symmetric relation R and a proof for (R t s), produces * a proof for (R s t). T1: (R t s) [symmetry T1]: (R s t) T1 is the * antecedent of this proof object.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1398 of file Expr.java.

1399  {
1400  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_SYMMETRY;
1401  }

◆ isProofTheoryLemma()

boolean isProofTheoryLemma ( )
inline

Indicates whether the term is a proof for theory lemma Remarks: Generic proof for theory lemmas.

The theory lemma function comes with one or more parameters. The first parameter indicates the name of the theory. For the theory of arithmetic, additional parameters provide hints for checking the theory lemma. The hints for arithmetic are: - farkas - followed by rational coefficients. Multiply the coefficients to the inequalities in the lemma, add the (negated) inequalities and obtain a contradiction. - triangle-eq - Indicates a lemma related to the equivalence: (iff (= t1 t2) (and (<= t1 t2) (<= t2 t1))) - gcd-test - Indicates an integer linear arithmetic lemma that uses a gcd test.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1857 of file Expr.java.

1858  {
1859  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_TH_LEMMA;
1860  }

◆ isProofTransitivity()

boolean isProofTransitivity ( )
inline

Indicates whether the term is a proof by transitivity of a relation

Remarks: Given a transitive relation R, and proofs for (R t s) and (R s * u), produces a proof for (R t u). T1: (R t s) T2: (R s u) [trans T1 T2]: * (R t u)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1410 of file Expr.java.

1411  {
1412  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_TRANSITIVITY;
1413  }

◆ isProofTransitivityStar()

boolean isProofTransitivityStar ( )
inline

Indicates whether the term is a proof by condensed transitivity of a relation Remarks: Condensed transitivity proof. It combines several symmetry and transitivity proofs. Example: T1: (R a b) T2: (R c b) T3: (R c d) [trans* T1 T2 T3]: (R a d) R must be a symmetric and transitive relation.

Assuming that this proof object is a proof for (R s t), then a proof checker must check if it is possible to prove (R s t) using the antecedents, symmetry and transitivity. That is, if there is a path from s to t, if we view every antecedent (R a b) as an edge between a and b.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1430 of file Expr.java.

1431  {
1432  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_TRANSITIVITY_STAR;
1433  }

◆ isProofTrue()

boolean isProofTrue ( )
inline

Indicates whether the term is a Proof for the expression 'true'.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1336 of file Expr.java.

1337  {
1338  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_TRUE;
1339  }

◆ isProofUnitResolution()

boolean isProofUnitResolution ( )
inline

Indicates whether the term is a proof by unit resolution Remarks: T1: * (or l_1 ... l_n l_1' ... l_m') T2: (not l_1) ... R(n+1): (not l_n) * [unit-resolution T1 ... R(n+1)]: (or l_1' ... l_m')

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1643 of file Expr.java.

1644  {
1645  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_PR_UNIT_RESOLUTION;
1646  }

◆ isRatNum()

boolean isRatNum ( )
inline

Indicates whether the term is a real numeral.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 267 of file Expr.java.

268  {
269  return isNumeral() && isReal();
270  }

◆ isReal()

boolean isReal ( )
inline

Indicates whether the term is of sort real.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 421 of file Expr.java.

422  {
423  return Native.getSortKind(getContext().nCtx(), Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_REAL_SORT.toInt();
424  }

◆ isRealIsInt()

boolean isRealIsInt ( )
inline

Indicates whether the term is a check that tests whether a real is integral (unary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 582 of file Expr.java.

583  {
584  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_IS_INT;
585  }

◆ isRealToInt()

boolean isRealToInt ( )
inline

Indicates whether the term is a coercion of real to integer (unary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 571 of file Expr.java.

572  {
573  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_TO_INT;
574  }

◆ isRelation()

boolean isRelation ( )
inline

Indicates whether the term is of an array sort.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1867 of file Expr.java.

1868  {
1869  return (Native.isApp(getContext().nCtx(), getNativeObject()) && Native
1870  .getSortKind(getContext().nCtx(),
1871  Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_RELATION_SORT
1872  .toInt());
1873  }

◆ isRelationalJoin()

boolean isRelationalJoin ( )
inline

Indicates whether the term is a relational join

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1914 of file Expr.java.

1915  {
1916  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_JOIN;
1917  }

◆ isRelationClone()

boolean isRelationClone ( )
inline

Indicates whether the term is a relational clone (copy) Remarks: Create a fresh copy (clone) of a relation. The function is logically the identity, but in the context of a register machine allows for terms of kind

to perform destructive updates to the first argument.

See also
isRelationUnion
Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 2038 of file Expr.java.

2039  {
2040  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_CLONE;
2041  }

◆ isRelationComplement()

boolean isRelationComplement ( )
inline

Indicates whether the term is the complement of a relation

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 2008 of file Expr.java.

2009  {
2010  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_COMPLEMENT;
2011  }

◆ isRelationFilter()

boolean isRelationFilter ( )
inline

Indicates whether the term is a relation filter Remarks: Filter (restrict) a relation with respect to a predicate. The first argument is a relation. The second argument is a predicate with free de-Bruijn indices corresponding to the columns of the relation. So the first column in the relation has index 0.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1966 of file Expr.java.

1967  {
1968  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_FILTER;
1969  }

◆ isRelationNegationFilter()

boolean isRelationNegationFilter ( )
inline

Indicates whether the term is an intersection of a relation with the negation of another. Remarks: Intersect the first relation with respect to negation of the second relation (the function takes two arguments). Logically, the specification can be described by a function

target = filter_by_negation(pos, neg, columns)

where columns are pairs c1, d1, .., cN, dN of columns from pos and neg, such that target are elements in x in pos, such that there is no y in neg that agrees with x on the columns c1, d1, .., cN, dN.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1986 of file Expr.java.

1987  {
1988  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_NEGATION_FILTER;
1989  }

◆ isRelationProject()

boolean isRelationProject ( )
inline

Indicates whether the term is a projection of columns (provided as numbers in the parameters). Remarks: The function takes one argument.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1951 of file Expr.java.

1952  {
1953  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_PROJECT;
1954  }

◆ isRelationRename()

boolean isRelationRename ( )
inline

Indicates whether the term is the renaming of a column in a relation Remarks: The function takes one argument. The parameters contain the renaming as a cycle.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1998 of file Expr.java.

1999  {
2000  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_RENAME;
2001  }

◆ isRelationSelect()

boolean isRelationSelect ( )
inline

Indicates whether the term is a relational select Remarks: Check if a record is an element of the relation. The function takes

n+1

arguments, where the first argument is a relation, and the remaining

n

arguments correspond to a record.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 2022 of file Expr.java.

2023  {
2024  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_SELECT;
2025  }

◆ isRelationStore()

boolean isRelationStore ( )
inline

Indicates whether the term is an relation store Remarks: Insert a record into a relation. The function takes

n+1

arguments, where the first argument is the relation and the remaining

n

elements correspond to the

n

columns of the relation.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1884 of file Expr.java.

1885  {
1886  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_STORE;
1887  }

◆ isRelationUnion()

boolean isRelationUnion ( )
inline

Indicates whether the term is the union or convex hull of two relations.

Remarks: The function takes two arguments.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1926 of file Expr.java.

1927  {
1928  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_UNION;
1929  }

◆ isRelationWiden()

boolean isRelationWiden ( )
inline

Indicates whether the term is the widening of two relations Remarks: The function takes two arguments.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 1938 of file Expr.java.

1939  {
1940  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_RA_WIDEN;
1941  }

◆ isRemainder()

boolean isRemainder ( )
inline

Indicates whether the term is remainder (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 541 of file Expr.java.

542  {
543  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_REM;
544  }

◆ isSelect()

boolean isSelect ( )
inline

Indicates whether the term is an array select.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 615 of file Expr.java.

616  {
617  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SELECT;
618  }

◆ isSetComplement()

boolean isSetComplement ( )
inline

Indicates whether the term is set complement

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 700 of file Expr.java.

701  {
702  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_COMPLEMENT;
703  }

◆ isSetDifference()

boolean isSetDifference ( )
inline

Indicates whether the term is set difference

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 690 of file Expr.java.

691  {
692  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_DIFFERENCE;
693  }

◆ isSetIntersect()

boolean isSetIntersect ( )
inline

Indicates whether the term is set intersection

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 680 of file Expr.java.

681  {
682  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_INTERSECT;
683  }

◆ isSetSubset()

boolean isSetSubset ( )
inline

Indicates whether the term is set subset

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 710 of file Expr.java.

711  {
712  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_SUBSET;
713  }

◆ isSetUnion()

boolean isSetUnion ( )
inline

Indicates whether the term is set union

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 670 of file Expr.java.

671  {
672  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_UNION;
673  }

◆ isStore()

boolean isStore ( )
inline

Indicates whether the term is an array store. Remarks: It satisfies * select(store(a,i,v),j) = if i = j then v else select(a,j). Array store * takes at least 3 arguments.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 605 of file Expr.java.

606  {
607  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_STORE;
608  }

◆ isString()

boolean isString ( )
inline

Check whether expression is a string constant.

Returns
a boolean

Definition at line 1278 of file Expr.java.

1279  {
1280  return isApp() && Native.isString(getContext().nCtx(), getNativeObject());
1281  }

◆ isSub()

boolean isSub ( )
inline

Indicates whether the term is subtraction (binary)

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 491 of file Expr.java.

492  {
493  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SUB;
494  }

◆ isTrue()

boolean isTrue ( )
inline

Indicates whether the term is the constant true.

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 299 of file Expr.java.

300  {
301  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_TRUE;
302  }

◆ isUMinus()

boolean isUMinus ( )
inline

Indicates whether the term is a unary minus

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 501 of file Expr.java.

502  {
503  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_UMINUS;
504  }

◆ isWellSorted()

boolean isWellSorted ( )
inline

Indicates whether the term is well-sorted.

Exceptions
Z3Exceptionon error
Returns
True if the term is well-sorted, false otherwise.

Definition at line 226 of file Expr.java.

227  {
228  return Native.isWellSorted(getContext().nCtx(), getNativeObject());
229  }

◆ isXor()

boolean isXor ( )
inline

Indicates whether the term is an exclusive or

Exceptions
Z3Exceptionon error
Returns
a boolean

Definition at line 381 of file Expr.java.

382  {
383  return isApp() && getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_XOR;
384  }

◆ simplify() [1/2]

Expr<R> simplify ( )
inline

Returns a simplified version of the expression

Returns
Expr
Exceptions
Z3Exceptionon error

Definition at line 38 of file Expr.java.

39  {
40  return simplify(null);
41  }

◆ simplify() [2/2]

Expr<R> simplify ( Params  p)
inline

Returns a simplified version of the expression A set of parameters

Parameters
pa Params object to configure the simplifier
See also
Context::SimplifyHelp
Returns
an Expr
Exceptions
Z3Exceptionon error

Definition at line 52 of file Expr.java.

53  {
54 
55  if (p == null) {
56  return (Expr<R>) Expr.create(getContext(),
57  Native.simplify(getContext().nCtx(), getNativeObject()));
58  }
59  else {
60  return (Expr<R>) Expr.create(
61  getContext(),
62  Native.simplifyEx(getContext().nCtx(), getNativeObject(),
63  p.getNativeObject()));
64  }
65  }

◆ substitute() [1/2]

Expr<R> substitute ( Expr<?>  from,
Expr<?>  to 
)
inline

Substitute every occurrence of

from

in the expression with

to

.

See also
Expr::substitute(Expr[],Expr[])
Exceptions
Z3Exceptionon error
Returns
an Expr

Definition at line 165 of file Expr.java.

166  {
167  return substitute(new Expr[] { from }, new Expr[] { to });
168  }

◆ substitute() [2/2]

Expr<R> substitute ( Expr<?>[]  from,
Expr<?>[]  to 
)
inline

Substitute every occurrence of

from[i]

in the expression with

to[i]

, for

i

smaller than

num_exprs

. Remarks: The result is the new expression. The arrays

from

and

to

must have size

num_exprs

. For every

i

smaller than

num_exprs

, we must have that sort of

from[i]

must be equal to sort of

to[i]

.

Exceptions
Z3Exceptionon error
Returns
an Expr

Definition at line 146 of file Expr.java.

147  {
148  getContext().checkContextMatch(from);
149  getContext().checkContextMatch(to);
150  if (from.length != to.length) {
151  throw new Z3Exception("Argument sizes do not match");
152  }
153  return (Expr<R>) Expr.create(getContext(), Native.substitute(getContext().nCtx(),
154  getNativeObject(), from.length, Expr.arrayToNative(from),
155  Expr.arrayToNative(to)));
156  }

◆ substituteVars()

Expr<R> substituteVars ( Expr<?>[]  to)
inline

Substitute the free variables in the expression with the expressions in

to


Remarks: For every

i

smaller than *

num_exprs

, the variable with de-Bruijn index

i

* is replaced with term

to[i]

.

Exceptions
Z3Exceptionon error
Z3Exceptionon error
Returns
an Expr

Definition at line 180 of file Expr.java.

181  {
182 
183  getContext().checkContextMatch(to);
184  return (Expr<R>) Expr.create(getContext(), Native.substituteVars(getContext().nCtx(),
185  getNativeObject(), to.length, Expr.arrayToNative(to)));
186  }

◆ toString()

String toString ( )
inline

Returns a string representation of the expression.

Reimplemented from AST.

Definition at line 205 of file Expr.java.

206  {
207  return super.toString();
208  }

Referenced by Optimize.AssertSoft().

◆ translate()

Expr<R> translate ( Context  ctx)
inline

Translates (copies) the term to the Context

ctx

.

Parameters
ctxA context
Returns
A copy of the term which is associated with
ctx
Exceptions
Z3Exceptionon error

Reimplemented from AST.

Definition at line 196 of file Expr.java.

197  {
198  return (Expr<R>) super.translate(ctx);
199  }

Referenced by Expr< SeqSort< R > >.translate().

◆ update()

Expr<R> update ( Expr<?>[]  args)
inline

Update the arguments of the expression using the arguments

args

The number of new arguments should coincide with the current number of arguments.

Parameters
argsarguments
Exceptions
Z3Exceptionon error

Definition at line 124 of file Expr.java.

125  {
126  getContext().checkContextMatch(args);
127  if (isApp() && args.length != getNumArgs()) {
128  throw new Z3Exception("Number of arguments does not match");
129  }
130  return (Expr<R>) Expr.create(getContext(), Native.updateTerm(getContext().nCtx(), getNativeObject(),
131  args.length, Expr.arrayToNative(args)));
132  }
com.microsoft.z3.Expr.isInt
boolean isInt()
Definition: Expr.java:411
z3::abs
expr abs(expr const &a)
Definition: z3++.h:1739
com.microsoft.z3.Expr.getFuncDecl
FuncDecl< R > getFuncDecl()
Definition: Expr.java:73
Z3_lbool
Z3_lbool
Lifted Boolean type: false, undefined, true.
Definition: z3_api.h:101
com.microsoft.z3.Expr.simplify
Expr< R > simplify()
Definition: Expr.java:38
Z3_sort_kind
Z3_sort_kind
The different kinds of Z3 types (See Z3_get_sort_kind).
Definition: z3_api.h:149
com.microsoft.z3.Context.mkBoolSort
BoolSort mkBoolSort()
Definition: Context.java:161
z3::forall
expr forall(expr const &x, expr const &b)
Definition: z3++.h:1999
com.microsoft.z3.Expr.isRelationUnion
boolean isRelationUnion()
Definition: Expr.java:1926
com.microsoft.z3.Expr.substitute
Expr< R > substitute(Expr<?>[] from, Expr<?>[] to)
Definition: Expr.java:146
com.microsoft.z3.Expr.Expr
Expr(Context ctx, long obj)
Definition: Expr.java:2097
com.microsoft.z3.AST.isExpr
boolean isExpr()
Definition: AST.java:112
com.microsoft.z3.Expr.isNumeral
boolean isNumeral()
Definition: Expr.java:215
com.microsoft.z3.AST.isApp
boolean isApp()
Definition: AST.java:131
Z3_decl_kind
Z3_decl_kind
The different kinds of interpreted function kinds.
Definition: z3_api.h:1000
com.microsoft.z3.Expr.isReal
boolean isReal()
Definition: Expr.java:421
com.microsoft.z3.AST.isVar
boolean isVar()
Definition: AST.java:141
com.microsoft.z3.Expr.getNumArgs
int getNumArgs()
Definition: Expr.java:96