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:
parent
e4411265ea
commit
3a0e9e8f53
6 changed files with 108 additions and 24 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue