Microsoft.Z3.Expr.Substitute C# (CSharp) Method

Substitute() public method

Substitute every occurrence of from[i] in the expression with to[i], for i smaller than num_exprs.
The result is the new expression. The arrays from and to must have size num_exprs. For every i smaller than num_exprs, we must have that sort of from[i] must be equal to sort of to[i].
public Substitute ( Expr from, Expr to ) : Expr
from Expr
to Expr
return Expr
        public Expr Substitute(Expr[] from, Expr[] to)
        {
            Contract.Requires(from != null);
            Contract.Requires(to != null);
            Contract.Requires(Contract.ForAll(from, f => f != null));
            Contract.Requires(Contract.ForAll(to, t => t != null));
            Contract.Ensures(Contract.Result<Expr>() != null);

            Context.CheckContextMatch(from);
            Context.CheckContextMatch(to);
            if (from.Length != to.Length)
                throw new Z3Exception("Argument sizes do not match");
            return Expr.Create(Context, Native.Z3_substitute(Context.nCtx, NativeObject, (uint)from.Length, Expr.ArrayToNative(from), Expr.ArrayToNative(to)));
        }