src/ZF/ex/BT.thy
changeset 753 ec86863e87c8
parent 515 abcc438e7c27
child 935 a94ef3eed456
equal deleted inserted replaced
752:b89462f9d5f1 753:ec86863e87c8
    16     bt 	        :: "i=>i"
    16     bt 	        :: "i=>i"
    17 
    17 
    18 datatype
    18 datatype
    19   "bt(A)" = Lf  |  Br ("a: A",  "t1: bt(A)",  "t2: bt(A)")
    19   "bt(A)" = Lf  |  Br ("a: A",  "t1: bt(A)",  "t2: bt(A)")
    20   
    20   
    21 rules
    21 defs
    22   bt_rec_def
    22   bt_rec_def
    23     "bt_rec(t,c,h) == Vrec(t, %t g.bt_case(c, %x y z. h(x,y,z,g`y,g`z), t))"
    23     "bt_rec(t,c,h) == Vrec(t, %t g.bt_case(c, %x y z. h(x,y,z,g`y,g`z), t))"
    24 
    24 
    25   n_nodes_def	"n_nodes(t) == bt_rec(t,  0,  %x y z r s. succ(r#+s))"
    25   n_nodes_def	"n_nodes(t) == bt_rec(t,  0,  %x y z r s. succ(r#+s))"
    26   n_leaves_def	"n_leaves(t) == bt_rec(t,  succ(0),  %x y z r s. r#+s)"
    26   n_leaves_def	"n_leaves(t) == bt_rec(t,  succ(0),  %x y z r s. r#+s)"