next node: TreeIndex,
prev node: TreeCompare,
up to node: Subsystem Binary Trees


TreeFilter

This structure contains functions for pruning trees by a predicate. Copying of the filter functions on sequences is not possible, because you often cannot preserve the tree structure

Signature of TreeFilter

List of Import References :
See BOOL
See DENOTATION
See Nat
See Option
See Seq
See Tree

SIGNATURE TreeFilter[data]

$Date: 2010-09-30 18:24:17 +0200 (Do, 30. Sep 2010) $ ($Revision: 616 $)

IMPORT Tree[data] ONLY tree

Parameter

SORT data

Filtering a Tree from the Root

take(P, t) removes all subtrees from t whose values do not fulfill P.

FUN take: (data -> bool) ** tree -> tree

Filtering a Tree from the Leaves

drop removes the leaves which do fulfill the given predicate. dropall does this repeatedly.

FUN drop: (data -> bool) ** tree -> tree
FUN dropall: (data -> bool) ** tree -> tree


next node: TreeIndex,
prev node: TreeCompare,
up to node: Subsystem Binary Trees