author | ballarin |
Thu, 03 Aug 2006 14:57:26 +0200 | |
changeset 20318 | 0e0ea63fe768 |
parent 17309 | c43ed29bd197 |
child 21624 | 6f79647cf536 |
permissions | -rw-r--r-- |
17309 | 1 |
(* |
2 |
File: TLA/Action.thy |
|
3 |
ID: $Id$ |
|
3807 | 4 |
Author: Stephan Merz |
6255 | 5 |
Copyright: 1998 University of Munich |
3807 | 6 |
|
7 |
Theory Name: Action |
|
8 |
Logic Image: HOL |
|
9 |
||
10 |
Define the action level of TLA as an Isabelle theory. |
|
11 |
*) |
|
12 |
||
17309 | 13 |
theory Action |
14 |
imports Stfun |
|
15 |
begin |
|
16 |
||
3807 | 17 |
|
6255 | 18 |
(** abstract syntax **) |
19 |
||
3807 | 20 |
types |
6255 | 21 |
'a trfun = "(state * state) => 'a" |
17309 | 22 |
action = "bool trfun" |
6255 | 23 |
|
24 |
instance |
|
17309 | 25 |
"*" :: (world, world) world .. |
3807 | 26 |
|
27 |
consts |
|
6255 | 28 |
(** abstract syntax **) |
17309 | 29 |
before :: "'a stfun => 'a trfun" |
30 |
after :: "'a stfun => 'a trfun" |
|
31 |
unch :: "'a stfun => action" |
|
6255 | 32 |
|
17309 | 33 |
SqAct :: "[action, 'a stfun] => action" |
34 |
AnAct :: "[action, 'a stfun] => action" |
|
35 |
enabled :: "action => stpred" |
|
6255 | 36 |
|
37 |
(** concrete syntax **) |
|
38 |
||
39 |
syntax |
|
40 |
(* Syntax for writing action expressions in arbitrary contexts *) |
|
17309 | 41 |
"ACT" :: "lift => 'a" ("(ACT _)") |
3807 | 42 |
|
17309 | 43 |
"_before" :: "lift => lift" ("($_)" [100] 99) |
44 |
"_after" :: "lift => lift" ("(_$)" [100] 99) |
|
45 |
"_unchanged" :: "lift => lift" ("(unchanged _)" [100] 99) |
|
6255 | 46 |
|
47 |
(*** Priming: same as "after" ***) |
|
17309 | 48 |
"_prime" :: "lift => lift" ("(_`)" [100] 99) |
6255 | 49 |
|
17309 | 50 |
"_SqAct" :: "[lift, lift] => lift" ("([_]'_(_))" [0,1000] 99) |
51 |
"_AnAct" :: "[lift, lift] => lift" ("(<_>'_(_))" [0,1000] 99) |
|
52 |
"_Enabled" :: "lift => lift" ("(Enabled _)" [100] 100) |
|
3807 | 53 |
|
6255 | 54 |
translations |
55 |
"ACT A" => "(A::state*state => _)" |
|
56 |
"_before" == "before" |
|
9517
f58863b1406a
tuned version by Stephan Merz (unbatchified etc.);
wenzelm
parents:
6255
diff
changeset
|
57 |
"_after" == "after" |
f58863b1406a
tuned version by Stephan Merz (unbatchified etc.);
wenzelm
parents:
6255
diff
changeset
|
58 |
"_prime" => "_after" |
6255 | 59 |
"_unchanged" == "unch" |
60 |
"_SqAct" == "SqAct" |
|
61 |
"_AnAct" == "AnAct" |
|
62 |
"_Enabled" == "enabled" |
|
63 |
"w |= [A]_v" <= "_SqAct A v w" |
|
64 |
"w |= <A>_v" <= "_AnAct A v w" |
|
65 |
"s |= Enabled A" <= "_Enabled A s" |
|
66 |
"w |= unchanged f" <= "_unchanged f w" |
|
3807 | 67 |
|
17309 | 68 |
axioms |
69 |
unl_before: "(ACT $v) (s,t) == v s" |
|
70 |
unl_after: "(ACT v$) (s,t) == v t" |
|
3807 | 71 |
|
17309 | 72 |
unchanged_def: "(s,t) |= unchanged v == (v t = v s)" |
73 |
square_def: "ACT [A]_v == ACT (A | unchanged v)" |
|
74 |
angle_def: "ACT <A>_v == ACT (A & ~ unchanged v)" |
|
3807 | 75 |
|
17309 | 76 |
enabled_def: "s |= Enabled A == EX u. (s,u) |= A" |
77 |
||
78 |
ML {* use_legacy_bindings (the_context ()) *} |
|
79 |
||
3807 | 80 |
end |