mirror of
https://github.com/Z3Prover/z3
synced 2026-02-28 10:51:28 +00:00
Distinguish betwee Lambda and Quantifier in Expr.java
This commit is contained in:
parent
121f66c19c
commit
c791694af8
1 changed files with 9 additions and 2 deletions
|
|
@ -2148,8 +2148,15 @@ public class Expr<R extends Sort> extends AST
|
|||
static Expr<?> create(Context ctx, long obj)
|
||||
{
|
||||
Z3_ast_kind k = Z3_ast_kind.fromInt(Native.getAstKind(ctx.nCtx(), obj));
|
||||
if (k == Z3_ast_kind.Z3_QUANTIFIER_AST)
|
||||
return new Quantifier(ctx, obj);
|
||||
if (k == Z3_ast_kind.Z3_QUANTIFIER_AST) {
|
||||
// a quantifier AST is a lambda iff it is neither a forall nor an exists.
|
||||
boolean isLambda = !Native.isQuantifierExists(ctx, obj) && !Native.isQuantifierForall(ctx, obj);
|
||||
if (isLambda) {
|
||||
return new Lambda(ctx, obj);
|
||||
} else {
|
||||
return new Quantifier(ctx, obj);
|
||||
}
|
||||
}
|
||||
long s = Native.getSort(ctx.nCtx(), obj);
|
||||
Z3_sort_kind sk = Z3_sort_kind
|
||||
.fromInt(Native.getSortKind(ctx.nCtx(), s));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue