mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
Merge pull request #1073 from chaserhkj/funcdecl-translate-java
Add translate method for FuncDecl in java api
This commit is contained in:
commit
90a38c9a35
|
@ -59,6 +59,24 @@ public class FuncDecl extends AST
|
||||||
return Native.getFuncDeclId(getContext().nCtx(), getNativeObject());
|
return Native.getFuncDeclId(getContext().nCtx(), getNativeObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translates (copies) the function declaration to the Context {@code ctx}.
|
||||||
|
* @param ctx A context
|
||||||
|
*
|
||||||
|
* @return A copy of the function declaration 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
|
||||||
**/
|
**/
|
||||||
|
|
Loading…
Reference in a new issue