Theory: ltree

Parents


Type constants


Term constants


Axioms


Definitions

size
|- size = (@fn. !tl. fn (node tl) = SUC (SUM (MAP fn tl)))
Is_ltree
|- !t l. Is_ltree (t,l) = size t = LENGTH l
ltree_TY_DEF
|- ?rep. TYPE_DEFINITION Is_ltree rep
ltree_ISO_DEF
|- (!a. ABS_ltree (REP_ltree a) = a) /\
   (!r. Is_ltree r = REP_ltree (ABS_ltree r) = r)
Node
|- !v tl.
     Node v tl =
     ABS_ltree
       (node (MAP (FST o REP_ltree) tl),
        CONS v (FLAT (MAP (SND o REP_ltree) tl)))
AP
|- (!l. AP [] l = []) /\
   (!h t l. AP (CONS h t) l = CONS (h (HD l)) (AP t (TL l)))
SPLIT
|- (!l. SPLIT 0 l = ([],l)) /\
   (!n l.
     SPLIT (SUC n) l =
     (CONS (HD l) (FST (SPLIT n (TL l))),SND (SPLIT n (TL l))))
PART
|- (!l. PART [] l = []) /\
   (!n t l.
     PART (CONS n t) l = CONS (FST (SPLIT n l)) (PART t (SND (SPLIT n l))))

Theorems

ltree_Axiom
|- !f. ?!fn. !v tl. fn (Node v tl) = f (MAP fn tl) v tl
ltree_Induct
|- !P. (!t. EVERY P t ==> (!h. P (Node h t))) ==> (!l. P l)
Node_11
|- !v1 v2 trl1 trl2.
     (Node v1 trl1 = Node v2 trl2) = (v1 = v2) /\ (trl1 = trl2)
Node_onto
|- !l. ?v trl. l = Node v trl