示例#1
0
        internal NativeFuncInterp(NativeContext ctx, NativeModel mdl, Z3_func_decl decl, Z3_func_interp fi)
        {
            Debug.Assert(ctx != null);
            Z3_context nCtx = ctx.nCtx;

            Native.Z3_func_interp_inc_ref(nCtx, fi);

            Declaration = decl;
            Else        = Native.Z3_func_interp_get_else(nCtx, fi);
            uint numEntries = Native.Z3_func_interp_get_num_entries(nCtx, fi);
            uint numArgs    = Native.Z3_func_interp_get_arity(nCtx, fi);

            Entries = new Entry[numEntries];

            for (uint j = 0; j < numEntries; ++j)
            {
                var entry = Native.Z3_func_interp_get_entry(nCtx, fi, j);
                Native.Z3_func_entry_inc_ref(nCtx, entry);
                Entries[j].Arguments = new Z3_ast[numArgs];
                for (uint i = 0; i < numArgs; ++i)
                {
                    Entries[j].Arguments[i] = Native.Z3_func_entry_get_arg(nCtx, entry, i);
                }
                Entries[j].Result = Native.Z3_func_entry_get_value(nCtx, entry);
                Native.Z3_func_entry_dec_ref(nCtx, entry);
            }

            Native.Z3_func_interp_dec_ref(nCtx, fi);
        }
示例#2
0
 public extern static Z3_ast Z3_func_interp_get_else(Z3_context a0, Z3_func_interp a1);
示例#3
0
 public extern static uint Z3_func_interp_get_arity(Z3_context a0, Z3_func_interp a1);
示例#4
0
 public extern static Z3_func_entry Z3_func_interp_get_entry(Z3_context a0, Z3_func_interp a1, uint a2);
示例#5
0
 public extern static uint Z3_func_interp_get_num_entries(Z3_context a0, Z3_func_interp a1);
示例#6
0
 public extern static void Z3_func_interp_dec_ref(Z3_context a0, Z3_func_interp a1);
示例#7
0
 public static uint Z3_func_interp_get_arity(Z3_context a0, Z3_func_interp a1) {
     uint r = LIB.Z3_func_interp_get_arity(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 r;
 }
示例#8
0
 public static void Z3_func_interp_dec_ref(Z3_context a0, Z3_func_interp a1) {
     LIB.Z3_func_interp_dec_ref(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)));
 }