3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

resolve conflicts

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-06-02 10:38:37 -07:00
commit 19d4b0a97a
27 changed files with 197 additions and 134 deletions

View file

@ -797,6 +797,22 @@ namespace Microsoft.Z3
public bool IsLabelLit { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_LABEL_LIT; } }
#endregion
#region Sequences and Strings
/// <summary>
/// Check whether expression is a string constant.
/// </summary>
/// <returns>a Boolean</returns>
public bool IsString { get { return IsApp && 0 != Native.Z3_is_string(Context.nCtx, NativeObject); } }
/// <summary>
/// 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); } }
#endregion
#region Proof Terms
/// <summary>
/// Indicates whether the term is a binary equivalence modulo namings.

View file

@ -19,6 +19,7 @@ Notes:
using System;
using System.Diagnostics.Contracts;
using System.Collections.Generic;
namespace Microsoft.Z3
{
@ -131,6 +132,24 @@ namespace Microsoft.Z3
}
}
/// <summary>
/// Enumerate constants in model.
/// </summary>
public IEnumerable<KeyValuePair<FuncDecl, Expr>> Consts
{
get
{
uint nc = NumConsts;
for (uint i = 0; i < nc; ++i)
{
var f = new FuncDecl(Context, Native.Z3_model_get_const_decl(Context.nCtx, NativeObject, i));
IntPtr n = Native.Z3_model_get_const_interp(Context.nCtx, NativeObject, f.NativeObject);
if (n == IntPtr.Zero) continue;
yield return new KeyValuePair<FuncDecl, Expr>(f, Expr.Create(Context, n));
}
}
}
/// <summary>
/// The number of function interpretations in the model.
/// </summary>