Z3
 
Loading...
Searching...
No Matches
Public Member Functions | Properties
ASTMap Class Reference

Map from AST to AST. More...

+ Inheritance diagram for ASTMap:

Public Member Functions

bool Contains (AST k)
 Checks whether the map contains the key k .
 
AST Find (AST k)
 Finds the value associated with the key k .
 
void Insert (AST k, AST v)
 Stores or replaces a new key/value pair in the map.
 
void Erase (AST k)
 Erases the key k from the map.
 
void Reset ()
 Removes all keys from the map.
 
override string ToString ()
 Retrieves a string representation of the map.
 
- Public Member Functions inherited from Z3Object
void Dispose ()
 Disposes of the underlying native Z3 object.
 

Properties

uint Size [get]
 The size of the map.
 
AST[] Keys [get]
 The keys stored in the map.
 
- Properties inherited from Z3Object
Context Context [get]
 Access Context object.
 

Detailed Description

Map from AST to AST.

Definition at line 28 of file ASTMap.cs.

Member Function Documentation

◆ Contains()

bool Contains ( AST  k)
inline

Checks whether the map contains the key k .

Parameters
kAn AST
Returns
True if k is a key in the map, false otherwise.

Definition at line 35 of file ASTMap.cs.

36 {
37 Debug.Assert(k != null);
38
39 return 0 != Native.Z3_ast_map_contains(Context.nCtx, NativeObject, k.NativeObject);
40 }
Context Context
Access Context object.
Definition Z3Object.cs:111

◆ Erase()

void Erase ( AST  k)
inline

Erases the key k from the map.

Parameters
kAn AST

Definition at line 73 of file ASTMap.cs.

74 {
75 Debug.Assert(k != null);
76
77 Native.Z3_ast_map_erase(Context.nCtx, NativeObject, k.NativeObject);
78 }

◆ Find()

AST Find ( AST  k)
inline

Finds the value associated with the key k .

This function signs an error when k is not a key in the map.

Parameters
kAn AST


Definition at line 49 of file ASTMap.cs.

50 {
51 Debug.Assert(k != null);
52
53 return new AST(Context, Native.Z3_ast_map_find(Context.nCtx, NativeObject, k.NativeObject));
54 }

◆ Insert()

void Insert ( AST  k,
AST  v 
)
inline

Stores or replaces a new key/value pair in the map.

Parameters
kThe key AST
vThe value AST

Definition at line 61 of file ASTMap.cs.

62 {
63 Debug.Assert(k != null);
64 Debug.Assert(v != null);
65
66 Native.Z3_ast_map_insert(Context.nCtx, NativeObject, k.NativeObject, v.NativeObject);
67 }

◆ Reset()

void Reset ( )
inline

Removes all keys from the map.

Definition at line 83 of file ASTMap.cs.

84 {
85 Native.Z3_ast_map_reset(Context.nCtx, NativeObject);
86 }

◆ ToString()

override string ToString ( )
inline

Retrieves a string representation of the map.


Definition at line 111 of file ASTMap.cs.

112 {
113 return Native.Z3_ast_map_to_string(Context.nCtx, NativeObject);
114 }

Property Documentation

◆ Keys

AST [] Keys
get

The keys stored in the map.

Definition at line 99 of file ASTMap.cs.

100 {
101 get
102 {
103 using ASTVector res = new ASTVector(Context, Native.Z3_ast_map_keys(Context.nCtx, NativeObject));
104 return res.ToArray();
105 }
106 }

◆ Size

uint Size
get

The size of the map.

Definition at line 91 of file ASTMap.cs.

92 {
93 get { return Native.Z3_ast_map_size(Context.nCtx, NativeObject); }
94 }