3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 02:45:51 +00:00

add itos/stoi conversion to API. Issue #895

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-02-11 11:31:13 -05:00
parent e4411265ea
commit 3a0e9e8f53
6 changed files with 108 additions and 24 deletions

View file

@ -2420,6 +2420,29 @@ namespace Microsoft.Z3
return new SeqExpr(this, Native.Z3_mk_string(nCtx, s));
}
/// <summary>
/// Convert an integer expression to a string.
/// </summary>
public SeqExpr IntToString(Expr e)
{
Contract.Requires(e != null);
Contract.Requires(e is ArithExpr);
Contract.Ensures(Contract.Result<SeqExpr>() != null);
return new SeqExpr(this, Native.Z3_mk_int_to_str(nCtx, e.NativeObject));
}
/// <summary>
/// Convert an integer expression to a string.
/// </summary>
public IntExpr StringToInt(Expr e)
{
Contract.Requires(e != null);
Contract.Requires(e is SeqExpr);
Contract.Ensures(Contract.Result<IntExpr>() != null);
return new IntExpr(this, Native.Z3_mk_str_to_int(nCtx, e.NativeObject));
}
/// <summary>
/// Concatentate sequences.
/// </summary>