Z3
Data Structures | 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 . More...
 
AST Find (AST k)
 Finds the value associated with the key k . More...
 
void Insert (AST k, AST v)
 Stores or replaces a new key/value pair in the map. More...
 
void Erase (AST k)
 Erases the key k from the map. More...
 
void Reset ()
 Removes all keys from the map. More...
 
override string ToString ()
 Retrieves a string representation of the map. More...
 
- Public Member Functions inherited from Z3Object
void Dispose ()
 Disposes of the underlying native Z3 object. More...
 

Properties

uint Size [get]
 The size of the map More...
 
AST [] Keys [get]
 The keys stored in the map. More...
 

Detailed Description

Map from AST to AST

Definition at line 29 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 36 of file ASTMap.cs.

37  {
38  Contract.Requires(k != null);
39 
40  return Native.Z3_ast_map_contains(Context.nCtx, NativeObject, k.NativeObject) != 0;
41  }

◆ Erase()

void Erase ( AST  k)
inline

Erases the key k from the map.

Parameters
kAn AST

Definition at line 75 of file ASTMap.cs.

76  {
77  Contract.Requires(k != null);
78 
79  Native.Z3_ast_map_erase(Context.nCtx, NativeObject, k.NativeObject);
80  }

◆ 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 50 of file ASTMap.cs.

51  {
52  Contract.Requires(k != null);
53  Contract.Ensures(Contract.Result<AST>() != null);
54 
55  return new AST(Context, Native.Z3_ast_map_find(Context.nCtx, NativeObject, k.NativeObject));
56  }

◆ 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 63 of file ASTMap.cs.

64  {
65  Contract.Requires(k != null);
66  Contract.Requires(v != null);
67 
68  Native.Z3_ast_map_insert(Context.nCtx, NativeObject, k.NativeObject, v.NativeObject);
69  }

◆ Reset()

void Reset ( )
inline

Removes all keys from the map.

Definition at line 85 of file ASTMap.cs.

86  {
87  Native.Z3_ast_map_reset(Context.nCtx, NativeObject);
88  }

◆ ToString()

override string ToString ( )
inline

Retrieves a string representation of the map.

Definition at line 113 of file ASTMap.cs.

114  {
115  return Native.Z3_ast_map_to_string(Context.nCtx, NativeObject);
116  }

Property Documentation

◆ Keys

AST [] Keys
get

The keys stored in the map.

Definition at line 102 of file ASTMap.cs.

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

◆ Size

uint Size
get

The size of the map

Definition at line 94 of file ASTMap.cs.

94  {
95  get { return Native.Z3_ast_map_size(Context.nCtx, NativeObject); }
96  }