common

File common.str
Author unknown
Since unknown

Some primitives for the manipulation of terms.




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



Strategy summary


address Give the address of a term common.str
address-lt Compare the address of two terms and succeeds if the address of the first is smaller than the address of the second common.str
at-depth(Strategy depth, Strategy s) n/a common.str
checksum Give checksum of a term common.str
explode-term Decompose a term into a constructor name and a list of terms common.str
get-appl-arguments Get the arguments of a term application common.str
get-appl-arguments(Strategy s) Get the arguments of a term application, applying s to the individual arguments common.str
get-arguments Get the arguments of a term common.str
get-constructor Get the constructor of a term common.str
mkterm Build a term given a constructor name and a list of terms common.str
node-size n/a common.str
occurrences(Strategy s) n/a common.str
om-occurrences(Strategy s) n/a common.str
term-address-lt(ATerm t2) Compare the address of two terms and succeeds if the address of the current term is smaller than the address of the argument common.str
term-size n/a common.str

Rule summary


crush(Strategy nul, Strategy sum) n/a common.str
crush(Strategy nul, Strategy sum, Strategy s) n/a common.str



Strategy details


ATerm address
File common.str
Author unknown
Since unknown
 

Give the address of a term.

<address> t replaces t with its address (represented as a string).This can be used to obtain a unique symbolic reference to a term.


type t -> String

 
ATerm address-lt
File common.str
Author unknown
Since unknown
 

Compare the address of two terms and succeeds if the address of the first is smaller than the address of the second.

This predicate induces a total ordering on terms and can be used to sort terms. Note that this relation is valid in one session (but what happens afterrehashing), but not necessarily between two sessions.



 
ATerm checksum
File common.str
Author unknown
Since unknown
 

Give checksum of a term. Similar to atsum from aterm package.



 
ATerm explode-term
File common.str
Author unknown
Since unknown
 

Decompose a term into a constructor name and a list of terms.

Note that this primitive strategy has been turned into a language construct.

The pattern f#(xs) denotes the decomposition of a term into its function symbol f and its list of arguments xs. This pattern can be used in matching ?f#(xs) and building !f#(xs) terms (so also in left- and right-hand sides of rules) and also as a congruence s1#(s2).

E.g. <explode-term> f(t1,...,tn) is the inverse of mkterm and produces (f, [t1,...,tn]).

Note that explode-term is equivalent to !(<get-constructor>, <get-arguments>).



 
ATerm get-appl-arguments
File common.str
Author unknown
Since unknown
 

Get the arguments of a term application.



 
ATerm get-appl-arguments(Strategy s)
File common.str
Author unknown
Since unknown
 
Parameters
Strategy s a -> b

Get the arguments of a term application, applying s to the individual arguments.


type f(a1 ... an) -> [b1 ... bn]

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

Get the arguments of a term.

Note that explode-term is equivalent to !(<get-constructor>, <get-arguments>).



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

Get the constructor of a term.

Note that explode-term is equivalent to !(<get-constructor>, <get-arguments>).



 
ATerm mkterm
File common.str
Author unknown
Since unknown
 

Build a term given a constructor name and a list of terms.

Note that this primitive strategy has been turned into a language construct.

The pattern f#(xs) denotes the decomposition of a term into its function symbol f and its list of arguments xs. This pattern can be used in matching ?f#(xs) and building !f#(xs) terms (so also in left- and right-hand sides of rules) and also as a congruence s1#(s2).

E.g. <mkterm> (f, [t1,...,tn]) builds the constructor application f(t1,...,tn).



 
ATerm term-address-lt(ATerm t2)
File common.str
Author unknown
Since unknown
 

Compare the address of two terms and succeeds if the address of the currentterm is smaller than the address of the argument.