-
Notifications
You must be signed in to change notification settings - Fork 4
/
ActionTraceChecker.tla
62 lines (47 loc) · 1.27 KB
/
ActionTraceChecker.tla
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---- MODULE ActionTraceChecker ----
(* Action trace checker spec *)
EXTENDS ActionTranslator, Parser
\* action trace reader variables
VARIABLES
i,
action
tvars == <<action, i>>
\* supply file path
ActionTrace == parse("./test/test3.test")
InitTrace ==
/\ i = 1
/\ action = ActionTrace[1]
ReadNextAction ==
\* more actions to read and apply
\/ /\ i < Len(ActionTrace)
/\ i' = i + 1
/\ action' = ActionTrace[i']
\* we've applied the last action in the trace
\/ /\ i = Len(ActionTrace)
/\ i' = i + 1
/\ action' = "Done"
NextTrace ==
/\ ReadNextAction
/\ ActionTranslator(action)
----
\* Compose spec and reader next actions
Compose(NextA, varsA, NextB, varsB) ==
\/ NextA /\ NextB
\/ UNCHANGED varsB /\ NextA
\/ UNCHANGED varsA /\ NextB
ComposedNext == Compose(Next, vars, NextTrace, tvars)
ComposedSpec ==
/\ Init
/\ InitTrace
/\ [][ComposedNext]_<<vars, tvars>>
\* this invariant will be:
\* - satisfied by an incorrect trace
\* - violated by a correct trace
Incorrect == i <= Len(ActionTrace)
\* this property will be:
\* - violated by an incorrect trace
\* - satisfied by a correct trace
Finished ==
\/ ENABLED ComposedNext
\/ action = "Done"
=======================================