src/HOL/UNITY/Extend.thy
author paulson
Mon Oct 11 10:53:39 1999 +0200 (1999-10-11)
changeset 7826 c6a8b73b6c2a
parent 7546 36b26759147e
child 7878 43b03d412b82
permissions -rw-r--r--
working shapshot with "projecting" and "extending"
     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   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   
    19   extend_set :: "['a*'b => 'c, 'a set] => 'c set"
    20     "extend_set h A == h `` (A Times UNIV)"
    21 
    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"
    26     "extend_act h == %act. UN (s,s'): act. UN y. {(h(s,y), h(s',y))}"
    27 
    28   (*Argument C allows weak safety laws to be projected*)
    29   project_act :: "['c set, 'a*'b => 'c, ('c*'c) set] => ('a*'a) set"
    30     "project_act C h act ==
    31          {(x,x'). EX y y'. (h(x,y), h(x',y')) : act & (h(x,y) : C)}"
    32 
    33   extend :: "['a*'b => 'c, 'a program] => 'c program"
    34     "extend h F == mk_program (extend_set h (Init F),
    35 			       extend_act h `` Acts F)"
    36 
    37   project :: "['c set, 'a*'b => 'c, 'c program] => 'a program"
    38     "project C h F == mk_program (project_set h (Init F),
    39 		  	          project_act C h `` Acts F)"
    40 
    41 locale Extend =
    42   fixes 
    43     f       :: 'c => 'a
    44     g       :: 'c => 'b
    45     h       :: "'a*'b => 'c"    (*isomorphism between 'a * 'b and 'c *)
    46     slice   :: ['c set, 'b] => 'a set
    47 
    48   assumes
    49     good_h  "good_map h"
    50   defines
    51     f_def       "f z == fst (inv h z)"
    52     g_def       "g z == snd (inv h z)"
    53     slice_def   "slice Z y == {x. h(x,y) : Z}"
    54 
    55 end