mirror of
https://github.com/Z3Prover/z3
synced 2026-02-20 07:24:40 +00:00
remove dependencies on contracts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
12fc670839
commit
3d37060fa9
72 changed files with 734 additions and 1232 deletions
|
|
@ -18,14 +18,15 @@ Notes:
|
|||
--*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace Microsoft.Z3
|
||||
{
|
||||
/// <summary>
|
||||
/// Function declarations.
|
||||
/// </summary>
|
||||
[ContractVerification(true)]
|
||||
public class FuncDecl : AST
|
||||
{
|
||||
/// <summary>
|
||||
|
|
@ -108,7 +109,6 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get
|
||||
{
|
||||
Contract.Ensures(Contract.Result<Sort[]>() != null);
|
||||
|
||||
uint n = DomainSize;
|
||||
|
||||
|
|
@ -126,7 +126,6 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get
|
||||
{
|
||||
Contract.Ensures(Contract.Result<Sort>() != null);
|
||||
return Sort.Create(Context, Native.Z3_get_range(Context.nCtx, NativeObject));
|
||||
}
|
||||
}
|
||||
|
|
@ -146,7 +145,6 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get
|
||||
{
|
||||
Contract.Ensures(Contract.Result<Symbol>() != null);
|
||||
return Symbol.Create(Context, Native.Z3_get_decl_name(Context.nCtx, NativeObject));
|
||||
}
|
||||
}
|
||||
|
|
@ -166,7 +164,6 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get
|
||||
{
|
||||
Contract.Ensures(Contract.Result<Parameter[]>() != null);
|
||||
|
||||
uint num = NumParameters;
|
||||
Parameter[] res = new Parameter[num];
|
||||
|
|
@ -287,22 +284,22 @@ namespace Microsoft.Z3
|
|||
internal FuncDecl(Context ctx, IntPtr obj)
|
||||
: base(ctx, obj)
|
||||
{
|
||||
Contract.Requires(ctx != null);
|
||||
Debug.Assert(ctx != null);
|
||||
}
|
||||
|
||||
internal FuncDecl(Context ctx, Symbol name, Sort[] domain, Sort range)
|
||||
: base(ctx, Native.Z3_mk_func_decl(ctx.nCtx, name.NativeObject, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject))
|
||||
{
|
||||
Contract.Requires(ctx != null);
|
||||
Contract.Requires(name != null);
|
||||
Contract.Requires(range != null);
|
||||
Debug.Assert(ctx != null);
|
||||
Debug.Assert(name != null);
|
||||
Debug.Assert(range != null);
|
||||
}
|
||||
|
||||
internal FuncDecl(Context ctx, string prefix, Sort[] domain, Sort range)
|
||||
: base(ctx, Native.Z3_mk_fresh_func_decl(ctx.nCtx, prefix, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject))
|
||||
{
|
||||
Contract.Requires(ctx != null);
|
||||
Contract.Requires(range != null);
|
||||
Debug.Assert(ctx != null);
|
||||
Debug.Assert(range != null);
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
|
|
@ -335,7 +332,7 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get
|
||||
{
|
||||
Contract.Requires(args == null || Contract.ForAll(args, a => a != null));
|
||||
Debug.Assert(args == null || args.All(a => a != null));
|
||||
|
||||
return Apply(args);
|
||||
}
|
||||
|
|
@ -348,7 +345,7 @@ namespace Microsoft.Z3
|
|||
/// <returns></returns>
|
||||
public Expr Apply(params Expr[] args)
|
||||
{
|
||||
Contract.Requires(args == null || Contract.ForAll(args, a => a != null));
|
||||
Debug.Assert(args == null || args.All(a => a != null));
|
||||
|
||||
Context.CheckContextMatch<Expr>(args);
|
||||
return Expr.Create(Context, this, args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue