From d37ed4171dedba13b1dcb8c2f5a4aa87a22974cd Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 2 Jul 2022 13:12:54 -0700 Subject: [PATCH] Update Expr.cs Add a Dup functionality that allows extending the life-time of expressions that are passed by the UserPropagator callbacks (or other code). --- src/api/dotnet/Expr.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api/dotnet/Expr.cs b/src/api/dotnet/Expr.cs index f735401d8..7dabc49cd 100644 --- a/src/api/dotnet/Expr.cs +++ b/src/api/dotnet/Expr.cs @@ -168,6 +168,16 @@ namespace Microsoft.Z3 { return (Expr)base.Translate(ctx); } + + /// + /// Create a duplicate of expression. + /// This feature is to allow extending the life-time of expressions that were passed down as arguments + /// by the user propagator callbacks. By default the life-time of arguments to callbacks is within the + /// callback only. + /// + public Expr Dup() { + return Expr.Create(Context, NativeObject); + } /// /// Returns a string representation of the expression.