src/HOL/UNITY/Extend.thy
 author nipkow Tue Jan 09 15:32:27 2001 +0100 (2001-01-09) changeset 10834 a7897aebbffc parent 10064 1a77667b21ef child 13790 8d7e9fce8c50 permissions -rw-r--r--
*** empty log message ***
```     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
```
```    11 Extend = Guar +
```
```    12
```
```    13 constdefs
```
```    14
```
```    15   (*MOVE to Relation.thy?*)
```
```    16   Restrict :: "[ 'a set, ('a*'b) set] => ('a*'b) set"
```
```    17     "Restrict A r == r Int (A <*> UNIV)"
```
```    18
```
```    19   good_map :: "['a*'b => 'c] => bool"
```
```    20     "good_map h == surj h & (ALL x y. fst (inv h (h (x,y))) = x)"
```
```    21      (*Using the locale constant "f", this is  f (h (x,y))) = x*)
```
```    22
```
```    23   extend_set :: "['a*'b => 'c, 'a set] => 'c set"
```
```    24     "extend_set h A == h ` (A <*> UNIV)"
```
```    25
```
```    26   project_set :: "['a*'b => 'c, 'c set] => 'a set"
```
```    27     "project_set h C == {x. EX y. h(x,y) : C}"
```
```    28
```
```    29   extend_act :: "['a*'b => 'c, ('a*'a) set] => ('c*'c) set"
```
```    30     "extend_act h == %act. UN (s,s'): act. UN y. {(h(s,y), h(s',y))}"
```
```    31
```
```    32   project_act :: "['a*'b => 'c, ('c*'c) set] => ('a*'a) set"
```
```    33     "project_act h act == {(x,x'). EX y y'. (h(x,y), h(x',y')) : act}"
```
```    34
```
```    35   extend :: "['a*'b => 'c, 'a program] => 'c program"
```
```    36     "extend h F == mk_program (extend_set h (Init F),
```
```    37 			       extend_act h ` Acts F,
```
```    38 			       project_act h -` AllowedActs F)"
```
```    39
```
```    40   (*Argument C allows weak safety laws to be projected*)
```
```    41   project :: "['a*'b => 'c, 'c set, 'c program] => 'a program"
```
```    42     "project h C F ==
```
```    43        mk_program (project_set h (Init F),
```
```    44 		   project_act h ` Restrict C ` Acts F,
```
```    45 		   {act. Restrict (project_set h C) act :
```
```    46 		         project_act h ` Restrict C ` AllowedActs F})"
```
```    47
```
```    48 locale Extend =
```
```    49   fixes
```
```    50     f       :: 'c => 'a
```
```    51     g       :: 'c => 'b
```
```    52     h       :: "'a*'b => 'c"    (*isomorphism between 'a * 'b and 'c *)
```
```    53     slice   :: ['c set, 'b] => 'a set
```
```    54
```
```    55   assumes
```
```    56     good_h  "good_map h"
```
```    57   defines
```
```    58     f_def       "f z == fst (inv h z)"
```
```    59     g_def       "g z == snd (inv h z)"
```
```    60     slice_def   "slice Z y == {x. h(x,y) : Z}"
```
```    61
```
```    62 end
```