src/ZF/ex/BT_Fn.thy
author lcp
Tue Aug 16 18:58:42 1994 +0200 (1994-08-16)
changeset 532 851df239ac8b
parent 0 a5a9c433f639
permissions -rw-r--r--
ZF/Makefile,ROOT.ML, ZF/ex/Integ.thy: updated for EquivClass
clasohm@0
     1
(*  Title: 	ZF/ex/bt-fn.thy
clasohm@0
     2
    ID:         $Id$
clasohm@0
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1992  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Binary trees
clasohm@0
     7
*)
clasohm@0
     8
clasohm@0
     9
BT_Fn = BT +
clasohm@0
    10
consts
clasohm@0
    11
    bt_rec    	:: "[i, i, [i,i,i,i,i]=>i] => i"
clasohm@0
    12
    n_nodes	:: "i=>i"
clasohm@0
    13
    n_leaves   	:: "i=>i"
clasohm@0
    14
    bt_reflect 	:: "i=>i"
clasohm@0
    15
clasohm@0
    16
rules
clasohm@0
    17
  bt_rec_def
clasohm@0
    18
    "bt_rec(t,c,h) == Vrec(t, %t g.bt_case(c, %x y z. h(x,y,z,g`y,g`z), t))"
clasohm@0
    19
clasohm@0
    20
  n_nodes_def	"n_nodes(t) == bt_rec(t,  0,  %x y z r s. succ(r#+s))"
clasohm@0
    21
  n_leaves_def	"n_leaves(t) == bt_rec(t,  succ(0),  %x y z r s. r#+s)"
clasohm@0
    22
  bt_reflect_def "bt_reflect(t) == bt_rec(t,  Lf,  %x y z r s. Br(x,s,r))"
clasohm@0
    23
clasohm@0
    24
end