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