This structure provides functions for converting sets to textual representation or to and from sequences.
List of Import References :
See BOOL
See BSTree
See Char
See DENOTATION
See Nat
See Option
See Pair
See Seq
See SetByBST
See String
See Tree
SIGNATURE SetByBSTConv[data,< :data ** data -> bool]
$Date: 2010-09-30 18:24:17 +0200 (Do, 30. Sep 2010) $ ($Revision: 616 $)
IMPORT SetByBST[data, <] ONLY set Seq[data] ONLY seq String ONLY string
data
is the element type, <
is a total strict
order: the formula ALL x y. ~(x < y) AND ~(y < x) => x === y must
hold.
SORT data FUN < : data**data->bool
The elements of the set are converted by the given function,
separated by commas and surrounded by curly brackets. If you don't
like commas and curly brackets, you can supply your own denotations
instead: `(f)(s) === `("{", ",", "}")(f)(s)
.
FUN ` : (data -> denotation) -> set -> denotation FUN ` : (data -> string) -> set -> string FUN ` : (denotation ** denotation ** denotation) -> (data -> denotation) -> set -> denotation FUN ` : (denotation ** denotation ** denotation) -> (data -> string) -> set -> string
The conversion into a set removes double elements. When converting a set to a sequence, the order of elements may vary.
FUN asSet: seq -> set FUN asSeq: set -> seq
next node: SetByBSTFilter,
prev node: SetByBST,
up to node: Subsystem Sets By Binary Search Trees