set

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




Statistics


General
Lines of code 276
Stratego
Module number 1 (0% documented)
Constructor number 0
Overlay number 0
Strategy number 16 (87% documented)
Rule number 5 (80% documented)
DynamicRule number 0



Strategy summary


diff Computes the difference between two sets set.str
isect Take the intersection of two sets set.str
make-set Removes duplicate elements from a list set.str
nub Removes duplicate elements from a list set.str
set-eq Check equality of two list sets set.str
set-eq(Strategy eq) Check equality of two list sets set.str
subset Succeeds if the first set is a strict subset of the second set.str
subset(Strategy eq) Succeeds if the first set is a strict subset of the second set.str
subset-gen(Strategy eq, Strategy rest) n/a set.str
subseteq Succeeds if the first set is a (non-strict) subset of the second set.str
subseteq(Strategy eq) Succeeds if the first set is a (non-strict) subset of the second set.str
sym-diff Takes the symmetric difference of two sets set.str
sym-diff(Strategy eq) Takes the symmetric difference of two sets set.str
union Union: Concatenation of two lists, only those elements in the first list are added that are not already in the second list set.str
unions Takes the union of a list of sets set.str
unions(Strategy eq) n/a set.str

Rule summary


diff(Strategy eq) Computes the difference between two sets set.str
isect(Strategy eq) Take the intersection of two sets set.str
union(Strategy eq) n/a set.str



Strategy details


ATerm diff
File set.str
Author unknown
Since unknown
 

Computes the difference between two sets. That is, itreturns the elements found in the first set, but not inthe second.


type (List(a), List(a)) -> List(a)

 
ATerm isect
File set.str
Author unknown
Since unknown
 

Take the intersection of two sets. That is, it returnsall elements found in both sets.

Example: <isect> ([1,2,3],[5,1,2,6]) => [1,2]


type List(a) * List(a) -> List(a)

 
ATerm make-set
File set.str
Author unknown
Since unknown
 

Removes duplicate elements from a list. This effectivelyconverts a list to a set.


type List(a) -> List(a)

 
ATerm nub
File set.str
Author unknown
Since 0.9.4
 

Removes duplicate elements from a list. This effectivelyconverts a list to a set.


type List(a) -> List(a)
note nub is an alias of make-set.

 
ATerm set-eq
File set.str
Author unknown
Since unknown
 

Check equality of two list sets.

This strategy uses the basic `eq` to compare the elements.



 
ATerm set-eq(Strategy eq)
File set.str
Author unknown
Since unknown
 
Parameters
Strategy eq test strategy that will compare two elements upon their equality.

Check equality of two list sets.

The input remains untouched, set-eq just succeeds or fails.



 
ATerm subset
File set.str
Author unknown
Since unknown
 

Succeeds if the first set is a strict subset of the second.

Example: <subset> ([1,2],[1,2,3])


type List(a) * List(a) -> _

 
ATerm subset(Strategy eq)
File set.str
Author unknown
Since unknown
 
Parameters
Strategy eq Equality operator to be used on elements on the set.

Succeeds if the first set is a strict subset of the second. The strategy parameter is the equality operator that will be usedto check if two elements are equal.


type List(a) -> List(a) -> _

 
ATerm subseteq
File set.str
Author unknown
Since unknown
 

Succeeds if the first set is a (non-strict) subset of the second.

Example: <subseteq> ([1,2],[1,2])


type List(a) * List(a) -> _

 
ATerm subseteq(Strategy eq)
File set.str
Author unknown
Since unknown
 

Succeeds if the first set is a (non-strict) subset of the second.The strategy parameter is the equality operator that will be usedto check if two elements are equal.

Example: <subseteq> ([1,2],[1,2])


type List(a) * List(a) -> _

 
ATerm sym-diff
File set.str
Author unknown
Since unknown
 

Takes the symmetric difference of two sets. That is, it returnsall elements not found in both sets.

Example: <sym-diff> ([1,2,3],[5,1,2,6]) => [3,5,6]


type (List(a), List(a)) -> List(a)

 
ATerm sym-diff(Strategy eq)
File set.str
Author unknown
Since unknown
 
Parameters
Strategy eq Equality operator to use on the elements. If it succeeds, the elements are equal.

Takes the symmetric difference of two sets. That is, it returnsall elements not found in both sets. the strategy argument isused to compare elements of the sets.

Example: <sym-diff(eq)> ([1,2,3],[5,1,2,6]) => [3,5,6]


type (List(a), List(a)) -> List(a)

 
ATerm union
File set.str
Author unknown
Since unknown
 

Union: Concatenation of two lists, only those elements in thefirst list are added that are not already in the second list.


type List(a) * List(a) -> List(a)

 
ATerm unions
File set.str
Author unknown
Since unknown
 

Takes the union of a list of sets. All the sets aresets are flattened into one list, and all duplicatesare removed, to obtain a new set.

Example: <unions> [[1,2,3],[3,4,5],[5,6,7]] => [1,2,3,4,5,6,7]


type List(List(a)) -> List(a)

 

Rule details


ATerm diff(Strategy eq)
File set.str
Author unknown
Since unknown
 
Parameters
Strategy eq Used to compare the elements. If an application succeeds, then two elements are equal.

Computes the difference between two sets. That is, the elementsfound in the first set, but not in the second. The strategy argument is used to compare elements of the sets.

Example: <diff(eq)> ([1,2,3], [5,1,2]) => [3]


type (List(a), List(a)) -> List(a)

 
ATerm isect(Strategy eq)
File set.str
Author unknown
Since unknown
 

Take the intersection of two sets.

The result is the first list, without the elementsthat are not in the second list. If the first list is nota set (it has duplicates), the result willhave duplicates. Note that because of this <isect> (l1, l2) is not always equal to <isect> (l2, l1).


type eq a * a ->? _
type [a] * [a] -> [a]