/// <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)); }
/// <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)); }
/// <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); }
/// <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)); }
/// <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)); }
/// <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)); }
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); }
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; }
public extern static uint Z3_ast_vector_size(Z3_context a0, Z3_ast_vector a1);
public extern static IntPtr Z3_ast_vector_to_string(Z3_context a0, Z3_ast_vector a1);
public extern static Z3_ast_vector Z3_ast_vector_translate(Z3_context a0, Z3_ast_vector a1, Z3_context a2);
public extern static void Z3_ast_vector_push(Z3_context a0, Z3_ast_vector a1, Z3_ast a2);
public extern static void Z3_ast_vector_resize(Z3_context a0, Z3_ast_vector a1, uint a2);
public extern static void Z3_ast_vector_set(Z3_context a0, Z3_ast_vector a1, uint a2, Z3_ast a3);
public extern static Z3_ast Z3_ast_vector_get(Z3_context a0, Z3_ast_vector a1, uint a2);
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))); }
public extern static void Z3_ast_vector_dec_ref(Z3_context a0, Z3_ast_vector a1);