1479
|
1 |
(* Title: HOLCF/Dnat.thy
|
1274
|
2 |
ID: $Id$
|
1479
|
3 |
Author: Franz Regensburger
|
1274
|
4 |
Copyright 1993 Technische Universitaet Muenchen
|
|
5 |
|
2569
|
6 |
NOT SUPPORTED ANY MORE. USE HOLCF/ex/Dnat.thy INSTEAD.
|
|
7 |
|
1274
|
8 |
Theory for the domain of natural numbers dnat = one ++ dnat
|
|
9 |
|
|
10 |
The type is axiomatized as the least solution of the domain equation above.
|
|
11 |
The functor term that specifies the domain equation is:
|
|
12 |
|
|
13 |
FT = <++,K_{one},I>
|
|
14 |
|
|
15 |
For details see chapter 5 of:
|
|
16 |
|
|
17 |
[Franz Regensburger] HOLCF: Eine konservative Erweiterung von HOL um LCF,
|
|
18 |
Dissertation, Technische Universit"at M"unchen, 1994
|
|
19 |
|
|
20 |
*)
|
|
21 |
|
|
22 |
Dnat = HOLCF +
|
|
23 |
|
|
24 |
types dnat 0
|
|
25 |
|
|
26 |
(* ----------------------------------------------------------------------- *)
|
|
27 |
(* arrity axiom is valuated by semantical reasoning *)
|
|
28 |
|
|
29 |
arities dnat::pcpo
|
|
30 |
|
|
31 |
consts
|
|
32 |
|
|
33 |
(* ----------------------------------------------------------------------- *)
|
|
34 |
(* essential constants *)
|
|
35 |
|
1479
|
36 |
dnat_rep :: " dnat -> (one ++ dnat)"
|
|
37 |
dnat_abs :: "(one ++ dnat) -> dnat"
|
1274
|
38 |
|
|
39 |
(* ----------------------------------------------------------------------- *)
|
|
40 |
(* abstract constants and auxiliary constants *)
|
|
41 |
|
1479
|
42 |
dnat_copy :: "(dnat -> dnat) -> dnat -> dnat"
|
1274
|
43 |
|
1479
|
44 |
dzero :: "dnat"
|
|
45 |
dsucc :: "dnat -> dnat"
|
|
46 |
dnat_when :: "'b -> (dnat -> 'b) -> dnat -> 'b"
|
|
47 |
is_dzero :: "dnat -> tr"
|
|
48 |
is_dsucc :: "dnat -> tr"
|
|
49 |
dpred :: "dnat -> dnat"
|
|
50 |
dnat_take :: "nat => dnat -> dnat"
|
|
51 |
dnat_bisim :: "(dnat => dnat => bool) => bool"
|
1274
|
52 |
|
|
53 |
rules
|
|
54 |
|
|
55 |
(* ----------------------------------------------------------------------- *)
|
|
56 |
(* axiomatization of recursive type dnat *)
|
|
57 |
(* ----------------------------------------------------------------------- *)
|
|
58 |
(* (dnat,dnat_abs) is the initial F-algebra where *)
|
|
59 |
(* F is the locally continuous functor determined by functor term FT. *)
|
|
60 |
(* domain equation: dnat = one ++ dnat *)
|
|
61 |
(* functor term: FT = <++,K_{one},I> *)
|
|
62 |
(* ----------------------------------------------------------------------- *)
|
|
63 |
(* dnat_abs is an isomorphism with inverse dnat_rep *)
|
|
64 |
(* identity is the least endomorphism on dnat *)
|
|
65 |
|
1479
|
66 |
dnat_abs_iso "dnat_rep`(dnat_abs`x) = x"
|
|
67 |
dnat_rep_iso "dnat_abs`(dnat_rep`x) = x"
|
|
68 |
dnat_copy_def "dnat_copy == (LAM f. dnat_abs oo
|
|
69 |
(sswhen`sinl`(sinr oo f)) oo dnat_rep )"
|
|
70 |
dnat_reach "(fix`dnat_copy)`x=x"
|
1274
|
71 |
|
|
72 |
|
|
73 |
defs
|
|
74 |
(* ----------------------------------------------------------------------- *)
|
|
75 |
(* properties of additional constants *)
|
|
76 |
(* ----------------------------------------------------------------------- *)
|
|
77 |
(* constructors *)
|
|
78 |
|
1479
|
79 |
dzero_def "dzero == dnat_abs`(sinl`one)"
|
|
80 |
dsucc_def "dsucc == (LAM n. dnat_abs`(sinr`n))"
|
1274
|
81 |
|
|
82 |
(* ----------------------------------------------------------------------- *)
|
|
83 |
(* discriminator functional *)
|
|
84 |
|
1479
|
85 |
dnat_when_def "dnat_when == (LAM f1 f2 n.sswhen`(LAM x.f1)`f2`(dnat_rep`n))"
|
1274
|
86 |
|
|
87 |
|
|
88 |
(* ----------------------------------------------------------------------- *)
|
|
89 |
(* discriminators and selectors *)
|
|
90 |
|
1479
|
91 |
is_dzero_def "is_dzero == dnat_when`TT`(LAM x.FF)"
|
|
92 |
is_dsucc_def "is_dsucc == dnat_when`FF`(LAM x.TT)"
|
|
93 |
dpred_def "dpred == dnat_when`UU`(LAM x.x)"
|
1274
|
94 |
|
|
95 |
|
|
96 |
(* ----------------------------------------------------------------------- *)
|
|
97 |
(* the taker for dnats *)
|
|
98 |
|
|
99 |
dnat_take_def "dnat_take == (%n.iterate n dnat_copy UU)"
|
|
100 |
|
|
101 |
(* ----------------------------------------------------------------------- *)
|
|
102 |
(* definition of bisimulation is determined by domain equation *)
|
|
103 |
(* simplification and rewriting for abstract constants yields def below *)
|
|
104 |
|
|
105 |
dnat_bisim_def "dnat_bisim ==
|
|
106 |
(%R.!s1 s2.
|
1479
|
107 |
R s1 s2 -->
|
1274
|
108 |
((s1=UU & s2=UU) |(s1=dzero & s2=dzero) |
|
|
109 |
(? s11 s21. s11~=UU & s21~=UU & s1=dsucc`s11 &
|
1479
|
110 |
s2 = dsucc`s21 & R s11 s21)))"
|
1274
|
111 |
|
|
112 |
end
|