20using System.Diagnostics;
28 internal class ASTMap : Z3Object
37 Debug.Assert(k !=
null);
39 return 0 != Native.Z3_ast_map_contains(Context.nCtx, NativeObject, k.NativeObject);
49 public AST Find(AST k)
51 Debug.Assert(k !=
null);
53 return new AST(Context, Native.Z3_ast_map_find(Context.nCtx, NativeObject, k.NativeObject));
61 public void Insert(AST k, AST v)
63 Debug.Assert(k !=
null);
64 Debug.Assert(v !=
null);
66 Native.Z3_ast_map_insert(Context.nCtx, NativeObject, k.NativeObject, v.NativeObject);
73 public void Erase(AST k)
75 Debug.Assert(k !=
null);
77 Native.Z3_ast_map_erase(Context.nCtx, NativeObject, k.NativeObject);
85 Native.Z3_ast_map_reset(Context.nCtx, NativeObject);
93 get {
return Native.Z3_ast_map_size(Context.nCtx, NativeObject); }
103 ASTVector res =
new ASTVector(Context, Native.Z3_ast_map_keys(Context.nCtx, NativeObject));
104 return res.ToArray();
111 public override string ToString()
113 return Native.Z3_ast_map_to_string(Context.nCtx, NativeObject);
117 internal ASTMap(Context ctx, IntPtr obj)
120 Debug.Assert(ctx !=
null);
122 internal ASTMap(Context ctx)
125 Debug.Assert(ctx !=
null);
128 internal class DecRefQueue : IDecRefQueue
130 public DecRefQueue() : base() { }
131 public DecRefQueue(uint move_limit) : base(move_limit) { }
132 internal override void IncRef(Context ctx, IntPtr obj)
134 Native.Z3_ast_map_inc_ref(ctx.nCtx, obj);
137 internal override void DecRef(Context ctx, IntPtr obj)
139 Native.Z3_ast_map_dec_ref(ctx.nCtx, obj);
143 internal override void IncRef(IntPtr o)
149 internal override void DecRef(IntPtr o)
IDecRefQueue ASTMap_DRQ
ASTMap DRQ
Z3_ast_map Z3_API Z3_mk_ast_map(Z3_context c)
Return an empty mapping from AST to AST.