signature ELEMENT = sig type element; val similar : element * element -> bool; end; signature BTREE = sig structure Element: ELEMENT; eqtype elt; sharing type elt = Element.element; datatype btree = Empty | Node of elt * btree * btree; val leaf : elt -> btree; val build : elt * btree * btree -> btree; val lookup : elt * btree -> bool end; signature TREE = sig structure Element: ELEMENT; eqtype elt; sharing type elt = Element.element; datatype tree = Tree of elt * tree list; val build : elt * tree list -> tree; val lookup : elt * tree -> bool end; signature ALLTREES = sig structure Btree: BTREE; structure Tree: TREE; sharing Btree.Element = Tree.Element; sharing type Btree.elt = Tree.elt end;