6008
|
1 |
(* Title: HOL/IOA/example/Spec.thy
|
|
2 |
ID: $Id$
|
12218
|
3 |
Author: Olaf Müller
|
6008
|
4 |
|
12218
|
5 |
The implementation of a memory.
|
6008
|
6 |
*)
|
|
7 |
|
|
8 |
Impl = IOA + Action +
|
|
9 |
|
|
10 |
|
|
11 |
consts
|
|
12 |
|
|
13 |
impl_sig :: "action signature"
|
|
14 |
impl_trans :: "(action, nat * bool)transition set"
|
|
15 |
impl_ioa :: "(action, nat * bool)ioa"
|
|
16 |
|
|
17 |
defs
|
|
18 |
|
|
19 |
sig_def "impl_sig == (UN l.{Free l} Un {New},
|
|
20 |
UN l.{Loc l},
|
|
21 |
{})"
|
|
22 |
|
|
23 |
trans_def "impl_trans ==
|
|
24 |
{tr. let s = fst(tr); k = fst s; b = snd s;
|
|
25 |
t = snd(snd(tr)); k' = fst t; b' = snd t
|
|
26 |
in
|
|
27 |
case fst(snd(tr))
|
|
28 |
of
|
|
29 |
New => k' = k & b' |
|
|
30 |
Loc l => b & l= k & k'= (Suc k) & ~b' |
|
|
31 |
Free l => k'=k & b'=b}"
|
|
32 |
|
|
33 |
ioa_def "impl_ioa == (impl_sig, {(0,False)}, impl_trans,{},{})"
|
|
34 |
|
|
35 |
end
|