src/ZF/ex/BT.thy
author clasohm
Sat, 09 Dec 1995 13:36:11 +0100
changeset 1401 0c439768f45c
parent 1171 e4d6b42be73a
child 1478 2b8c2a7547ab
permissions -rw-r--r--
removed quotes from consts and syntax sections
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1171
e4d6b42be73a fixed comment
lcp
parents: 935
diff changeset
     1
(*  Title: 	ZF/ex/BT.thy
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
     2
    ID:         $Id$
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
     5
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
     6
Binary trees
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
     7
*)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
     8
935
a94ef3eed456 Changed Univ to Datatype in parents
lcp
parents: 753
diff changeset
     9
BT = Datatype +
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    10
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1171
diff changeset
    11
    bt_rec    	:: [i, i, [i,i,i,i,i]=>i] => i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1171
diff changeset
    12
    n_nodes	:: i=>i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1171
diff changeset
    13
    n_leaves   	:: i=>i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1171
diff changeset
    14
    bt_reflect 	:: i=>i
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    15
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1171
diff changeset
    16
    bt 	        :: i=>i
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    17
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    18
datatype
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    19
  "bt(A)" = Lf  |  Br ("a: A",  "t1: bt(A)",  "t2: bt(A)")
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    20
  
753
ec86863e87c8 replaced "rules" by "defs"
lcp
parents: 515
diff changeset
    21
defs
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    22
  bt_rec_def
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    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))"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    24
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    25
  n_nodes_def	"n_nodes(t) == bt_rec(t,  0,  %x y z r s. succ(r#+s))"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    26
  n_leaves_def	"n_leaves(t) == bt_rec(t,  succ(0),  %x y z r s. r#+s)"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    27
  bt_reflect_def "bt_reflect(t) == bt_rec(t,  Lf,  %x y z r s. Br(x,s,r))"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    28
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    29
end