Licensed trees #
A relation R a ks says that a node labelled a may have daughters labelled ks, in order: it
is a set of local trees, each a node's label with its daughters' labels. R licenses a tree when
every subtree of the tree satisfies it at its root, and the trees R licenses form a local tree
language. The derivation trees of a context-free grammar are the trees its rules license, and any
well-formedness condition on a node and its daughters' labels takes the same form; a condition on
the root alone is a separate conjunct, and a condition that reads the daughters' subtrees is not
of this form. A tree is licensed exactly when each of its local trees is
(licensed_iff_forall_mem_localTrees), which decides licensing.
Main definitions #
RoseTree.Licensed R t: every subtree oftsatisfiesRat its root.
Main results #
RoseTree.licensed_node_iff: a tree is licensed when its root's local tree satisfiesRand its children are licensed;RoseTree.Licensed.inductionis the induction principle.RoseTree.Licensed.of_subtreeAt: licensing passes to subtrees.RoseTree.Licensed.replaceAt: replacing a subtree by a licensed tree with the same root value keeps the tree licensed.RoseTree.licensed_of_perm: a relation that ignores the order of the children licenses permuted trees alike, so it licenses unordered trees.
R licenses t when every subtree of t satisfies it at its root, R a ks reading "a node
labelled a may have daughters labelled ks, in order".
Equations
- RoseTree.Licensed R t = ∀ (s : RoseTree α), s.IsSubtree t → R s.value (List.map RoseTree.value s.children)
Instances For
A tree is licensed exactly when each of its local trees is.
Equations
- t.instDecidableLicensed = decidable_of_iff (∀ e ∈ t.localTrees, R e.1 e.2) ⋯
Induction over the trees R licenses.
A relation that ignores the order of the children licenses a tree exactly when it licenses any permutation of it.