Inheritance: IDisposable
Beispiel #1
0
 internal static IntPtr GetNativeObject(Z3Object s)
 {
     if (s == null)
     {
         return(new IntPtr());
     }
     return(s.NativeObject);
 }
Beispiel #2
0
        internal void CheckContextMatch(Z3Object[] arr)
        {
            Contract.Requires(arr == null || Contract.ForAll(arr, a => a != null));

            if (arr != null)
            {
                foreach (Z3Object a in arr)
                {
                    Contract.Assert(a != null); // It was an assume, now we added the precondition, and we made it into an assert
                    CheckContextMatch(a);
                }
            }
        }
Beispiel #3
0
        internal void CheckContextMatch(Z3Object other)
        {
            Contract.Requires(other != null);

            if (!ReferenceEquals(this, other.Context))
                throw new Z3Exception("Context mismatch");
        }
Beispiel #4
0
 internal void CheckContextMatch(Z3Object other1, Z3Object other2, Z3Object other3)
 {
     Contract.Requires(other1 != null);
     Contract.Requires(other2 != null);
     Contract.Requires(other3 != null);
     CheckContextMatch(other1);
     CheckContextMatch(other2);
     CheckContextMatch(other3);
 }
Beispiel #5
0
        /// <summary>
        /// Propagate consequence
        /// </summary>
        public void Propagate(IEnumerable <Expr> terms, Expr conseq)
        {
            var nTerms = Z3Object.ArrayToNative(terms.ToArray());

            Native.Z3_solver_propagate_consequence(ctx.nCtx, this.callback, (uint)nTerms.Length, nTerms, 0u, null, null, conseq.NativeObject);
        }
Beispiel #6
0
 internal static uint ArrayLength(Z3Object[] a)
 {
     return (a == null)?0:(uint)a.Length;
 }
Beispiel #7
0
        internal static IntPtr[] ArrayToNative(Z3Object[] a)
        {
            Contract.Ensures(a == null || Contract.Result<IntPtr[]>() != null);
            Contract.Ensures(a == null || Contract.Result<IntPtr[]>().Length == a.Length);

            if (a == null) return null;
            IntPtr[] an = new IntPtr[a.Length];
            for (uint i = 0; i < a.Length; i++)
                if (a[i] != null) an[i] = a[i].NativeObject;
            return an;
        }
Beispiel #8
0
 internal static IntPtr GetNativeObject(Z3Object s)
 {
     if (s == null) return new IntPtr();
     return s.NativeObject;
 }