Z3
Public Member Functions | Static Public Member Functions
Quantifier Class Reference
+ Inheritance diagram for Quantifier:

Public Member Functions

boolean isUniversal ()
 
boolean isExistential ()
 
int getWeight ()
 
int getNumPatterns ()
 
Pattern [] getPatterns ()
 
int getNumNoPatterns ()
 
Pattern [] getNoPatterns ()
 
int getNumBound ()
 
Symbol [] getBoundVariableNames ()
 
Sort [] getBoundVariableSorts ()
 
BoolExpr getBody ()
 
- Public Member Functions inherited from Expr
Expr simplify ()
 
Expr simplify (Params p)
 
FuncDecl getFuncDecl ()
 
Z3_lbool getBoolValue ()
 
int getNumArgs ()
 
Expr [] getArgs ()
 
Expr update (Expr[] args)
 
Expr substitute (Expr[] from, Expr[] to)
 
Expr substitute (Expr from, Expr to)
 
Expr substituteVars (Expr[] to)
 
Expr translate (Context ctx)
 
String toString ()
 
boolean isNumeral ()
 
boolean isWellSorted ()
 
Sort 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 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 isProofPullQuantStar ()
 
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 isProofNNFStar ()
 
boolean isProofCNFStar ()
 
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 ()
 
AST translate (Context ctx)
 
Z3_ast_kind getASTKind ()
 
boolean isExpr ()
 
boolean isApp ()
 
boolean isVar ()
 
boolean isQuantifier ()
 
boolean isSort ()
 
boolean isFuncDecl ()
 
String toString ()
 
String getSExpr ()
 

Static Public Member Functions

static Quantifier of (Context ctx, boolean isForall, Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)
 
static Quantifier of (Context ctx, boolean isForall, Expr[] bound, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)
 

Additional Inherited Members

- Protected Member Functions inherited from Expr
 Expr (Context ctx, long obj)
 

Detailed Description

Quantifier expressions.

Definition at line 25 of file Quantifier.java.

Member Function Documentation

§ getBody()

BoolExpr getBody ( )
inline

The body of the quantifier.

Exceptions
Z3Exception

Definition at line 142 of file Quantifier.java.

143  {
144  return new BoolExpr(getContext(), Native.getQuantifierBody(getContext()
145  .nCtx(), getNativeObject()));
146  }

§ getBoundVariableNames()

Symbol [] getBoundVariableNames ( )
inline

The symbols for the bound variables.

Exceptions
Z3Exception

Definition at line 112 of file Quantifier.java.

113  {
114  int n = getNumBound();
115  Symbol[] res = new Symbol[n];
116  for (int i = 0; i < n; i++)
117  res[i] = Symbol.create(getContext(), Native.getQuantifierBoundName(
118  getContext().nCtx(), getNativeObject(), i));
119  return res;
120  }

§ getBoundVariableSorts()

Sort [] getBoundVariableSorts ( )
inline

The sorts of the bound variables.

Exceptions
Z3Exception

Definition at line 127 of file Quantifier.java.

128  {
129  int n = getNumBound();
130  Sort[] res = new Sort[n];
131  for (int i = 0; i < n; i++)
132  res[i] = Sort.create(getContext(), Native.getQuantifierBoundSort(
133  getContext().nCtx(), getNativeObject(), i));
134  return res;
135  }

§ getNoPatterns()

Pattern [] getNoPatterns ( )
inline

The no-patterns.

Exceptions
Z3Exception

Definition at line 89 of file Quantifier.java.

90  {
91  int n = getNumNoPatterns();
92  Pattern[] res = new Pattern[n];
93  for (int i = 0; i < n; i++)
94  res[i] = new Pattern(getContext(), Native.getQuantifierNoPatternAst(
95  getContext().nCtx(), getNativeObject(), i));
96  return res;
97  }

§ getNumBound()

int getNumBound ( )
inline

The number of bound variables.

Definition at line 102 of file Quantifier.java.

Referenced by Quantifier.getBoundVariableNames(), and Quantifier.getBoundVariableSorts().

103  {
104  return Native.getQuantifierNumBound(getContext().nCtx(), getNativeObject());
105  }

§ getNumNoPatterns()

int getNumNoPatterns ( )
inline

The number of no-patterns.

Definition at line 78 of file Quantifier.java.

Referenced by Quantifier.getNoPatterns().

79  {
80  return Native.getQuantifierNumNoPatterns(getContext().nCtx(),
81  getNativeObject());
82  }

§ getNumPatterns()

int getNumPatterns ( )
inline

The number of patterns.

Definition at line 54 of file Quantifier.java.

Referenced by Quantifier.getPatterns().

55  {
56  return Native
57  .getQuantifierNumPatterns(getContext().nCtx(), getNativeObject());
58  }

§ getPatterns()

Pattern [] getPatterns ( )
inline

