[Up] [Contents] [Index] [Summary]

3.25 Set Manipulation

is_set(+Set)
Succeeds if Set is a proper list (see proper_list/1) without duplicates.

list_to_set(+List, -Set)
Succeeds if Set holds the same elements as List in the same order, but has no duplicates. See also sort/2.

intersection(+Set1, +Set2, -Set3)
Succeeds if Set3 unifies with the intersection of Set1 and Set2. Set1 and Set2 are lists without duplicates. They need not be ordered.

subtract(+Set, +Delete, -Result)
Delete all elements of set `Delete' from `Set' and unify the resulting set with `Result'.

union(+Set1, +Set2, -Set3)
Succeeds if Set3 unifies with the union of Set1 and Set2. Set1 and Set2 are lists without duplicates. They need not be ordered.

subset(+Subset, +Set)
Succeeds if all elements of Subset are elements of Set as well.

merge_set(+Set1, +Set2, -Set3)
Set1 and Set2 are lists without duplicates, sorted to the standard order of terms. Set3 is unified with an ordered list without duplicates holding the union of the elements of Set1 and Set2.