3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00

Add translate method for FuncDecl in java api

This commit is contained in:
KangJing Huang (Chaserhkj) 2017-06-13 00:25:36 -04:00
parent 2de80b5ce9
commit 3a692fe33c

View file

@ -59,6 +59,24 @@ public class FuncDecl extends AST
return Native.getFuncDeclId(getContext().nCtx(), getNativeObject()); return Native.getFuncDeclId(getContext().nCtx(), getNativeObject());
} }
/**
* Translates (copies) the AST to the Context {@code ctx}.
* @param ctx A context
*
* @return A copy of the AST which is associated with {@code ctx}
* @throws Z3Exception on error
**/
public FuncDecl translate(Context ctx)
{
if (getContext() == ctx) {
return this;
} else {
return new FuncDecl(ctx, Native.translate(getContext().nCtx(),
getNativeObject(), ctx.nCtx()));
}
}
/** /**
* The arity of the function declaration * The arity of the function declaration
**/ **/