コード例 #1
0
        /// <summary>
        /// Signed remainder.
        /// </summary>
        /// <remarks>
        /// It is defined as <c>t1 - (t1 /s t2) * t2</c>, where <c>/s</c> represents signed division.
        /// The most significant bit (sign) of the result is equal to the most significant bit of \c t1.
        ///
        /// If <c>t2</c> is zero, then the result is undefined.
        /// The arguments must have the same bit-vector sort.
        /// </remarks>
        public Z3_ast_vector MkBvSrem(Z3_ast_vector t1, Z3_ast_vector t2)
        {
            Debug.Assert(t1 != IntPtr.Zero);
            Debug.Assert(t2 != IntPtr.Zero);

            return(Native.Z3_mk_bvsrem(nCtx, t1, t2));
        }
コード例 #2
0
        /// <summary>
        /// Bitwise XOR.
        /// </summary>
        /// <remarks>The arguments must have a bit-vector sort.</remarks>
        public Z3_ast_vector MkBvXor(Z3_ast_vector t1, Z3_ast_vector t2)
        {
            Debug.Assert(t1 != null);
            Debug.Assert(t2 != IntPtr.Zero);

            return(Native.Z3_mk_bvxor(nCtx, t1, t2));
        }
コード例 #3
0
        /// <summary>
        /// Utility to convert a vector object of ast to a .Net array
        /// </summary>
        /// <param name="vec"></param>
        /// <returns></returns>
        public Z3_ast[] ToArray(Z3_ast_vector vec)
        {
            Native.Z3_ast_vector_inc_ref(nCtx, vec);
            var sz     = Native.Z3_ast_vector_size(nCtx, vec);
            var result = new Z3_ast[sz];

            for (uint i = 0; i < sz; ++i)
            {
                result[i] = Native.Z3_ast_vector_get(nCtx, vec, i);
            }
            Native.Z3_ast_vector_dec_ref(nCtx, vec);
            return(result);
        }
コード例 #4
0
        /// <summary>
        /// Bit-vector zero extension.
        /// </summary>
        /// <remarks>
        /// Extend the given bit-vector with zeros to the (unsigned) equivalent
        /// bitvector of size <c>m+i</c>, where \c m is the size of the
        /// given bit-vector.
        /// The argument <paramref name="t"/> must have a bit-vector sort.
        /// </remarks>
        public Z3_ast_vector MkBvZeroExt(uint i, Z3_ast_vector t)
        {
            Debug.Assert(t != IntPtr.Zero);

            return(Native.Z3_mk_zero_ext(nCtx, i, t));
        }
コード例 #5
0
        /// <summary>
        /// Bit-vector extraction.
        /// </summary>
        /// <remarks>
        /// Extract the bits <paramref name="high"/> down to <paramref name="low"/> from a bitvector of
        /// size <c>m</c> to yield a new bitvector of size <c>n</c>, where
        /// <c>n = high - low + 1</c>.
        /// The argument <paramref name="t"/> must have a bit-vector sort.
        /// </remarks>
        public Z3_ast_vector MkBvExtract(uint high, uint low, Z3_ast_vector t)
        {
            Debug.Assert(t != IntPtr.Zero);

            return(Native.Z3_mk_extract(nCtx, high, low, t));
        }
コード例 #6
0
        /// <summary>
        /// Standard two's complement unary minus.
        /// </summary>
        /// <remarks>The arguments must have a bit-vector sort.</remarks>
        public Z3_ast_vector MkBVNeg(Z3_ast_vector t)
        {
            Debug.Assert(t != IntPtr.Zero);

            return(Native.Z3_mk_bvneg(nCtx, t));
        }
コード例 #7
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public static string Z3_ast_vector_to_string(Z3_context a0, Z3_ast_vector a1) {
     IntPtr r = LIB.Z3_ast_vector_to_string(a0, a1);
     Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0);
     if (err != Z3_error_code.Z3_OK)
         throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err)));
     return Marshal.PtrToStringAnsi(r);
 }
コード例 #8
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public static Z3_ast_vector Z3_ast_vector_translate(Z3_context a0, Z3_ast_vector a1, Z3_context a2) {
     Z3_ast_vector r = LIB.Z3_ast_vector_translate(a0, a1, a2);
     Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0);
     if (err != Z3_error_code.Z3_OK)
         throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err)));
     return r;
 }
コード例 #9
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public extern static uint Z3_ast_vector_size(Z3_context a0, Z3_ast_vector a1);
コード例 #10
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public extern static IntPtr Z3_ast_vector_to_string(Z3_context a0, Z3_ast_vector a1);
コード例 #11
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public extern static Z3_ast_vector Z3_ast_vector_translate(Z3_context a0, Z3_ast_vector a1, Z3_context a2);
コード例 #12
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public extern static void Z3_ast_vector_push(Z3_context a0, Z3_ast_vector a1, Z3_ast a2);
コード例 #13
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public extern static void Z3_ast_vector_resize(Z3_context a0, Z3_ast_vector a1, uint a2);
コード例 #14
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public extern static void Z3_ast_vector_set(Z3_context a0, Z3_ast_vector a1, uint a2, Z3_ast a3);
コード例 #15
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public extern static Z3_ast Z3_ast_vector_get(Z3_context a0, Z3_ast_vector a1, uint a2);
コード例 #16
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public static void Z3_ast_vector_push(Z3_context a0, Z3_ast_vector a1, Z3_ast a2) {
     LIB.Z3_ast_vector_push(a0, a1, a2);
     Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0);
     if (err != Z3_error_code.Z3_OK)
         throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err)));
 }
コード例 #17
0
ファイル: Native.cs プロジェクト: killbug2004/Snippets
 public extern static void Z3_ast_vector_dec_ref(Z3_context a0, Z3_ast_vector a1);