tla-ts 0.0.3-dev.3ce2f00 → 0.0.3-dev.3ef4193
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.
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +164 -46
- package/dist/index.d.ts +164 -46
- package/dist/index.js +1 -1
- package/dist/parallel-worker.cjs +1 -1
- package/dist/parallel-worker.js +2 -2
- package/dist/parallel.cjs +1 -1
- package/dist/parallel.js +2 -2
- package/dist/run-cli.cjs +1351 -22
- package/dist/run-cli.js +1351 -22
- package/dist/transfer.cjs +83 -33
- package/dist/transfer.js +83 -33
- package/package.json +5 -1
- package/src/ast.ts +54 -7
- package/src/bags.ts +4 -7
- package/src/builtins.ts +29 -17
- package/src/bundled-modules.ts +3 -3
- package/src/canonical.ts +4 -3
- package/src/check.ts +1317 -428
- package/src/cli.ts +8 -1
- package/src/codegen.ts +68 -21
- package/src/config.ts +225 -206
- package/src/environment.ts +417 -129
- package/src/errors.ts +155 -18
- package/src/evaluate.ts +713 -259
- package/src/exit-codes.ts +6 -24
- package/src/fingerprints.ts +1 -2
- package/src/index.ts +1 -0
- package/src/instances.ts +3 -1
- package/src/java-overrides.ts +104 -25
- package/src/levels.ts +122 -22
- package/src/lexer.ts +32 -4
- package/src/live-check.ts +204 -148
- package/src/liveness.ts +191 -122
- package/src/obligation-expression.ts +2 -2
- package/src/obligation-source.ts +2 -0
- package/src/parallel-worker.ts +6 -1
- package/src/parallel.ts +57 -6
- package/src/parser.ts +408 -168
- package/src/pcal-ast.ts +770 -0
- package/src/pcal-parse.ts +1523 -0
- package/src/pcal-tokenize.ts +516 -0
- package/src/pcal-translate.ts +1230 -0
- package/src/pcal-validate.ts +454 -0
- package/src/randomization.ts +24 -7
- package/src/resolve.ts +1379 -448
- package/src/run-cli.ts +1161 -196
- package/src/runtime.ts +16 -0
- package/src/sany-builtins.ts +147 -0
- package/src/sany-generator.ts +3112 -0
- package/src/sany-levels.ts +1208 -0
- package/src/sany-lexer.ts +545 -0
- package/src/sany-linter.ts +122 -0
- package/src/sany-modules.ts +1398 -0
- package/src/sany-nodes.ts +463 -0
- package/src/sany-parse-error.ts +2161 -0
- package/src/sany-report.ts +354 -0
- package/src/sany-selectors.ts +738 -0
- package/src/sany-source.ts +248 -0
- package/src/sany-xml.ts +1017 -0
- package/src/spec-description.ts +25 -5
- package/src/standard-modules.ts +172 -129
- package/src/standard-ranges.ts +116 -0
- package/src/state-graph.ts +29 -6
- package/src/subexpressions.ts +221 -161
- package/src/substitution-levels.ts +5 -8
- package/src/successors.ts +141 -173
- package/src/symmetry.ts +168 -50
- package/src/tableau.ts +3 -1
- package/src/tlc-ext.ts +13 -17
- package/src/tlc-messages.ts +329 -0
- package/src/tlc-module.ts +49 -21
- package/src/tlc-modules.ts +0 -4
- package/src/tlc-order.ts +55 -9
- package/src/tlc-random.ts +28 -3
- package/src/tlc-replay.ts +655 -0
- package/src/tlc-version.ts +18 -0
- package/src/transfer.ts +15 -3
- package/src/values.ts +664 -317
package/src/transfer.ts
CHANGED
|
@@ -2,8 +2,11 @@ import {
|
|
|
2
2
|
createModelValue,
|
|
3
3
|
createSortedFunction,
|
|
4
4
|
createSortedSet,
|
|
5
|
+
type FunctionClass,
|
|
5
6
|
getDomainInterval,
|
|
7
|
+
getFunctionClass,
|
|
6
8
|
getFunctionDomain,
|
|
9
|
+
setFunctionClass,
|
|
7
10
|
type Value,
|
|
8
11
|
} from "./values";
|
|
9
12
|
|
|
@@ -16,6 +19,9 @@ const SET = 5;
|
|
|
16
19
|
const FUNCTION = 6;
|
|
17
20
|
const INTERVAL_FUNCTION = 7;
|
|
18
21
|
|
|
22
|
+
// A function's TLC class follows its tag, so a worker words errors about it as TLC does.
|
|
23
|
+
const FUNCTION_CLASSES: (FunctionClass | undefined)[] = [undefined, "lambda", "tuple", "record"];
|
|
24
|
+
|
|
19
25
|
export interface EncodedStates {
|
|
20
26
|
words: Int32Array;
|
|
21
27
|
strings: string[];
|
|
@@ -76,11 +82,13 @@ export const createStateEncoder = (): StateEncoder => {
|
|
|
76
82
|
const interval = getDomainInterval(value.domain);
|
|
77
83
|
if (interval) {
|
|
78
84
|
push(INTERVAL_FUNCTION);
|
|
85
|
+
push(FUNCTION_CLASSES.indexOf(getFunctionClass(value)));
|
|
79
86
|
push(interval.low);
|
|
80
87
|
push(value.range.length);
|
|
81
88
|
return value.range.every(encodeValue);
|
|
82
89
|
}
|
|
83
90
|
push(FUNCTION);
|
|
91
|
+
push(FUNCTION_CLASSES.indexOf(getFunctionClass(value)));
|
|
84
92
|
push(value.domain.length);
|
|
85
93
|
return value.domain.every(encodeValue) && value.range.every(encodeValue);
|
|
86
94
|
}
|
|
@@ -117,16 +125,20 @@ export const createStateDecoder =
|
|
|
117
125
|
if (tag === INTEGER) return words[cursor.index++];
|
|
118
126
|
if (tag === STRING) return encoded.strings[words[cursor.index++]];
|
|
119
127
|
if (tag === MODEL_VALUE) return createModelValue(encoded.strings[words[cursor.index++]]);
|
|
128
|
+
if (tag === SET) return createSortedSet(decodeElements(words[cursor.index++]));
|
|
129
|
+
const functionClass = FUNCTION_CLASSES[words[cursor.index++]];
|
|
120
130
|
if (tag === INTERVAL_FUNCTION) {
|
|
121
131
|
const low = words[cursor.index++];
|
|
122
132
|
const length = words[cursor.index++];
|
|
123
133
|
const domain = getFunctionDomain({ kind: "Interval", low, high: low + length - 1 });
|
|
124
|
-
return
|
|
134
|
+
return setFunctionClass(
|
|
135
|
+
createSortedFunction(domain, decodeElements(length)),
|
|
136
|
+
functionClass,
|
|
137
|
+
);
|
|
125
138
|
}
|
|
126
139
|
const length = words[cursor.index++];
|
|
127
|
-
if (tag === SET) return createSortedSet(decodeElements(length));
|
|
128
140
|
const domain = decodeElements(length);
|
|
129
|
-
return createSortedFunction(domain, decodeElements(length));
|
|
141
|
+
return setFunctionClass(createSortedFunction(domain, decodeElements(length)), functionClass);
|
|
130
142
|
};
|
|
131
143
|
return Array.from({ length: encoded.count }, () =>
|
|
132
144
|
Array.from({ length: width }, () => decodeValue()),
|