common

File common.str
Author unknown
Since unknown
No information available.




Statistics


General
Lines of code 89
Stratego
Module number 1 (100% documented)
Constructor number 0
Overlay number 0
Strategy number 8 (100% documented)
Rule number 0
DynamicRule number 0



Constructor summary


Hashtable(ATerm ) Represents a reference to a hashtable common.str

Strategy summary


change1-no n/a common.str
change1-yes n/a common.str
change2-no n/a common.str
change2-yes n/a common.str
default-no n/a common.str
hashtable-clear Clears the contents of an existing hashtable common.str
hashtable-copy Create a new hashtable and copies the entire contents of the current table into the new one common.str
hashtable-destroy Destroys and deallocates memory consumed by an existing hashtable common.str
hashtable-eq Checks whether two hashtables have equal contents common.str
hashtable-eq(Strategy eq) n/a common.str
hashtable-fold(Strategy s, ATerm t) Apply an iterative fold left (starting with first element) over the keys of a hash table; useful for applying an operation to each key without constructing a list of keys common.str
hashtable-fold-keys(Strategy s, ATerm t) Apply an iterative fold left (starting with first element) over the keys of a hash table; useful for applying an operation to each key without constructing a list of keys common.str
hashtable-fold-values(Strategy s, ATerm t) Apply an iterative fold left (starting with first element) over the values of a hash table; useful for applying an operation to each value without constructing a list of values common.str
hashtable-get(ATerm key) Gets the value for a key common.str
hashtable-getlist Get the contents of a hashtable as a list of key-value tuples common.str
hashtable-init Create a new hashtable and initialize it from a key-value pair list common.str
hashtable-intersect(ATerm tbl2) n/a common.str
hashtable-intersect-symm-wempty(ATerm emptyElt) Intersect hashtables symmetrically with default element common.str
hashtable-intersect-symm-wempty-ignore-left(ATerm emptyElt) Intersect hashtables symmetrically with default element common.str
hashtable-intersect-wempty(ATerm tbl2, ATerm emptyElt) Intersect hashtables with default element common.str
hashtable-keys Get a list containing all keys of a hashtable common.str
hashtable-merge(Strategy symm, Strategy iterate1, Strategy iterate2, Strategy remove, Strategy merge, Strategy default, Strategy lookup1, Strategy lookup2) Version without change arguments for backward compatibility common.str
hashtable-peek(ATerm key) Gets the top value from the stack for key (the stack remains untouched) Current term is the hashtable, output is the top value common.str
hashtable-peekpop(ATerm key) Gets the top value from the stack for key and pops it off the stack common.str
hashtable-pop(ATerm key) Pops off the top element of the stack for key common.str
hashtable-push(ATerm key, ATerm value) Pushes value on top of the stack for key common.str
hashtable-pushlist(ATerm key, ATerm value) Pushes values on top of the stack for key common.str
hashtable-pushunion(ATerm key, ATerm value) Pushes union of values and already present values Current term is the hashtable common.str
hashtable-put(ATerm key, ATerm value) Puts a new key, value pair into the hash table common.str
hashtable-remove(ATerm key) Removes a key (with its associated value) from the hashtable common.str
hashtable-union(ATerm tbl2) n/a common.str
hashtable-union-symm-wempty(ATerm emptyElt) n/a common.str
hashtable-union-wempty(ATerm tbl2, ATerm emptyElt) n/a common.str
hashtable-values Get a list containing all values of a hashtable common.str
iterate1-no n/a common.str
iterate1-yes n/a common.str
iterate2-no n/a common.str
iterate2-yes n/a common.str
lookup-table(ATerm name) Retrieves a named table by looking it up in the table-table common.str
new-hashtable Create a new hashtable with default size and load common.str
new-hashtable(ATerm initial_size, ATerm max_load) Create a new hashtable with specified size and load common.str
remove-no n/a common.str
remove-yes n/a common.str
symmetric-no n/a common.str
symmetric-yes n/a common.str
table-append n/a common.str
table-copy n/a common.str
table-create Creates a table with a given name, which can be any term common.str
table-destroy Destroy a table with a given name, which can be any term common.str
table-diff n/a common.str
table-get Get the value associated with a key from a table common.str
table-getlist Get a list of key-value pairs common.str
table-hashtable Retrieves the primitive table-table as a Hashtable common.str
table-keys Produce a list of keys of a table common.str
table-lookup n/a common.str
table-pop n/a common.str
table-pop-get n/a common.str
table-pop-rm n/a common.str
table-push n/a common.str
table-put Associate a value with a key in a table common.str
table-putlist Put a list of key-value pairs in a table common.str
table-putlist(Strategy s) n/a common.str
table-remove Remove association of a key in a table common.str
table-rename Renames a table, i common.str
table-replace n/a common.str
table-union n/a common.str

