## setx.api
#
# Same as
src/lib/src/set.api# except with Key(X) replacing Key (etc).
# Compiled by:
#
src/lib/std/standard.lib# Compare to:
#
src/lib/src/set.api#
src/lib/src/map.api#
src/lib/src/numbered-list.api#
src/lib/src/tagged-numbered-list.api#
src/lib/src/numbered-list.api#
src/lib/src/map-with-implicit-keys.api# This api is implemented in:
#
src/lib/src/red-black-setx-g.pkg# Api for a set of values with an order relation.
api Setx {
#
package key: Keyx; # Keyx is from
src/lib/src/keyx.api Item(X) = key::Key(X);
Set(X);
empty: Set(X); # The empty set.
singleton: Item(X) -> Set(X); # Create a singleton set.
add: (Set(X), Item(X)) -> Set(X);
add' : ((Item(X), Set(X))) -> Set(X); # Insert an item.
add_list: (Set(X), List( Item(X) )) -> Set(X); # Insert items from list.
drop: (Set(X), Item(X)) -> Set(X); # Remove an item. No-op if not found.
member: (Set(X), Item(X)) -> Bool; # Return TRUE if and only if item is an element in the set.
is_empty: Set(X) -> Bool; # Return TRUE if and only if the set is empty.
equal: (Set(X), Set(X)) -> Bool; # Return TRUE if and only if the two sets are equal.
compare: (Set(X), Set(X)) -> Order; # Does a lexical comparison of two sets.
is_subset: (Set(X), Set(X)) -> Bool; # Return TRUE if and only if the first set is a subset of the second.
vals_count: Set(X) -> Int; # Return the number of items in the table.
vals_list: Set(X) -> List( Item(X) ); # Return an ordered list of the items in the set.
union: (Set(X), Set(X)) -> Set(X); # Union.
intersection: (Set(X), Set(X)) -> Set(X); # Intersection.
difference: (Set(X), Set(X)) -> Set(X); # Difference.
map: (Item(X) -> Item(X)) -> Set(X) -> Set(X); # Create a new set by applying a map function to the elements of the set.
apply: (Item(X) -> Void) -> Set(X) -> Void; # Apply a function to the entries of the set in increasing order.
fold_forward: ((Item(X), Y) -> Y) -> Y -> Set(X) -> Y; # Apply a folding function to the entries of the set in increasing order.
fold_backward: ((Item(X), Y) -> Y) -> Y -> Set(X) -> Y; # Apply a folding function to the entries of the set in decreasing order.
partition: (Item(X) -> Bool) -> Set(X) -> (Set(X), Set(X));
filter: (Item(X) -> Bool) -> Set(X) -> Set(X);
exists: (Item(X) -> Bool) -> Set(X) -> Bool;
find: (Item(X) -> Bool) -> Set(X) -> Null_Or(Item(X));
all_invariants_hold: Set(X) -> Bool;
};
## COPYRIGHT (c) 1993 by AT&T Bell Laboratories. See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.