src/HOL/HOLCF/IOA/meta_theory/Simulations.thy
author wenzelm
Fri, 03 Dec 2010 20:38:58 +0100
changeset 40945 b8703f63bfb2
parent 40774 0437dbc127b3
child 42151 4da4fc77664b
permissions -rw-r--r--
recoded latin1 as utf8; use textcomp for some text symbols where it appears appropriate;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
     1
(*  Title:      HOLCF/IOA/meta_theory/Simulations.thy
40945
b8703f63bfb2 recoded latin1 as utf8;
wenzelm
parents: 40774
diff changeset
     2
    Author:     Olaf Müller
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
     3
*)
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
     4
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     5
header {* Simulations in HOLCF/IOA *}
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
     6
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     7
theory Simulations
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     8
imports RefCorrectness
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     9
begin
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    10
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 35174
diff changeset
    11
default_sort type
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    12
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    13
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    14
  is_simulation :: "[('s1 * 's2)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    15
  "is_simulation R C A =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    16
   ((!s:starts_of C. R``{s} Int starts_of A ~= {}) &
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    17
   (!s s' t a. reachable C s &
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    18
               s -a--C-> t   &
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    19
               (s,s') : R
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    20
               --> (? t' ex. (t,t'):R & move A ex s' a t')))"
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    21
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    22
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    23
  is_backward_simulation :: "[('s1 * 's2)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    24
  "is_backward_simulation R C A =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    25
   ((!s:starts_of C. R``{s} <= starts_of A) &
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    26
   (!s t t' a. reachable C s &
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    27
               s -a--C-> t   &
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    28
               (t,t') : R
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    29
               --> (? ex s'. (s,s'):R & move A ex s' a t')))"
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    30
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    31
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    32
  is_forw_back_simulation :: "[('s1 * 's2 set)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    33
  "is_forw_back_simulation R C A =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    34
   ((!s:starts_of C. ? S'. (s,S'):R & S'<= starts_of A) &
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    35
   (!s S' t a. reachable C s &
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    36
               s -a--C-> t   &
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    37
               (s,S') : R
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    38
               --> (? T'. (t,T'):R & (! t':T'. ? s':S'. ? ex. move A ex s' a t'))))"
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    39
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    40
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    41
  is_back_forw_simulation :: "[('s1 * 's2 set)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    42
  "is_back_forw_simulation R C A =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    43
   ((!s:starts_of C. ! S'. (s,S'):R --> S' Int starts_of A ~={}) &
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    44
   (!s t T' a. reachable C s &
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    45
               s -a--C-> t   &
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    46
               (t,T') : R
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    47
               --> (? S'. (s,S'):R & (! s':S'. ? t':T'. ? ex. move A ex s' a t'))))"
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    48
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    49
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    50
  is_history_relation :: "[('s1 * 's2)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    51
  "is_history_relation R C A = (is_simulation R C A &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    52
                                is_ref_map (%x.(@y. (x,y):(R^-1))) A C)"
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    53
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    54
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    55
  is_prophecy_relation :: "[('s1 * 's2)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    56
  "is_prophecy_relation R C A = (is_backward_simulation R C A &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    57
                                 is_ref_map (%x.(@y. (x,y):(R^-1))) A C)"
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    58
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    59
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    60
lemma set_non_empty: "(A~={}) = (? x. x:A)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    61
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    62
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    63
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    64
lemma Int_non_empty: "(A Int B ~= {}) = (? x. x: A & x:B)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    65
apply (simp add: set_non_empty)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    66
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    67
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    68
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    69
lemma Sim_start_convert:
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    70
"(R``{x} Int S ~= {}) = (? y. (x,y):R & y:S)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    71
apply (unfold Image_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    72
apply (simp add: Int_non_empty)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    73
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    74
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    75
declare Sim_start_convert [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    76
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    77
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    78
lemma ref_map_is_simulation:
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    79
"!! f. is_ref_map f C A ==> is_simulation {p. (snd p) = f (fst p)} C A"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    80
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    81
apply (unfold is_ref_map_def is_simulation_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    82
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    83
done
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    84
4565
ea467ce15040 added forward simulation correectness;
mueller
parents:
diff changeset
    85
end