18 package com.microsoft.z3;
55 return Expr.create(getContext(),
56 Native.simplify(getContext().nCtx(), getNativeObject()));
61 Native.simplifyEx(getContext().nCtx(), getNativeObject(),
62 p.getNativeObject()));
74 return new FuncDecl(getContext(), Native.getAppDecl(getContext().nCtx(),
86 return Z3_lbool.fromInt(Native.getBoolValue(getContext().nCtx(),
97 return Native.getAppNumArgs(getContext().nCtx(), getNativeObject());
109 for (
int i = 0; i < n; i++) {
110 res[i] =
Expr.create(getContext(),
111 Native.getAppArg(getContext().nCtx(), getNativeObject(), i));
125 getContext().checkContextMatch(args);
127 throw new Z3Exception(
"Number of arguments does not match");
129 return new Expr(getContext(), Native.updateTerm(getContext().nCtx(), getNativeObject(),
130 args.length,
Expr.arrayToNative(args)));
147 getContext().checkContextMatch(from);
148 getContext().checkContextMatch(to);
149 if (from.length != to.length) {
150 throw new Z3Exception(
"Argument sizes do not match");
152 return Expr.create(getContext(), Native.substitute(getContext().nCtx(),
153 getNativeObject(), from.length,
Expr.arrayToNative(from),
154 Expr.arrayToNative(to)));
182 getContext().checkContextMatch(to);
183 return Expr.create(getContext(), Native.substituteVars(getContext().nCtx(),
184 getNativeObject(), to.length,
Expr.arrayToNative(to)));
197 if (getContext() == ctx) {
202 Native.translate(getContext().nCtx(), getNativeObject(),
213 return super.toString();
223 return Native.isNumeralAst(getContext().nCtx(), getNativeObject());
234 return Native.isWellSorted(getContext().nCtx(), getNativeObject());
244 return Sort.create(getContext(),
245 Native.getSort(getContext().nCtx(), getNativeObject()));
285 return Native.isAlgebraicNumber(getContext().nCtx(), getNativeObject());
295 return (
isExpr() && Native.isEqSort(getContext().nCtx(),
297 Native.getSort(getContext().nCtx(), getNativeObject())));
419 return Native.getSortKind(getContext().nCtx(), Native.getSort(getContext().nCtx(), getNativeObject())) ==
Z3_sort_kind.Z3_INT_SORT.toInt();
429 return Native.getSortKind(getContext().nCtx(), Native.getSort(getContext().nCtx(), getNativeObject())) ==
Z3_sort_kind.Z3_REAL_SORT.toInt();
600 return (Native.isApp(getContext().nCtx(), getNativeObject()) &&
Z3_sort_kind 601 .fromInt(Native.getSortKind(getContext().nCtx(),
602 Native.getSort(getContext().nCtx(), getNativeObject()))) ==
Z3_sort_kind.Z3_ARRAY_SORT);
728 return Native.getSortKind(getContext().nCtx(),
729 Native.getSort(getContext().nCtx(), getNativeObject())) ==
Z3_sort_kind.Z3_BV_SORT
1877 return (Native.isApp(getContext().nCtx(), getNativeObject()) && Native
1878 .getSortKind(getContext().nCtx(),
1879 Native.getSort(getContext().nCtx(), getNativeObject())) ==
Z3_sort_kind.Z3_RELATION_SORT
2058 return (Native.isApp(getContext().nCtx(), getNativeObject()) && Native
2059 .getSortKind(getContext().nCtx(),
2060 Native.getSort(getContext().nCtx(), getNativeObject())) ==
Z3_sort_kind.Z3_FINITE_DOMAIN_SORT
2095 throw new Z3Exception(
"Term is not a bound variable.");
2098 return Native.getIndexValue(getContext().nCtx(), getNativeObject());
2110 void checkNativeObject(
long obj) {
2111 if (!Native.isApp(getContext().nCtx(), obj) &&
2112 Native.getAstKind(getContext().nCtx(), obj) !=
Z3_ast_kind.Z3_VAR_AST.toInt() &&
2113 Native.getAstKind(getContext().nCtx(), obj) !=
Z3_ast_kind.Z3_QUANTIFIER_AST.toInt()) {
2114 throw new Z3Exception(
"Underlying object is not a term");
2116 super.checkNativeObject(obj);
2119 static Expr create(Context ctx, FuncDecl f,
Expr ... arguments)
2122 long obj = Native.mkApp(ctx.nCtx(), f.getNativeObject(),
2123 AST.arrayLength(arguments), AST.arrayToNative(arguments));
2124 return create(ctx, obj);
2127 static Expr create(Context ctx,
long obj)
2131 return new Quantifier(ctx, obj);
2132 long s = Native.getSort(ctx.nCtx(), obj);
2134 .fromInt(Native.getSortKind(ctx.nCtx(), s));
2136 if (Native.isAlgebraicNumber(ctx.nCtx(), obj))
2137 return new AlgebraicNum(ctx, obj);
2139 if (Native.isNumeralAst(ctx.nCtx(), obj))
2144 return new IntNum(ctx, obj);
2146 return new RatNum(ctx, obj);
2148 return new BitVecNum(ctx, obj);
2150 return new FPNum(ctx, obj);
2152 return new FPRMNum(ctx, obj);
2154 return new FiniteDomainNum(ctx, obj);
2162 return new BoolExpr(ctx, obj);
2164 return new IntExpr(ctx, obj);
2166 return new RealExpr(ctx, obj);
2168 return new BitVecExpr(ctx, obj);
2170 return new ArrayExpr(ctx, obj);
2172 return new DatatypeExpr(ctx, obj);
2174 return new FPExpr(ctx, obj);
2176 return new FPRMExpr(ctx, obj);
2178 return new FiniteDomainExpr(ctx, obj);
2180 return new SeqExpr(ctx, obj);
2182 return new ReExpr(ctx, obj);
2186 return new Expr(ctx, obj);
boolean isEmptyRelation()
Z3_sort_kind
The different kinds of Z3 types (See #Z3_get_sort_kind).
boolean isProofTransitivityStar()
boolean isProofModusPonens()
boolean isSetComplement()
boolean isProofElimUnusedVars()
boolean isProofMonotonicity()
boolean isRelationSelect()
boolean isRelationStore()
boolean isBVRotateLeftExtended()
boolean isBVZeroExtension()
boolean isProofSkolemize()
boolean isConstantArray()
boolean isProofReflexivity()
boolean isProofIFFFalse()
boolean isBVShiftRightArithmetic()
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types.
boolean isProofPullQuantStar()
boolean isBVRotateRight()
boolean isRelationProject()
Z3_lbool
Lifted Boolean type: false, undefined, true.
boolean isProofCommutativity()
boolean isRelationNegationFilter()
boolean isProofAndElimination()
Expr substitute(Expr from, Expr to)
boolean isSetDifference()
boolean isAlgebraicNumber()
boolean isRelationRename()
boolean isProofRewriteStar()
boolean isProofPushQuant()
boolean isRelationClone()
boolean isProofPullQuant()
boolean isRelationUnion()
boolean isProofHypothesis()
Z3_decl_kind getDeclKind()
boolean isRelationFilter()
boolean isProofTransitivity()
boolean isProofOrElimination()
boolean isProofUnitResolution()
boolean isBVSignExtension()
boolean isBVShiftRightLogical()
Expr translate(Context ctx)
boolean isRelationWiden()
boolean isProofDefIntro()
boolean isProofSymmetry()
boolean isFiniteDomainLT()
boolean isProofQuantIntro()
Expr substituteVars(Expr[] to)
boolean isProofModusPonensOEQ()
boolean isProofDefAxiom()
boolean isProofDistributivity()
boolean isIsEmptyRelation()
boolean isArithmeticNumeral()
boolean isProofQuantInst()
boolean isRelationalJoin()
boolean isRelationComplement()
Expr(Context ctx, long obj)
Expr substitute(Expr[] from, Expr[] to)
boolean isProofApplyDef()
boolean isProofAsserted()
boolean isBVRotateRightExtended()
Z3_decl_kind
The different kinds of interpreted function kinds.
boolean isProofTheoryLemma()
def String(name, ctx=None)