src/ZF/ex/TF_Fn.thy
author clasohm
Thu Sep 16 12:20:38 1993 +0200 (1993-09-16)
changeset 0 a5a9c433f639
child 77 c94c8ebc0b15
permissions -rw-r--r--
Initial revision
clasohm@0
     1
(*  Title: 	ZF/ex/TF.thy
clasohm@0
     2
    ID:         $Id$
clasohm@0
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1993  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Trees & forests, a mutually recursive type definition.
clasohm@0
     7
*)
clasohm@0
     8
clasohm@0
     9
TF_Fn = TF + ListFn +
clasohm@0
    10
consts
clasohm@0
    11
  TF_rec	 ::	"[i, [i,i,i]=>i, i, [i,i,i,i]=>i] => i"
clasohm@0
    12
  TF_map      	 ::      "[i=>i, i] => i"
clasohm@0
    13
  TF_size 	 ::      "i=>i"
clasohm@0
    14
  TF_preorder 	 ::      "i=>i"
clasohm@0
    15
  list_of_TF 	 ::      "i=>i"
clasohm@0
    16
  TF_of_list 	 ::      "i=>i"
clasohm@0
    17
clasohm@0
    18
rules
clasohm@0
    19
  TF_rec_def
clasohm@0
    20
    "TF_rec(z,b,c,d) == Vrec(z,  			\
clasohm@0
    21
\      %z r. tree_forest_case(%x tf. b(x, tf, r`tf), 	\
clasohm@0
    22
\                             c, 			\
clasohm@0
    23
\		              %t tf. d(t, tf, r`t, r`tf), z))"
clasohm@0
    24
clasohm@0
    25
  list_of_TF_def
clasohm@0
    26
    "list_of_TF(z) == TF_rec(z, %x tf r. [Tcons(x,tf)], [], \
clasohm@0
    27
\		             %t tf r1 r2. Cons(t, r2))"
clasohm@0
    28
clasohm@0
    29
  TF_of_list_def
clasohm@0
    30
    "TF_of_list(tf) == list_rec(tf, Fnil,  %t tf r. Fcons(t,r))"
clasohm@0
    31
clasohm@0
    32
  TF_map_def
clasohm@0
    33
    "TF_map(h,z) == TF_rec(z, %x tf r.Tcons(h(x),r), Fnil, \
clasohm@0
    34
\                           %t tf r1 r2. Fcons(r1,r2))"
clasohm@0
    35
clasohm@0
    36
  TF_size_def
clasohm@0
    37
    "TF_size(z) == TF_rec(z, %x tf r.succ(r), 0, %t tf r1 r2. r1#+r2)"
clasohm@0
    38
clasohm@0
    39
  TF_preorder_def
clasohm@0
    40
    "TF_preorder(z) == TF_rec(z, %x tf r.Cons(x,r), Nil, %t tf r1 r2. r1@r2)"
clasohm@0
    41
clasohm@0
    42
end