Rule summary


hashtable-merge(Strategy symm, Strategy iterate1, Strategy iterate2, Strategy remove, Strategy merge, Strategy default, Strategy change1, Strategy change2, Strategy lookup1, Strategy lookup2) n/a common.str
hashtable-merge-func(Strategy iterate1, Strategy iterate2, Strategy remove, Strategy merge, Strategy default, Strategy lookup1, Strategy lookup2) Merge hashtables creating a new one common.str



Constructor details


Hashtable(ATerm )
File common.str
Author unknown
Since unknown
 

Represents a reference to a hashtable.



 

Strategy details


ATerm hashtable-clear
File common.str
Author unknown
Since unknown
 

Clears the contents of an existing hashtable.


type HashTable(K, V) -> HashTable(K, V)

 
ATerm hashtable-copy
File common.str
Author unknown
Since unknown
 

Create a new hashtable and copies the entire contents of the currenttable into the new one.


type HashTable(K, V) -> HashTable(K,V)

 
ATerm hashtable-destroy
File common.str
Author unknown
Since unknown
 

Destroys and deallocates memory consumed by an existing hashtable.


type HashTable(K, V) -> HashTable(K, V)

 
ATerm hashtable-eq
File common.str
Author unknown
Since unknown
 

Checks whether two hashtables have equal contents.This strategy uses the basic `eq` to compare the elements.


type Tuple(HashTable(K, V), HashTable(K,V)) -> _

 
ATerm hashtable-fold(Strategy s, ATerm t)
File common.str
Author unknown
Since unknown
 
Parameters
Strategy s (k, v) * a -> a
ATerm t a

Apply an iterative fold left (starting with first element) overthe keys of a hash table; useful for applying an operation to eachkey without constructing a list of keys.


type HashTable(k, v) -> a

 
ATerm hashtable-fold-keys(Strategy s, ATerm t)
File common.str
Author unknown
Since unknown
 
Parameters
Strategy s k * a -> a
ATerm t a

Apply an iterative fold left (starting with first element) overthe keys of a hash table; useful for applying an operation to eachkey without constructing a list of keys.


type HashTable(k, v) -> a

 
ATerm hashtable-fold-values(Strategy s, ATerm t)
File common.str
Author unknown
Since unknown
 
Parameters
Strategy s v * a -> a
ATerm t a

Apply an iterative fold left (starting with first element) overthe values of a hash table; useful for applying an operation to eachvalue without constructing a list of values.


type (v * a -> a) * a * HashTable(k, v) -> a

 
ATerm hashtable-get(ATerm key)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm key key

Gets the value for a key. If the key does not exist, this strategyfails.


type HashTable(K, V) -> V

 
ATerm hashtable-getlist
File common.str
Author unknown
Since unknown
 

Get the contents of a hashtable as a list of key-value tuples.


type HashTable(k,v) -> List((k,v), ...)

 
ATerm hashtable-init
File common.str
Author unknown
Since unknown
 

Create a new hashtable and initialize it from a key-value pair list.


type List(Tuple(K, V), ...) -> HashTable(K, V)

 
ATerm hashtable-intersect-symm-wempty(ATerm emptyElt)
File common.str
Author unknown
Since unknown
 

Intersect hashtables symmetrically with default element.

Changes tbl1 and tbl2; fails if no changes are made in tbl1Assumes that both hashtables contains lists as values, and intersectsthe two listvalues for each key.Places a dummy value if key does not exist in one of the tables.



 
ATerm hashtable-intersect-symm-wempty-ignore-left(ATerm emptyElt)
File common.str
Author unknown
Since unknown
 

Intersect hashtables symmetrically with default element.

Changes tbl1 and tbl2; fails if no changes are made in tbl1Assumes that both hashtables contains lists as values, and intersectsthe two listvalues for each key.Places a dummy value if key does not exist in one of the tables.



 
ATerm hashtable-intersect-wempty(ATerm tbl2, ATerm emptyElt)
File common.str
Author unknown
Since unknown
 

Intersect hashtables with default element.

Changes tbl1; fails if no changes are madeAssumes that both hashtables contains lists as values, and intersectsthe two listvalues for each key.Places a dummy value if key does not exist in one of the tables.



 
ATerm hashtable-keys
File common.str
Author unknown
Since unknown
 

Get a list containing all keys of a hashtable.


type HashTable(K, V) -> List(K)

 
ATerm hashtable-merge(Strategy symm, Strategy iterate1, Strategy iterate2, Strategy remove, Strategy merge, Strategy default, Strategy lookup1, Strategy lookup2)
File common.str
Author unknown
Since unknown
 

Version without change arguments for backward compatibility



 
ATerm hashtable-peek(ATerm key)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm key key t - the key used for lookup