The patterns.

Exceptions
Z3Exception

Definition at line 65 of file Quantifier.java.

66  {
67  int n = getNumPatterns();
68  Pattern[] res = new Pattern[n];
69  for (int i = 0; i < n; i++)
70  res[i] = new Pattern(getContext(), Native.getQuantifierPatternAst(
71  getContext().nCtx(), getNativeObject(), i));
72  return res;
73  }

§ getWeight()

int getWeight ( )
inline

The weight of the quantifier.

Definition at line 46 of file Quantifier.java.

47  {
48  return Native.getQuantifierWeight(getContext().nCtx(), getNativeObject());
49  }

§ isExistential()

boolean isExistential ( )
inline

Indicates whether the quantifier is existential.

Definition at line 38 of file Quantifier.java.

39  {
40  return !isUniversal();
41  }

§ isUniversal()

boolean isUniversal ( )
inline

Indicates whether the quantifier is universal.

Definition at line 30 of file Quantifier.java.

Referenced by Quantifier.isExistential().

31  {
32  return Native.isQuantifierForall(getContext().nCtx(), getNativeObject());
33  }

§ of() [1/2]

static Quantifier of ( Context  ctx,
boolean  isForall,
Sort []  sorts,
Symbol []  names,
Expr  body,
int  weight,
Pattern []  patterns,
Expr []  noPatterns,
Symbol  quantifierID,
Symbol  skolemID 
)
inlinestatic

Create a quantified expression.

Parameters
patternsNullable patterns
noPatternsNullable noPatterns
quantifierIDNullable quantifierID
skolemIDNullable skolemID

Definition at line 156 of file Quantifier.java.

Referenced by Context.mkExists(), and Context.mkForall().

159  {
160  ctx.checkContextMatch(patterns);
161  ctx.checkContextMatch(noPatterns);
162  ctx.checkContextMatch(sorts);
163  ctx.checkContextMatch(names);
164  ctx.checkContextMatch(body);
165 
166  if (sorts.length != names.length) {
167  throw new Z3Exception(
168  "Number of sorts does not match number of names");
169  }
170 
171  long nativeObj;
172  if (noPatterns == null && quantifierID == null && skolemID == null) {
173  nativeObj = Native.mkQuantifier(ctx.nCtx(), (isForall), weight, AST.arrayLength(patterns), AST
174  .arrayToNative(patterns), AST.arrayLength(sorts), AST
175  .arrayToNative(sorts), Symbol.arrayToNative(names), body
176  .getNativeObject());
177  } else {
178  nativeObj = Native.mkQuantifierEx(ctx.nCtx(),
179  (isForall), weight, AST.getNativeObject(quantifierID),
180  AST.getNativeObject(skolemID),
181  AST.arrayLength(patterns), AST.arrayToNative(patterns),
182  AST.arrayLength(noPatterns), AST.arrayToNative(noPatterns),
183  AST.arrayLength(sorts), AST.arrayToNative(sorts),
184  Symbol.arrayToNative(names),
185  body.getNativeObject());
186  }
187  return new Quantifier(ctx, nativeObj);
188  }

§ of() [2/2]

static Quantifier of ( Context  ctx,
boolean  isForall,
Expr []  bound,
Expr  body,
int  weight,
Pattern []  patterns,
Expr []  noPatterns,
Symbol  quantifierID,
Symbol  skolemID 
)
inlinestatic
Parameters
ctxContext to create the quantifier on.
isForallQuantifier type.
boundBound variables.
bodyBody of the quantifier.
weightWeight.
patternsNullable array of patterns.
noPatternsNullable array of noPatterns.
quantifierIDNullable quantifier identifier.
skolemIDNullable skolem identifier.

Definition at line 202 of file Quantifier.java.

204  {
205  ctx.checkContextMatch(noPatterns);
206  ctx.checkContextMatch(patterns);
207  ctx.checkContextMatch(body);
208 
209  long nativeObj;
210  if (noPatterns == null && quantifierID == null && skolemID == null) {
211  nativeObj = Native.mkQuantifierConst(ctx.nCtx(),
212  isForall, weight, AST.arrayLength(bound),
213  AST.arrayToNative(bound), AST.arrayLength(patterns),
214  AST.arrayToNative(patterns), body.getNativeObject());
215  } else {
216  nativeObj = Native.mkQuantifierConstEx(ctx.nCtx(),
217  isForall, weight,
218  AST.getNativeObject(quantifierID),
219  AST.getNativeObject(skolemID), AST.arrayLength(bound),
220  AST.arrayToNative(bound), AST.arrayLength(patterns),
221  AST.arrayToNative(patterns), AST.arrayLength(noPatterns),
222  AST.arrayToNative(noPatterns), body.getNativeObject());
223  }
224  return new Quantifier(ctx, nativeObj);
225  }