18 package com.microsoft.z3;
57 return Expr.create(getContext(),
58 Native.simplify(getContext().nCtx(), getNativeObject()));
62 Native.simplifyEx(getContext().nCtx(), getNativeObject(),
63 p.getNativeObject()));
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(),
124 getContext().checkContextMatch(args);
126 throw new Z3Exception(
"Number of arguments does not match");
128 (
int) args.length,
Expr.arrayToNative(args)));
145 getContext().checkContextMatch(from);
146 getContext().checkContextMatch(to);
147 if (from.length != to.length)
148 throw new Z3Exception(
"Argument sizes do not match");
149 return Expr.create(getContext(), Native.substitute(getContext().nCtx(),
150 getNativeObject(), (int) from.length,
Expr.arrayToNative(from),
151 Expr.arrayToNative(to)));
180 getContext().checkContextMatch(to);
181 return Expr.create(getContext(), Native.substituteVars(getContext().nCtx(),
182 getNativeObject(), (int) to.length,
Expr.arrayToNative(to)));
197 if (getContext() == ctx)
202 Native.translate(getContext().nCtx(), getNativeObject(),
211 return super.toString();
221 return Native.isNumeralAst(getContext().nCtx(), getNativeObject());
233 return Native.isWellSorted(getContext().nCtx(), getNativeObject());
243 return Sort.create(getContext(),
244 Native.getSort(getContext().nCtx(), getNativeObject()));
284 return Native.isAlgebraicNumber(getContext().nCtx(), getNativeObject());
296 Native.getSort(getContext().nCtx(), getNativeObject())));
419 .getSortKind(getContext().nCtx(),
431 return Native.getSortKind(getContext().nCtx(),
604 return (
Native.
isApp(getContext().nCtx(), getNativeObject()) && Z3_sort_kind
605 .fromInt(Native.getSortKind(getContext().nCtx(),
732 return Native.getSortKind(getContext().nCtx(),
1881 return (
Native.
isApp(getContext().nCtx(), getNativeObject()) && Native
1882 .getSortKind(getContext().nCtx(),
2062 return (
Native.
isApp(getContext().nCtx(), getNativeObject()) && Native
2063 .getSortKind(getContext().nCtx(),
2099 throw new Z3Exception(
"Term is not a bound variable.");
2101 return Native.getIndexValue(getContext().nCtx(), getNativeObject());
2125 void checkNativeObject(
long obj)
2128 Native.getAstKind(getContext().nCtx(), obj) != Z3_ast_kind.Z3_VAR_AST.toInt() &&
2129 Native.
getAstKind(getContext().nCtx(), obj) != Z3_ast_kind.Z3_QUANTIFIER_AST.toInt())
2130 throw new Z3Exception(
"Underlying object is not a term");
2131 super.checkNativeObject(obj);
2134 static Expr create(Context ctx, FuncDecl f,
Expr ... arguments)
2137 long obj = Native.mkApp(ctx.nCtx(), f.getNativeObject(),
2138 AST.arrayLength(arguments), AST.arrayToNative(arguments));
2139 return create(ctx, obj);
2142 static Expr create(Context ctx,
long obj)
2144 Z3_ast_kind k = Z3_ast_kind.fromInt(Native.getAstKind(ctx.nCtx(), obj));
2146 return new Quantifier(ctx, obj);
2147 long s = Native.getSort(ctx.nCtx(), obj);
2149 .fromInt(Native.getSortKind(ctx.nCtx(), s));
2151 if (Native.isAlgebraicNumber(ctx.nCtx(), obj))
2152 return new AlgebraicNum(ctx, obj);
2154 if (Native.isNumeralAst(ctx.nCtx(), obj))
2159 return new IntNum(ctx, obj);
2161 return new RatNum(ctx, obj);
2163 return new BitVecNum(ctx, obj);
2165 return new FPNum(ctx, obj);
2167 return new FPRMNum(ctx, obj);
2175 return new BoolExpr(ctx, obj);
2177 return new IntExpr(ctx, obj);
2179 return new RealExpr(ctx, obj);
2181 return new BitVecExpr(ctx, obj);
2183 return new ArrayExpr(ctx, obj);
2185 return new DatatypeExpr(ctx, obj);
2187 return new FPExpr(ctx, obj);
2189 return new FPRMExpr(ctx, obj);
2193 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()
static long updateTerm(long a0, long a1, int a2, long[] a3)
boolean isBVRotateRight()
boolean isRelationProject()
Z3_lbool
Lifted Boolean type: false, undefined, true.
boolean isProofCommutativity()
static boolean isNumeralAst(long a0, long a1)
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()
boolean isRelationFilter()
boolean isProofTransitivity()
Z3_OP_PR_ELIM_UNUSED_VARS
boolean isProofOrElimination()
boolean isProofUnitResolution()
boolean isBVSignExtension()
boolean isBVShiftRightLogical()
Expr translate(Context ctx)
static boolean isApp(long a0, long a1)
static boolean isEqSort(long a0, long a1, long a2)
static long getAppArg(long a0, long a1, int a2)
boolean isRelationWiden()
boolean isProofDefIntro()
boolean isProofSymmetry()
boolean isFiniteDomainLT()
boolean isProofQuantIntro()
Z3_OP_PR_MODUS_PONENS_OEQ
static int getAstKind(long a0, long a1)
Expr substituteVars(Expr[] to)
boolean isProofModusPonensOEQ()
boolean isProofDefAxiom()
boolean isProofDistributivity()
static long getAppDecl(long a0, long a1)
boolean isIsEmptyRelation()
boolean isArithmeticNumeral()
boolean isProofQuantInst()
boolean isRelationalJoin()
boolean isRelationComplement()
Expr(Context ctx, long obj)
static long mkBoolSort(long a0)
static long getSort(long a0, long a1)
Expr substitute(Expr[] from, Expr[] to)
boolean isProofApplyDef()
boolean isProofAsserted()
boolean isBVRotateRightExtended()
Z3_decl_kind
The different kinds of interpreted function kinds.
Z3_OP_PR_TRANSITIVITY_STAR
boolean isProofTheoryLemma()