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.
|
|
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)
|
|
|