mirror of
https://github.com/Z3Prover/z3
synced 2026-01-20 01:03:20 +00:00
Fixed AST translation functions in .NET and Java APIs. Fixes #1073.
This commit is contained in:
parent
2d1abf2795
commit
d8a02bc040
12 changed files with 133 additions and 62 deletions
|
|
@ -163,13 +163,7 @@ namespace Microsoft.Z3
|
|||
/// <returns>A copy of the term which is associated with <paramref name="ctx"/></returns>
|
||||
new public Expr Translate(Context ctx)
|
||||
{
|
||||
Contract.Requires(ctx != null);
|
||||
Contract.Ensures(Contract.Result<Expr>() != null);
|
||||
|
||||
if (ReferenceEquals(Context, ctx))
|
||||
return this;
|
||||
else
|
||||
return Expr.Create(ctx, Native.Z3_translate(Context.nCtx, NativeObject, ctx.nCtx));
|
||||
return (Expr)base.Translate(ctx);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -809,7 +803,7 @@ namespace Microsoft.Z3
|
|||
/// Retrieve string corresponding to string constant.
|
||||
/// </summary>
|
||||
/// <remarks>the expression should be a string constant, (IsString should be true).</remarks>
|
||||
public string String { get { return Native.Z3_get_string(Context.nCtx, NativeObject); } }
|
||||
public string String { get { return Native.Z3_get_string(Context.nCtx, NativeObject); } }
|
||||
|
||||
/// <summary>
|
||||
/// Check whether expression is a concatentation.
|
||||
|
|
@ -828,43 +822,43 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
/// <returns>a Boolean</returns>
|
||||
public bool IsSuffix { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_SUFFIX; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check whether expression is a contains.
|
||||
/// </summary>
|
||||
/// <returns>a Boolean</returns>
|
||||
public bool IsContains { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_CONTAINS; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check whether expression is an extract.
|
||||
/// </summary>
|
||||
/// <returns>a Boolean</returns>
|
||||
public bool IsExtract { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_EXTRACT; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check whether expression is a replace.
|
||||
/// </summary>
|
||||
/// <returns>a Boolean</returns>
|
||||
public bool IsReplace { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_REPLACE; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check whether expression is an at.
|
||||
/// </summary>
|
||||
/// <returns>a Boolean</returns>
|
||||
public bool IsAt { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_AT; } }
|
||||
public bool IsAt { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_AT; } }
|
||||
|
||||
/// <summary>
|
||||
/// Check whether expression is a sequence length.
|
||||
/// </summary>
|
||||
/// <returns>a Boolean</returns>
|
||||
public bool IsLength { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_LENGTH; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check whether expression is a sequence index.
|
||||
/// </summary>
|
||||
/// <returns>a Boolean</returns>
|
||||
public bool IsIndex { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_SEQ_INDEX; } }
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue