Purity: A Horn Clause Only library for Prolog
To use, import the following module
Set is the empty set for Domain.
list_set(Domain, List, Set).
Set is a set of unique and sorted elements of List. List elements must all be in Domain.
List is the data for Set as a list.
subset(SubSet, Set, Truth).
Truth is true if all elements in SubSet are also in Set. Truth is false if any elements in SubSet are not in Set.
punion(Set1, Set2, ResultSet).
ResultSet is the union of Set1 and Set2.
pintersection(Set1, Set2, ResultSet).
ResultSet is the intersection of Set1 and Set2.
This means that all elements
pdifference(Set1, Set2, ResultSet).
ResultSet containst elements in Set1 that don't exist in Set2.