src/HOL/HOLCF/IOA/meta_theory/Simulations.thy
author wenzelm
Sun Nov 02 17:16:01 2014 +0100 (2014-11-02)
changeset 58880 0baae4311a9f
parent 42151 4da4fc77664b
child 62002 f1599e98c4d0
permissions -rw-r--r--
modernized header;
wenzelm@42151
     1
(*  Title:      HOL/HOLCF/IOA/meta_theory/Simulations.thy
wenzelm@40945
     2
    Author:     Olaf Müller
mueller@4565
     3
*)
mueller@4565
     4
wenzelm@58880
     5
section {* Simulations in HOLCF/IOA *}
mueller@4565
     6
wenzelm@17233
     7
theory Simulations
wenzelm@17233
     8
imports RefCorrectness
wenzelm@17233
     9
begin
wenzelm@17233
    10
wenzelm@36452
    11
default_sort type
mueller@4565
    12
wenzelm@25135
    13
definition
wenzelm@25135
    14
  is_simulation :: "[('s1 * 's2)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
wenzelm@25135
    15
  "is_simulation R C A =
wenzelm@25135
    16
   ((!s:starts_of C. R``{s} Int starts_of A ~= {}) &
wenzelm@17233
    17
   (!s s' t a. reachable C s &
mueller@4565
    18
               s -a--C-> t   &
wenzelm@17233
    19
               (s,s') : R
wenzelm@25135
    20
               --> (? t' ex. (t,t'):R & move A ex s' a t')))"
mueller@4565
    21
wenzelm@25135
    22
definition
wenzelm@25135
    23
  is_backward_simulation :: "[('s1 * 's2)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
wenzelm@25135
    24
  "is_backward_simulation R C A =
wenzelm@25135
    25
   ((!s:starts_of C. R``{s} <= starts_of A) &
wenzelm@17233
    26
   (!s t t' a. reachable C s &
mueller@4565
    27
               s -a--C-> t   &
wenzelm@17233
    28
               (t,t') : R
wenzelm@25135
    29
               --> (? ex s'. (s,s'):R & move A ex s' a t')))"
mueller@4565
    30
wenzelm@25135
    31
definition
wenzelm@25135
    32
  is_forw_back_simulation :: "[('s1 * 's2 set)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
wenzelm@25135
    33
  "is_forw_back_simulation R C A =
wenzelm@25135
    34
   ((!s:starts_of C. ? S'. (s,S'):R & S'<= starts_of A) &
wenzelm@17233
    35
   (!s S' t a. reachable C s &
mueller@4565
    36
               s -a--C-> t   &
wenzelm@17233
    37
               (s,S') : R
wenzelm@25135
    38
               --> (? T'. (t,T'):R & (! t':T'. ? s':S'. ? ex. move A ex s' a t'))))"
mueller@4565
    39
wenzelm@25135
    40
definition
wenzelm@25135
    41
  is_back_forw_simulation :: "[('s1 * 's2 set)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
wenzelm@25135
    42
  "is_back_forw_simulation R C A =
wenzelm@25135
    43
   ((!s:starts_of C. ! S'. (s,S'):R --> S' Int starts_of A ~={}) &
wenzelm@17233
    44
   (!s t T' a. reachable C s &
mueller@4565
    45
               s -a--C-> t   &
wenzelm@17233
    46
               (t,T') : R
wenzelm@25135
    47
               --> (? S'. (s,S'):R & (! s':S'. ? t':T'. ? ex. move A ex s' a t'))))"
mueller@4565
    48
wenzelm@25135
    49
definition
wenzelm@25135
    50
  is_history_relation :: "[('s1 * 's2)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
wenzelm@25135
    51
  "is_history_relation R C A = (is_simulation R C A &
wenzelm@25135
    52
                                is_ref_map (%x.(@y. (x,y):(R^-1))) A C)"
mueller@4565
    53
wenzelm@25135
    54
definition
wenzelm@25135
    55
  is_prophecy_relation :: "[('s1 * 's2)set,('a,'s1)ioa,('a,'s2)ioa] => bool" where
wenzelm@25135
    56
  "is_prophecy_relation R C A = (is_backward_simulation R C A &
wenzelm@25135
    57
                                 is_ref_map (%x.(@y. (x,y):(R^-1))) A C)"
wenzelm@17233
    58
wenzelm@19741
    59
wenzelm@19741
    60
lemma set_non_empty: "(A~={}) = (? x. x:A)"
wenzelm@19741
    61
apply auto
wenzelm@19741
    62
done
wenzelm@19741
    63
wenzelm@19741
    64
lemma Int_non_empty: "(A Int B ~= {}) = (? x. x: A & x:B)"
wenzelm@19741
    65
apply (simp add: set_non_empty)
wenzelm@19741
    66
done
wenzelm@19741
    67
wenzelm@19741
    68
wenzelm@25135
    69
lemma Sim_start_convert:
wenzelm@19741
    70
"(R``{x} Int S ~= {}) = (? y. (x,y):R & y:S)"
wenzelm@19741
    71
apply (unfold Image_def)
wenzelm@19741
    72
apply (simp add: Int_non_empty)
wenzelm@19741
    73
done
wenzelm@19741
    74
wenzelm@19741
    75
declare Sim_start_convert [simp]
wenzelm@19741
    76
wenzelm@19741
    77
wenzelm@25135
    78
lemma ref_map_is_simulation:
wenzelm@19741
    79
"!! f. is_ref_map f C A ==> is_simulation {p. (snd p) = f (fst p)} C A"
wenzelm@19741
    80
wenzelm@19741
    81
apply (unfold is_ref_map_def is_simulation_def)
wenzelm@19741
    82
apply simp
wenzelm@19741
    83
done
wenzelm@17233
    84
mueller@4565
    85
end