src/HOLCF/IOA/Storage/Spec.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 specification 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 Spec
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
  spec_sig :: "action signature" where
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    13
  "spec_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
  spec_trans :: "(action, nat set * bool)transition set" where
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    19
  "spec_trans =
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    20
   {tr. let s = fst(tr); used = fst s; c = snd s;
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    21
            t = snd(snd(tr)); used' = fst t; c' = 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       => used' = used & c'  |
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    26
        Loc l     => c & l~:used  & used'= used Un {l} & ~c'   |
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    27
        Free l    => used'=used - {l} & c'=c}"
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
  spec_ioa :: "(action, nat set * bool)ioa" where
24ec32bee347 modernized specifications;
wenzelm
parents: 19740
diff changeset
    31
  "spec_ioa = (spec_sig, {({},False)}, spec_trans,{},{})"
17244
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    32
6008
d0e9b1619468 Memory storage case study from PhD p.240;
mueller
parents:
diff changeset
    33
end