src/ZF/ex/TF_Fn.thy
 changeset 0 a5a9c433f639 child 77 c94c8ebc0b15
```     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/ZF/ex/TF_Fn.thy	Thu Sep 16 12:20:38 1993 +0200
1.3 @@ -0,0 +1,42 @@
1.4 +(*  Title: 	ZF/ex/TF.thy
1.5 +    ID:         \$Id\$
1.6 +    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
1.7 +    Copyright   1993  University of Cambridge
1.8 +
1.9 +Trees & forests, a mutually recursive type definition.
1.10 +*)
1.11 +
1.12 +TF_Fn = TF + ListFn +
1.13 +consts
1.14 +  TF_rec	 ::	"[i, [i,i,i]=>i, i, [i,i,i,i]=>i] => i"
1.15 +  TF_map      	 ::      "[i=>i, i] => i"
1.16 +  TF_size 	 ::      "i=>i"
1.17 +  TF_preorder 	 ::      "i=>i"
1.18 +  list_of_TF 	 ::      "i=>i"
1.19 +  TF_of_list 	 ::      "i=>i"
1.20 +
1.21 +rules
1.22 +  TF_rec_def
1.23 +    "TF_rec(z,b,c,d) == Vrec(z,  			\
1.24 +\      %z r. tree_forest_case(%x tf. b(x, tf, r`tf), 	\
1.25 +\                             c, 			\
1.26 +\		              %t tf. d(t, tf, r`t, r`tf), z))"
1.27 +
1.28 +  list_of_TF_def
1.29 +    "list_of_TF(z) == TF_rec(z, %x tf r. [Tcons(x,tf)], [], \
1.30 +\		             %t tf r1 r2. Cons(t, r2))"
1.31 +
1.32 +  TF_of_list_def
1.33 +    "TF_of_list(tf) == list_rec(tf, Fnil,  %t tf r. Fcons(t,r))"
1.34 +
1.35 +  TF_map_def
1.36 +    "TF_map(h,z) == TF_rec(z, %x tf r.Tcons(h(x),r), Fnil, \
1.37 +\                           %t tf r1 r2. Fcons(r1,r2))"
1.38 +
1.39 +  TF_size_def
1.40 +    "TF_size(z) == TF_rec(z, %x tf r.succ(r), 0, %t tf r1 r2. r1#+r2)"
1.41 +
1.42 +  TF_preorder_def
1.43 +    "TF_preorder(z) == TF_rec(z, %x tf r.Cons(x,r), Nil, %t tf r1 r2. r1@r2)"
1.44 +
1.45 +end
```