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