Skip to content

Commit a94afef

Browse files
lemmyclaude
andcommitted
Separate the CMP abstraction from the FLASH protocol.
Model checking covers one node count at a time. CMP method of Chou, Mannava and Park proposed the following workaround: keep a few nodes concrete, summarize the rest in one abstract node Other, and add rules that over-approximate what it may do. The abstraction is pushed into FlashWithMutexCMP. TLAPS can prove the protocol for every constant value. Thus, a proof should not have to carry rules that exist to make one node count stand for all of them, nor should a reader of the protocol -- and both were carrying them, as ABS_* rules interleaved with the protocol's own, an Env_o conjunct in every UNCHANGED list, and NodeU widened by Other throughout. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
1 parent 815dbe1 commit a94afef

8 files changed

Lines changed: 503 additions & 413 deletions

File tree

specifications/FlashProtocol/APFlashWithMutex.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CONSTANT
22
NODE <- NodeVal
33
DATA <- DataVal
4-
Other <- OtherVal
54
Undefined <- UndefinedVal
65

76
INVARIANT

specifications/FlashProtocol/APFlashWithMutex.tla

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ CONSTANTS
1919
\* @type: Set(Str);
2020
DATA,
2121
\* @type: Str;
22-
Other,
23-
\* @type: Str;
2422
Undefined
2523

2624
VARIABLES
@@ -57,9 +55,7 @@ VARIABLES
5755
\* @type: Str;
5856
FwdCmd,
5957
\* @type: Str;
60-
FwdSrc,
61-
\* @type: Bool;
62-
Env_o
58+
FwdSrc
6359

6460
\* Both components of the variable group are strings, which the type checker
6561
\* cannot tell apart from a two-element sequence. The group is shadowed here
@@ -77,7 +73,6 @@ INSTANCE FlashWithMutex
7773
\* Concrete values for the constants used by APFlashWithMutex.cfg.
7874
NodeVal == { "n1", "n2" }
7975
DataVal == { "d1", "d2" }
80-
OtherVal == "Other"
8176
UndefinedVal == "Undefined"
8277

8378
==============================================================================

specifications/FlashProtocol/FlashWithMutex.tla

Lines changed: 76 additions & 393 deletions
Large diffs are not rendered by default.

specifications/FlashProtocol/FlashWithMutexCMP.tla

Lines changed: 410 additions & 0 deletions
Large diffs are not rendered by default.

specifications/FlashProtocol/MCFlashWithMutex.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CONSTANTS
22
NODE = {n1, n2}
33
DATA = {d1, d2}
4-
Other = Other
54
Undefined = Undefined
65

76
SYMMETRY Symmetry
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
------------------------- MODULE MCFlashWithMutex -------------------------
22
EXTENDS FlashWithMutex, TLC
33

4-
\* Nodes and data values are independently interchangeable. The Other and
5-
\* Undefined sentinels are fixed because they are outside these sets.
4+
\* Nodes and data values are independently interchangeable. The Undefined
5+
\* sentinel is fixed because it is outside these sets.
66
Symmetry == Permutations(NODE) \union Permutations(DATA)
77

88
==============================================================================

specifications/FlashProtocol/MCFlashWithMutexLive.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CONSTANTS
22
NODE = {n1, n2}
33
DATA = {d1, d2}
4-
Other = Other
54
Undefined = Undefined
65

76
SPECIFICATION FairSpec

specifications/FlashProtocol/manifest.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
"features": [],
1515
"models": []
1616
},
17+
{
18+
"path": "specifications/FlashProtocol/FlashWithMutexCMP.tla",
19+
"features": [],
20+
"models": []
21+
},
1722
{
1823
"path": "specifications/FlashProtocol/APFlashWithMutex.tla",
1924
"features": [],
2025
"models": [
2126
{
2227
"path": "specifications/FlashProtocol/APFlashWithMutex.cfg",
23-
"runtime": "00:38:09",
28+
"runtime": "00:00:44",
2429
"mode": "symbolic",
2530
"result": "success"
2631
}
@@ -32,12 +37,12 @@
3237
"models": [
3338
{
3439
"path": "specifications/FlashProtocol/MCFlashWithMutex.cfg",
35-
"runtime": "00:00:04",
40+
"runtime": "00:00:01",
3641
"mode": "exhaustive search",
3742
"result": "success",
38-
"distinctStates": 32994,
39-
"totalStates": 159216,
40-
"stateDepth": 34
43+
"distinctStates": 2024,
44+
"totalStates": 7552,
45+
"stateDepth": 21
4146
}
4247
]
4348
},
@@ -47,12 +52,12 @@
4752
"models": [
4853
{
4954
"path": "specifications/FlashProtocol/MCFlashWithMutexLive.cfg",
50-
"runtime": "00:04:44",
55+
"runtime": "00:00:15",
5156
"mode": "exhaustive search",
5257
"result": "success",
53-
"distinctStates": 131976,
54-
"totalStates": 636852,
55-
"stateDepth": 34,
58+
"distinctStates": 8096,
59+
"totalStates": 30196,
60+
"stateDepth": 21,
5661
"workers": 4
5762
}
5863
]

0 commit comments

Comments
 (0)