src/HOL/UNITY/Extend.thy
author paulson
Tue, 21 Sep 1999 11:09:24 +0200
changeset 7546 36b26759147e
parent 7537 875754b599df
child 7826 c6a8b73b6c2a
permissions -rw-r--r--
project_act no longer has a special case to allow identity actions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/Extend.thy
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     2
    ID:         $Id$
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     5
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     6
Extending of state sets
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     7
  function f (forget)    maps the extended state to the original state
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     8
  function g (forgotten) maps the extended state to the "extending part"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
     9
*)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    10
7399
cf780c2bcccf changed "component" infix in HOL/UNITY/Comp.thy to be overloaded <
paulson
parents: 7378
diff changeset
    11
Extend = Guar +
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    12
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    13
constdefs
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    14
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    15
  good_map :: "['a*'b => 'c] => bool"
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    16
    "good_map h == surj h & (ALL x y. fst (inv h (h (x,y))) = x)"
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    17
     (*Using the locale constant "f", this is  f (h (x,y))) = x*)
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    18
  
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    19
  extend_set :: "['a*'b => 'c, 'a set] => 'c set"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    20
    "extend_set h A == h `` (A Times UNIV)"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    21
7342
532841541d73 project constants
paulson
parents: 6677
diff changeset
    22
  project_set :: "['a*'b => 'c, 'c set] => 'a set"
532841541d73 project constants
paulson
parents: 6677
diff changeset
    23
    "project_set h C == {x. EX y. h(x,y) : C}"
532841541d73 project constants
paulson
parents: 6677
diff changeset
    24
532841541d73 project constants
paulson
parents: 6677
diff changeset
    25
  extend_act :: "['a*'b => 'c, ('a*'a) set] => ('c*'c) set"
6677
629b4b3d5bee made definition more readable
paulson
parents: 6297
diff changeset
    26
    "extend_act h act == UN (s,s'): act. UN y. {(h(s,y), h(s',y))}"
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    27
7546
36b26759147e project_act no longer has a special case to allow identity actions
paulson
parents: 7537
diff changeset
    28
  (*Argument C allows weak safety laws to be projected*)
7537
875754b599df working snapshot
paulson
parents: 7482
diff changeset
    29
  project_act :: "['c set, 'a*'b => 'c, ('c*'c) set] => ('a*'a) set"
875754b599df working snapshot
paulson
parents: 7482
diff changeset
    30
    "project_act C h act ==
7546
36b26759147e project_act no longer has a special case to allow identity actions
paulson
parents: 7537
diff changeset
    31
         {(x,x'). EX y y'. (h(x,y), h(x',y')) : act & (h(x,y) : C)}"
7342
532841541d73 project constants
paulson
parents: 6677
diff changeset
    32
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    33
  extend :: "['a*'b => 'c, 'a program] => 'c program"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    34
    "extend h F == mk_program (extend_set h (Init F),
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    35
			       extend_act h `` Acts F)"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    36
7537
875754b599df working snapshot
paulson
parents: 7482
diff changeset
    37
  project :: "['c set, 'a*'b => 'c, 'c program] => 'a program"
875754b599df working snapshot
paulson
parents: 7482
diff changeset
    38
    "project C h F == mk_program (project_set h (Init F),
875754b599df working snapshot
paulson
parents: 7482
diff changeset
    39
		  	          project_act C h `` Acts F)"
7342
532841541d73 project constants
paulson
parents: 6677
diff changeset
    40
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    41
locale Extend =
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    42
  fixes 
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    43
    f       :: 'c => 'a
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    44
    g       :: 'c => 'b
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    45
    h       :: "'a*'b => 'c"    (*isomorphism between 'a * 'b and 'c *)
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    46
    slice   :: ['c set, 'b] => 'a set
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    47
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    48
  assumes
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    49
    good_h  "good_map h"
6297
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    50
  defines
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    51
    f_def       "f z == fst (inv h z)"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    52
    g_def       "g z == snd (inv h z)"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    53
    slice_def   "slice Z y == {x. h(x,y) : Z}"
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    54
5b9fbdfe22b7 new theory of extending the state space
paulson
parents:
diff changeset
    55
end