src/ZF/ex/BT.thy
author wenzelm
Fri, 10 Oct 1997 18:23:31 +0200
changeset 3840 e0baea4d485a
parent 1478 2b8c2a7547ab
child 6046 2c8a8be36c94
permissions -rw-r--r--
fixed dots;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/ex/BT.thy
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
     2
    ID:         $Id$
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
515
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
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    11
    bt_rec      :: [i, i, [i,i,i,i,i]=>i] => i
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    12
    n_nodes     :: i=>i
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    13
    n_leaves    :: i=>i
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    14
    bt_reflect  :: i=>i
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    15
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
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
3840
e0baea4d485a fixed dots;
wenzelm
parents: 1478
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))"
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents:
diff changeset
    24
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    25
  n_nodes_def   "n_nodes(t) == bt_rec(t,  0,  %x y z r s. succ(r#+s))"
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    26
  n_leaves_def  "n_leaves(t) == bt_rec(t,  succ(0),  %x y z r s. r#+s)"
515
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