18 package com.microsoft.z3;
38 casted = AST.class.cast(o);
39 }
catch (ClassCastException e)
48 (getContext().nCtx() == casted.getContext().nCtx()) &&
49 (Native.isEqAst(getContext().nCtx(), getNativeObject(), casted.getNativeObject()));
68 oAST = AST.class.cast(other);
69 }
catch (ClassCastException e)
74 if (
getId() < oAST.getId())
76 else if (
getId() > oAST.getId())
91 Native.getAstHash(getContext().nCtx(), getNativeObject());
103 return Native.getAstId(getContext().nCtx(), getNativeObject());
116 if (getContext() == ctx)
120 getNativeObject(), ctx.nCtx()));
129 return Z3_ast_kind.fromInt(Native.getAstKind(getContext().nCtx(),
205 return Native.astToString(getContext().nCtx(), getNativeObject());
208 return "Z3Exception: " + e.getMessage();
217 return Native.astToString(getContext().nCtx(), getNativeObject());
225 AST(Context ctx,
long obj)
233 if (getContext() == null || o == 0)
235 getContext().getASTDRQ().incAndClear(getContext(), o);
242 if (getContext() == null || o == 0)
244 getContext().getASTDRQ().add(o);
248 static AST create(Context ctx,
long obj)
250 switch (
Z3_ast_kind.fromInt(Native.getAstKind(ctx.nCtx(), obj)))
253 return new FuncDecl(ctx, obj);
255 return new Quantifier(ctx, obj);
257 return Sort.create(ctx, obj);
261 return Expr.create(ctx, obj);
263 throw new Z3Exception(
"Unknown AST kind");
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types...
AST translate(Context ctx)
static long translate(long a0, long a1, long a2)
int compareTo(Object other)