src/HOLCF/IOA/Storage/Impl.thy
author huffman
Wed, 17 Feb 2010 10:00:22 -0800
changeset 35174 e15040ae75d7
parent 27361 24ec32bee347
permissions -rw-r--r--
remove $ from all HOLCF files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6008
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
     1
(*  Title:      HOL/IOA/example/Spec.thy
12218
wenzelm
parents: 6008
diff changeset
     2
    Author:     Olaf Müller
6008
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
     3
*)
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
     4
17244
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
     5
header {* The implementation of a memory *}
6008
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
     6
17244
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
     7
theory Impl
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
     8
imports IOA Action
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
     9
begin
6008
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
    10
27361
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    11
definition
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    12
  impl_sig :: "action signature" where
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    13
  "impl_sig = (UN l.{Free l} Un {New},
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    14
               UN l.{Loc l},
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    15
               {})"
6008
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
    16
27361
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    17
definition
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    18
  impl_trans :: "(action, nat  * bool)transition set" where
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    19
  "impl_trans =
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    20
    {tr. let s = fst(tr); k = fst s; b = snd s;
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    21
             t = snd(snd(tr)); k' = fst t; b' = snd t
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    22
         in
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    23
         case fst(snd(tr))
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    24
         of
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    25
         New       => k' = k & b'  |
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    26
         Loc l     => b & l= k & k'= (Suc k) & ~b' |
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    27
         Free l    => k'=k & b'=b}"
6008
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
    28
27361
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    29
definition
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    30
  impl_ioa :: "(action, nat * bool)ioa" where
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    31
  "impl_ioa = (impl_sig, {(0,False)}, impl_trans,{},{})"
17244
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    32
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    33
lemma in_impl_asig:
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    34
  "New : actions(impl_sig) &
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    35
    Loc l : actions(impl_sig) &
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    36
    Free l : actions(impl_sig) "
27361
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    37
  by (simp add: impl_sig_def actions_def asig_projections)
17244
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    38
6008
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
    39
end