author | paulson |
Mon, 06 Sep 1999 10:52:26 +0200 | |
changeset 7482 | 7badd511844d |
parent 7399 | cf780c2bcccf |
child 7537 | 875754b599df |
permissions | -rw-r--r-- |
6297 | 1 |
(* Title: HOL/UNITY/Extend.thy |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1998 University of Cambridge |
|
5 |
||
6 |
Extending of state sets |
|
7 |
function f (forget) maps the extended state to the original state |
|
8 |
function g (forgotten) maps the extended state to the "extending part" |
|
9 |
*) |
|
10 |
||
7399
cf780c2bcccf
changed "component" infix in HOL/UNITY/Comp.thy to be overloaded <
paulson
parents:
7378
diff
changeset
|
11 |
Extend = Guar + |
6297 | 12 |
|
13 |
constdefs |
|
14 |
||
7482 | 15 |
good_map :: "['a*'b => 'c] => bool" |
16 |
"good_map h == surj h & (ALL x y. fst (inv h (h (x,y))) = x)" |
|
17 |
(*Using the locale constant "f", this is f (h (x,y))) = x*) |
|
18 |
||
6297 | 19 |
extend_set :: "['a*'b => 'c, 'a set] => 'c set" |
20 |
"extend_set h A == h `` (A Times UNIV)" |
|
21 |
||
7342 | 22 |
project_set :: "['a*'b => 'c, 'c set] => 'a set" |
23 |
"project_set h C == {x. EX y. h(x,y) : C}" |
|
24 |
||
25 |
extend_act :: "['a*'b => 'c, ('a*'a) set] => ('c*'c) set" |
|
6677 | 26 |
"extend_act h act == UN (s,s'): act. UN y. {(h(s,y), h(s',y))}" |
6297 | 27 |
|
7342 | 28 |
project_act :: "['a*'b => 'c, ('c*'c) set] => ('a*'a) set" |
29 |
"project_act h act == {(x,x'). EX y y'. (h(x,y), h(x',y')) : act}" |
|
30 |
||
6297 | 31 |
extend :: "['a*'b => 'c, 'a program] => 'c program" |
32 |
"extend h F == mk_program (extend_set h (Init F), |
|
33 |
extend_act h `` Acts F)" |
|
34 |
||
7342 | 35 |
project :: "['a*'b => 'c, 'c program] => 'a program" |
36 |
"project h F == mk_program (project_set h (Init F), |
|
37 |
project_act h `` Acts F)" |
|
38 |
||
6297 | 39 |
locale Extend = |
40 |
fixes |
|
41 |
f :: 'c => 'a |
|
42 |
g :: 'c => 'b |
|
43 |
h :: "'a*'b => 'c" (*isomorphism between 'a * 'b and 'c *) |
|
44 |
slice :: ['c set, 'b] => 'a set |
|
45 |
||
46 |
assumes |
|
7482 | 47 |
good_h "good_map h" |
6297 | 48 |
defines |
49 |
f_def "f z == fst (inv h z)" |
|
50 |
g_def "g z == snd (inv h z)" |
|
51 |
slice_def "slice Z y == {x. h(x,y) : Z}" |
|
52 |
||
53 |
end |