@fairfox/polly 0.15.7 → 0.15.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,7 +19,7 @@ EXTENDS Integers, Sequences, FiniteSets, TLC
|
|
|
19
19
|
CONSTANTS
|
|
20
20
|
Contexts, \* Set of all contexts: {"background", "content", "popup", ...}
|
|
21
21
|
MaxMessages, \* Bound on number of messages (for model checking)
|
|
22
|
-
|
|
22
|
+
Tabs, \* Set of tab identifiers (integers or model values for symmetry)
|
|
23
23
|
TimeoutLimit \* Message timeout threshold
|
|
24
24
|
|
|
25
25
|
VARIABLES
|
|
@@ -156,7 +156,7 @@ TimeoutMessage(msgIndex) ==
|
|
|
156
156
|
Next ==
|
|
157
157
|
\/ \E c \in Contexts : ConnectPort(c)
|
|
158
158
|
\/ \E c \in Contexts : DisconnectPort(c)
|
|
159
|
-
\/ \E src \in Contexts : \E targetSet \in (SUBSET Contexts \ {{}}) : \E tab \in
|
|
159
|
+
\/ \E src \in Contexts : \E targetSet \in (SUBSET Contexts \ {{}}) : \E tab \in Tabs : \E msgType \in {"msg1", "msg2"} : SendMessage(src, targetSet, tab, msgType)
|
|
160
160
|
\/ \E i \in 1..Len(messages) : RouteMessage(i)
|
|
161
161
|
\/ CompleteRouting
|
|
162
162
|
\/ \E i \in 1..Len(messages) : TimeoutMessage(i)
|
|
@@ -603,12 +603,15 @@ class TLAGenerator {
|
|
|
603
603
|
for (let i = 0;i < this.tabCount; i++) {
|
|
604
604
|
lines.push(` Tab${i} = Tab${i}`);
|
|
605
605
|
}
|
|
606
|
+
const tabValues = Array.from({ length: this.tabCount }, (_, i) => `Tab${i}`).join(", ");
|
|
607
|
+
lines.push(` Tabs = {${tabValues}}`);
|
|
606
608
|
} else if ("maxTabs" in messages && messages.maxTabs !== undefined) {
|
|
607
|
-
|
|
609
|
+
const tabValues = Array.from({ length: messages.maxTabs + 1 }, (_, i) => i).join(", ");
|
|
610
|
+
lines.push(` Tabs = {${tabValues}}`);
|
|
608
611
|
} else if (hasProjectConstant) {
|
|
609
|
-
lines.push("
|
|
612
|
+
lines.push(" Tabs = {0}");
|
|
610
613
|
} else {
|
|
611
|
-
lines.push("
|
|
614
|
+
lines.push(" Tabs = {0, 1}");
|
|
612
615
|
}
|
|
613
616
|
lines.push(" TimeoutLimit = 3");
|
|
614
617
|
}
|
|
@@ -954,8 +957,6 @@ class TLAGenerator {
|
|
|
954
957
|
this.line(tabConstants.join(", "));
|
|
955
958
|
this.indent--;
|
|
956
959
|
this.line("");
|
|
957
|
-
this.line(`Tabs == {${tabConstants.join(", ")}}`);
|
|
958
|
-
this.line("");
|
|
959
960
|
this.line("TabSymmetry == Permutations(Tabs)");
|
|
960
961
|
this.line("");
|
|
961
962
|
const hasMessageSymmetry = this.symmetrySets.length > 0 && this.symmetrySets[0] === "Symmetry";
|
|
@@ -1724,8 +1725,7 @@ class TLAGenerator {
|
|
|
1724
1725
|
if (hasValidHandlers) {
|
|
1725
1726
|
this.line("\\/ \\E c \\in Contexts : ConnectPort(c) /\\ UNCHANGED <<contextStates, payload>>");
|
|
1726
1727
|
this.line("\\/ \\E c \\in Contexts : DisconnectPort(c) /\\ UNCHANGED <<contextStates, payload>>");
|
|
1727
|
-
|
|
1728
|
-
this.line(`\\/ \\E src \\in Contexts : \\E targetSet \\in (SUBSET Contexts \\ {{}}) : \\E tab \\in ${tabSet} : \\E msgType \\in UserMessageTypes :`);
|
|
1728
|
+
this.line("\\/ \\E src \\in Contexts : \\E targetSet \\in (SUBSET Contexts \\ {{}}) : \\E tab \\in Tabs : \\E msgType \\in UserMessageTypes :");
|
|
1729
1729
|
this.indent++;
|
|
1730
1730
|
this.line("SendMessage(src, targetSet, tab, msgType) /\\ UNCHANGED <<contextStates, payload>>");
|
|
1731
1731
|
this.indent--;
|
|
@@ -6234,4 +6234,4 @@ main().catch((error) => {
|
|
|
6234
6234
|
process.exit(1);
|
|
6235
6235
|
});
|
|
6236
6236
|
|
|
6237
|
-
//# debugId=
|
|
6237
|
+
//# debugId=30BEA370D0E300CD64756E2164756E21
|