Gets the top value from the stack for key (the stack remains untouched)Current term is the hashtable, output is the top value.


type HashTable(K, (V, ...)) -> V

 
ATerm hashtable-peekpop(ATerm key)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm key key t - the key used for lookup

Gets the top value from the stack for key and pops it off the stack.Current term is the hashtable, output is the top value.


type HashTable(K, (V, ...)) -> V

 
ATerm hashtable-pop(ATerm key)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm key key t - the key used for lookup

Pops off the top element of the stack for key.Current term is the hashtable and remains untouched.


type HashTable(K, (V, ...)) -> V

 
ATerm hashtable-push(ATerm key, ATerm value)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm key key t - the key used for lookup
ATerm value value a - the value to insert

Pushes value on top of the stack for key.Current term is the hashtable and remains untouched.


type HashTable(K, V) -> HashTable(K, V)

 
ATerm hashtable-pushlist(ATerm key, ATerm value)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm key key t - the key used for lookup
ATerm value value List(a) - the values to insert

Pushes values on top of the stack for key.Current term is the hashtable and remains untouched.


type HashTable(K, V) -> HashTable(K, V')

 
ATerm hashtable-pushunion(ATerm key, ATerm value)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm key key t - the key used for lookup
ATerm value value List(a) - the values to insert

Pushes union of values and already present values Current term is the hashtable.


type HashTable(K, V) -> HashTable(K, V')

 
ATerm hashtable-put(ATerm key, ATerm value)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm key key - any term can be used as a key
ATerm value value - any term can be used as a value

Puts a new key, value pair into the hash table. If the key isalready bound to a value, the old value will be replaced.


type HashTable(K, V) -> HashTable(K, V)

 
ATerm hashtable-remove(ATerm key)
File common.str
Author unknown
Since unknown
 

Removes a key (with its associated value) from the hashtable. Thisstrategy will succeed even if the key does not exist.


type HashTable(K, V) -> HashTable(K, V)

 
ATerm hashtable-values
File common.str
Author unknown
Since unknown
 

Get a list containing all values of a hashtable


type HashTable(K, V) -> List(V)

 
ATerm lookup-table(ATerm name)
File common.str
Author unknown
Since unknown
 

Retrieves a named table by looking it up in the table-table.



 
ATerm new-hashtable
File common.str
Author unknown
Since unknown
 

Create a new hashtable with default size and load.


type _ -> HashTable(K, V)

 
ATerm new-hashtable(ATerm initial_size, ATerm max_load)
File common.str
Author unknown
Since unknown
 
Parameters
ATerm initial_size initial_size - the initial capacity of the hashtable
ATerm max_load max_load - the load percentage at which the hashtable is expanded

Create a new hashtable with specified size and load.


type _ -> HashTable(K, V)

 
ATerm table-create
File common.str
Author unknown
Since unknown
 

Creates a table with a given name, which can be any term.



 
ATerm table-destroy
File common.str
Author unknown
Since unknown
 

Destroy a table with a given name, which can be any term.



 
ATerm table-get
File common.str
Author unknown
Since unknown
 

Get the value associated with a key from a table.

E.g. <table-get> (t1, key) yields the value associated to key or fails in the t1 table.



 
ATerm table-getlist
File common.str
Author unknown
Since unknown
 

Get a list of key-value pairs.

E.g. <table-getlist>t1 produces the list of (key,value) pairs in the table t1.



 
ATerm table-hashtable
File common.str
Author unknown
Since unknown
 

Retrieves the primitive table-table as a Hashtable



 
ATerm table-keys
File common.str
Author unknown
Since unknown
 

Produce a list of keys of a table.

E.g. <table-keys>t1 produces the list of keys of table t1.



 
ATerm table-put
File common.str
Author unknown
Since unknown
 

Associate a value with a key in a table.

E.g. <table-put> (t1, key, value) associates value with key in the t1 table.



 
ATerm table-putlist
File common.str
Author unknown
Since unknown
 

Put a list of key-value pairs in a table.

E.g. <table-putlist>(name, list) puts the (key,value) pairs in list into table t1.



 
ATerm table-remove
File common.str
Author unknown
Since unknown
 

Remove association of a key in a table.

E.g. <table-remove> (t1, key) removes the entry for key from table t1.



 
ATerm table-rename
File common.str
Author unknown
Since unknown
 

Renames a table, i.e. only the entry in the table-table is renamed,the table contents remain untouched.



 

Rule details


ATerm hashtable-merge-func(Strategy iterate1, Strategy iterate2, Strategy remove, Strategy merge, Strategy default, Strategy lookup1, Strategy lookup2)
File common.str
Author unknown
Since unknown
 

Merge hashtables creating a new one.