## setxy.api
#
# Same as
src/lib/src/set.api# except with Key(X,Y) replacing Key (etc).
# Compiled by:
#
src/lib/std/standard.lib# Compare to:
#
src/lib/src/set.api#
src/lib/src/setx.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-setxy-g.pkg# Api for a set of values with an order relation.
api Setxy {
#
package key: Keyxy; # Keyxy is from
src/lib/src/keyxy.api Item(X,Y) = key::Key(X,Y);
Set(X,Y);
empty: Set(X,Y); # The empty set.
singleton: Item(X,Y) -> Set(X,Y); # Create a singleton set.
add: (Set(X,Y), Item(X,Y)) -> Set(X,Y);
add' : ((Item(X,Y), Set(X,Y))) -> Set(X,Y); # Insert an item.
add_list: (Set(X,Y), List( Item(X,Y) )) -> Set(X,Y); # Insert items from list.
drop: (Set(X,Y), Item(X,Y)) -> Set(X,Y); # Remove an item. No-op if not found.
member: (Set(X,Y), Item(X,Y)) -> Bool; # Return TRUE if and only if item is an element in the set.
is_empty: Set(X,Y) -> Bool; # Return TRUE if and only if the set is empty.
equal: (Set(X,Y), Set(X,Y)) -> Bool; # Return TRUE if and only if the two sets are equal.
compare: (Set(X,Y), Set(X,Y)) -> Order; # Does a lexical comparison of two sets.
is_subset: (Set(X,Y), Set(X,Y)) -> Bool; # Return TRUE if and only if the first set is a subset of the second.
vals_count: Set(X,Y) -> Int; # Return the number of items in the table.
vals_list: Set(X,Y) -> List( Item(X,Y) ); # Return an ordered list of the items in the set.
union: (Set(X,Y), Set(X,Y)) -> Set(X,Y); # Union.
intersection: (Set(X,Y), Set(X,Y)) -> Set(X,Y); # Intersection.
difference: (Set(X,Y), Set(X,Y)) -> Set(X,Y); # Difference.
map: (Item(X,Y) -> Item(X,Y)) -> Set(X,Y) -> Set(X,Y); # Create a new set by applying a map function to the elements of the set.
apply: (Item(X,Y) -> Void) -> Set(X,Y) -> Void; # Apply a function to the entries of the set in increasing order.
fold_forward: ((Item(X,Y), Y) -> Y) -> Y -> Set(X,Y) -> Y; # Apply a folding function to the entries of the set in increasing order.
fold_backward: ((Item(X,Y), Y) -> Y) -> Y -> Set(X,Y) -> Y; # Apply a folding function to the entries of the set in decreasing order.
partition: (Item(X,Y) -> Bool) -> Set(X,Y) -> (Set(X,Y), Set(X,Y));
filter: (Item(X,Y) -> Bool) -> Set(X,Y) -> Set(X,Y);
exists: (Item(X,Y) -> Bool) -> Set(X,Y) -> Bool;
find: (Item(X,Y) -> Bool) -> Set(X,Y) -> Null_Or(Item(X,Y));
all_invariants_hold: Set(X,Y) -> 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.