## interval-set.api
## All rights reserved.
# Compiled by:
#
src/lib/std/standard.lib# This api is the interface to sets over a discrete ordered domain, where the
# sets are represented by intervals. It is meant for representing dense sets
# (e.g., unicode character classes).
### "An expert is someone who knows
### some of the worst mistakes that
### can be made in his subject,
### and how to avoid them."
###
### -- Werner Heisenberg
# Used in:
#
#
api Interval_Set {
#
package d: Interval_Domain; # Interval_Domain is from
src/lib/src/interval-domain.api Item = d::Point;
Interval = ((Item, Item));
Set;
empty: Set; # The empty set.
universe: Set; # The set of all elements.
singleton: Item -> Set; # A set of a single element.
interval: (Item, Item) -> Set; # Set the covers the given interval.
is_empty: Set -> Bool;
is_universe: Set -> Bool;
member: (Set, Item) -> Bool;
items: Set -> List( Item ); # Return the list of items in the set.
intervals: Set -> List( Interval ); # Return a list of intervals that represents the set.
add: (Set, Item) -> Set; # Add a single element to the set.
add' : (Item, Set) -> Set;
add_int: (Set, Interval) -> Set; # Add an interval to the set.
add_int' : (Interval, Set) -> Set;
# Set operations.
complement: Set -> Set;
union: ((Set, Set)) -> Set;
intersect: ((Set, Set)) -> Set;
difference: ((Set, Set)) -> Set;
# Iterators on elements.
apply: (Item -> Void) -> Set -> Void;
fold_forward: ((Item, X) -> X) -> X -> Set -> X;
fold_backward: ((Item, X) -> X) -> X -> Set -> X;
filter: (Item -> Bool) -> Set -> Set;
all: (Item -> Bool) -> Set -> Bool;
exists: (Item -> Bool) -> Set -> Bool;
# Iterators on intervals.
apply_int: (Interval -> Void) -> Set -> Void;
foldl_int: ((Interval, X) -> X) -> X -> Set -> X;
foldr_int: ((Interval, X) -> X) -> X -> Set -> X;
filter_int: (Interval -> Bool) -> Set -> Set;
all_int: (Interval -> Bool) -> Set -> Bool;
exists_int: (Interval -> Bool) -> Set -> Bool;
# Ordering on sets.
compare: (Set, Set) -> Order;
is_subset: (Set, Set) -> Bool;
};
## COPYRIGHT (c) 2005 John Reppy (http://www.cs.uchicago.edu/~jhr)
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.