-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathASTMap.java
More file actions
124 lines (108 loc) · 3.06 KB
/
ASTMap.java
File metadata and controls
124 lines (108 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
* This file was automatically generated from ASTMap.cs
* w/ further modifications by:
* @author Christoph M. Wintersteiger (cwinter)
**/
package com.microsoft.z3;
/**
* Map from AST to AST
**/
class ASTMap extends Z3Object
{
/**
* Checks whether the map contains the key <paramref name="k"/>. <param
* name="k">An AST</param>
*
* @return True if <paramref name="k"/> is a key in the map, false
* otherwise.
**/
public boolean contains(AST k) throws Z3Exception
{
return Native.astMapContains(getContext().nCtx(), getNativeObject(),
k.getNativeObject());
}
/**
* Finds the value associated with the key <paramref name="k"/>. <remarks>
* This function signs an error when <paramref name="k"/> is not a key in
* the map. </remarks> <param name="k">An AST</param>
*
* @throws Z3Exception
**/
public AST find(AST k) throws Z3Exception
{
return new AST(getContext(), Native.astMapFind(getContext().nCtx(),
getNativeObject(), k.getNativeObject()));
}
/**
* Stores or replaces a new key/value pair in the map. <param name="k">The
* key AST</param> <param name="v">The value AST</param>
**/
public void insert(AST k, AST v) throws Z3Exception
{
Native.astMapInsert(getContext().nCtx(), getNativeObject(), k.getNativeObject(),
v.getNativeObject());
}
/**
* Erases the key <paramref name="k"/> from the map. <param name="k">An
* AST</param>
**/
public void erase(AST k) throws Z3Exception
{
Native.astMapErase(getContext().nCtx(), getNativeObject(), k.getNativeObject());
}
/**
* Removes all keys from the map.
**/
public void reset() throws Z3Exception
{
Native.astMapReset(getContext().nCtx(), getNativeObject());
}
/**
* The size of the map
**/
public int size() throws Z3Exception
{
return Native.astMapSize(getContext().nCtx(), getNativeObject());
}
/**
* The keys stored in the map.
*
* @throws Z3Exception
**/
public ASTVector getKeys() throws Z3Exception
{
return new ASTVector(getContext(), Native.astMapKeys(getContext().nCtx(),
getNativeObject()));
}
/**
* Retrieves a string representation of the map.
**/
public String toString()
{
try
{
return Native.astMapToString(getContext().nCtx(), getNativeObject());
} catch (Z3Exception e)
{
return "Z3Exception: " + e.getMessage();
}
}
ASTMap(Context ctx, long obj) throws Z3Exception
{
super(ctx, obj);
}
ASTMap(Context ctx) throws Z3Exception
{
super(ctx, Native.mkAstMap(ctx.nCtx()));
}
void incRef(long o) throws Z3Exception
{
getContext().astmap_DRQ().incAndClear(getContext(), o);
super.incRef(o);
}
void decRef(long o) throws Z3Exception
{
getContext().astmap_DRQ().add(o);
super.decRef(o);
}
}