src/HOL/UNITY/Extend.thy
author paulson
Wed May 24 18:40:01 2000 +0200 (2000-05-24)
changeset 8948 b797cfa3548d
parent 8703 816d8f6513be
child 10064 1a77667b21ef
permissions -rw-r--r--
restructuring: LessThan.ML mostly moved to HOL/SetInterval.ML
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@8948
    15
  (*MOVE to Relation.thy?*)
paulson@8948
    16
  Restrict :: "[ 'a set, ('a*'b) set] => ('a*'b) set"
paulson@8948
    17
    "Restrict A r == r Int (A <*> UNIV)"
paulson@8948
    18
paulson@7482
    19
  good_map :: "['a*'b => 'c] => bool"
paulson@7482
    20
    "good_map h == surj h & (ALL x y. fst (inv h (h (x,y))) = x)"
paulson@7482
    21
     (*Using the locale constant "f", this is  f (h (x,y))) = x*)
paulson@7482
    22
  
paulson@6297
    23
  extend_set :: "['a*'b => 'c, 'a set] => 'c set"
nipkow@8703
    24
    "extend_set h A == h `` (A <*> UNIV)"
paulson@6297
    25
paulson@7342
    26
  project_set :: "['a*'b => 'c, 'c set] => 'a set"
paulson@7342
    27
    "project_set h C == {x. EX y. h(x,y) : C}"
paulson@7342
    28
paulson@7342
    29
  extend_act :: "['a*'b => 'c, ('a*'a) set] => ('c*'c) set"
paulson@7826
    30
    "extend_act h == %act. UN (s,s'): act. UN y. {(h(s,y), h(s',y))}"
paulson@6297
    31
paulson@7878
    32
  project_act :: "['a*'b => 'c, ('c*'c) set] => ('a*'a) set"
paulson@7878
    33
    "project_act h act == {(x,x'). EX y y'. (h(x,y), h(x',y')) : act}"
paulson@7342
    34
paulson@6297
    35
  extend :: "['a*'b => 'c, 'a program] => 'c program"
paulson@6297
    36
    "extend h F == mk_program (extend_set h (Init F),
paulson@6297
    37
			       extend_act h `` Acts F)"
paulson@6297
    38
paulson@7878
    39
  (*Argument C allows weak safety laws to be projected*)
paulson@7880
    40
  project :: "['a*'b => 'c, 'c set, 'c program] => 'a program"
paulson@7880
    41
    "project h C F == mk_program (project_set h (Init F),
paulson@7878
    42
		  	          project_act h `` Restrict C `` Acts F)"
paulson@7342
    43
paulson@6297
    44
locale Extend =
paulson@6297
    45
  fixes 
paulson@6297
    46
    f       :: 'c => 'a
paulson@6297
    47
    g       :: 'c => 'b
paulson@6297
    48
    h       :: "'a*'b => 'c"    (*isomorphism between 'a * 'b and 'c *)
paulson@6297
    49
    slice   :: ['c set, 'b] => 'a set
paulson@6297
    50
paulson@6297
    51
  assumes
paulson@7482
    52
    good_h  "good_map h"
paulson@6297
    53
  defines
paulson@6297
    54
    f_def       "f z == fst (inv h z)"
paulson@6297
    55
    g_def       "g z == snd (inv h z)"
paulson@6297
    56
    slice_def   "slice Z y == {x. h(x,y) : Z}"
paulson@6297
    57
paulson@6297
    58
end