tla-ts 0.0.8 → 0.0.9-dev.0dd11f695
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/README.md +30 -0
- package/dist/compile.cjs +23 -0
- package/dist/compile.js +23 -0
- package/dist/deciders.cjs +15 -15
- package/dist/deciders.js +40 -40
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +98 -19
- package/dist/index.d.ts +98 -19
- package/dist/index.js +1 -1
- package/dist/parallel-worker.cjs +1 -1
- package/dist/parallel-worker.js +1 -1
- package/dist/prove-worker.cjs +1 -1
- package/dist/prove-worker.js +1 -1
- package/dist/prove.cjs +116 -36
- package/dist/prove.js +116 -36
- package/dist/run.cjs +143 -31
- package/dist/run.js +143 -31
- package/dist/tlapm.cjs +2 -2
- package/dist/tlapm.js +1 -1
- package/dist/transfer.cjs +128 -106
- package/dist/transfer.js +128 -106
- package/dist/worker.cjs +7 -7
- package/dist/worker.js +7 -7
- package/package.json +3 -1
- package/src/ast.ts +7 -21
- package/src/bags.ts +99 -99
- package/src/builtins.ts +44 -75
- package/src/bundled-modules.ts +1 -8
- package/src/check.ts +605 -311
- package/src/cli/options.ts +12 -3
- package/src/cli/run.ts +2 -2
- package/src/cli/runtime-invariants.ts +135 -0
- package/src/cli/shared.ts +20 -9
- package/src/cli/tlc-arguments.ts +646 -0
- package/src/cli/tlc-usage.ts +362 -0
- package/src/cli/tlc.ts +571 -185
- package/src/cli/typescript.ts +26 -0
- package/src/cli/xml-exporter.ts +4 -10
- package/src/codegen.ts +190 -51
- package/src/config.ts +101 -68
- package/src/coverage.ts +855 -0
- package/src/dependencies.ts +340 -24
- package/src/dfid.ts +636 -0
- package/src/environment.ts +289 -109
- package/src/errors.ts +142 -45
- package/src/evaluate.ts +734 -980
- package/src/exit-codes.ts +37 -1
- package/src/index.ts +3 -0
- package/src/instances.ts +85 -9
- package/src/java-overrides.ts +2 -12
- package/src/json-reader.ts +456 -0
- package/src/json.ts +262 -139
- package/src/levels.ts +2 -3
- package/src/lexer.ts +150 -70
- package/src/liveness-checker.ts +10 -18
- package/src/liveness.ts +122 -64
- package/src/parallel-worker.ts +14 -10
- package/src/parallel.ts +41 -17
- package/src/parser.ts +436 -90
- package/src/pcal/ast.ts +7 -28
- package/src/pcal/parse.ts +11 -39
- package/src/pcal/tokenize.ts +4 -20
- package/src/pcal/translate.ts +10 -42
- package/src/pcal/validate.ts +3 -21
- package/src/pretty-print.ts +1 -2
- package/src/prover/smt/solver/solver.ts +31 -27
- package/src/randomization.ts +84 -35
- package/src/resolve.ts +18 -60
- package/src/runtime.ts +11 -4
- package/src/sany/builtins.ts +3 -4
- package/src/sany/generator.ts +128 -176
- package/src/sany/levels.ts +6 -30
- package/src/sany/lexer.ts +7 -23
- package/src/sany/linter.ts +31 -29
- package/src/sany/modules.ts +1 -5
- package/src/sany/nodes.ts +4 -28
- package/src/sany/parse-error.ts +44 -100
- package/src/sany/report.ts +25 -40
- package/src/sany/selectors.ts +8 -22
- package/src/sany/source.ts +8 -15
- package/src/sany/xml.ts +11 -42
- package/src/search.ts +550 -150
- package/src/simulate.ts +694 -0
- package/src/spec-description.ts +167 -49
- package/src/standard-definitions.ts +2 -3
- package/src/standard-modules.ts +264 -68
- package/src/state-graph.ts +51 -18
- package/src/subexpressions.ts +31 -5
- package/src/successors.ts +269 -85
- package/src/symmetry.ts +59 -147
- package/src/tableau.ts +1 -2
- package/src/tlc/fingerprint.ts +226 -151
- package/src/tlc/jar-data.ts +113 -6
- package/src/tlc/messages.ts +122 -37
- package/src/tlc/order.ts +56 -82
- package/src/tlc/random.ts +16 -16
- package/src/tlc/replay.ts +564 -212
- package/src/tlc/summary.ts +2 -4
- package/src/tlc/tlc-operators.ts +81 -36
- package/src/tlc/tlcext-operators.ts +138 -117
- package/src/tlc/trace-spec.ts +273 -0
- package/src/tlc/value-stream.ts +143 -0
- package/src/tlc/version.ts +2 -4
- package/src/typescript/actions.ts +494 -0
- package/src/typescript/collections.ts +615 -0
- package/src/typescript/compile.ts +70 -0
- package/src/typescript/context.ts +106 -0
- package/src/typescript/emit.ts +122 -0
- package/src/typescript/expressions.ts +508 -0
- package/src/typescript/formula.ts +160 -0
- package/src/typescript/functions.ts +295 -0
- package/src/typescript/model.ts +164 -0
- package/src/typescript/names.ts +116 -0
- package/src/typescript/program.ts +51 -0
- package/src/typescript/properties.ts +148 -0
- package/src/typescript/scope.ts +117 -0
- package/src/typescript/steps.ts +175 -0
- package/src/typescript/types.ts +178 -0
- package/src/values.ts +910 -318
package/src/subexpressions.ts
CHANGED
|
@@ -41,8 +41,6 @@ interface Selection {
|
|
|
41
41
|
location: SourceLocation;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
// A name that selects a subexpression, with the range of each part and of the arguments of each
|
|
45
|
-
// part, where SANY reports an error in selecting that part.
|
|
46
44
|
interface SelectingName {
|
|
47
45
|
location: SourceLocation;
|
|
48
46
|
selectorRanges?: SourceRange[];
|
|
@@ -316,7 +314,6 @@ const selectSubexpression = (
|
|
|
316
314
|
return createApplication(selection, state.current);
|
|
317
315
|
};
|
|
318
316
|
|
|
319
|
-
// A name such as Op(1)!lab(2) whose first parts name a definition selects part of it.
|
|
320
317
|
const getQualifiedSelectors = (
|
|
321
318
|
name: string,
|
|
322
319
|
args: Expression[],
|
|
@@ -408,14 +405,43 @@ export const resolveInstanceSubexpressions = (instance: Instance, module: Module
|
|
|
408
405
|
|
|
409
406
|
// Generator.selectorToNode resolves a name in a theorem, a proof, or a fact as it does in a definition.
|
|
410
407
|
export const resolveModuleSubexpressions = (module: Module, available: Definition[]): Module => {
|
|
411
|
-
const lookup = createLookup([...available, ...module.definitions]);
|
|
412
408
|
const goals = new Set(
|
|
413
409
|
module.theorems.flatMap((theorem) =>
|
|
414
410
|
theorem.name !== undefined && theorem.statement.kind === "AssumeProve" ? [theorem.name] : [],
|
|
415
411
|
),
|
|
416
412
|
);
|
|
413
|
+
const clauses = module.theorems.flatMap((theorem): Definition[] => {
|
|
414
|
+
const statement = theorem.statement;
|
|
415
|
+
if (theorem.name === undefined || statement.kind !== "AssumeProve") return [];
|
|
416
|
+
const assumptions = statement.assumptions.filter(
|
|
417
|
+
(assumption) => assumption.kind !== "NewSymbol" && assumption.kind !== "AssumeProve",
|
|
418
|
+
);
|
|
419
|
+
if (assumptions.length !== statement.assumptions.length) return [];
|
|
420
|
+
return [
|
|
421
|
+
{
|
|
422
|
+
kind: "Operator",
|
|
423
|
+
name: theorem.name,
|
|
424
|
+
params: [],
|
|
425
|
+
body: {
|
|
426
|
+
kind: "Tuple",
|
|
427
|
+
elements: [...assumptions, statement.conclusion],
|
|
428
|
+
location: statement.location,
|
|
429
|
+
},
|
|
430
|
+
isLocal: true,
|
|
431
|
+
isRecursive: false,
|
|
432
|
+
location: theorem.location,
|
|
433
|
+
},
|
|
434
|
+
];
|
|
435
|
+
});
|
|
436
|
+
const lookup = createLookup([...available, ...module.definitions]);
|
|
417
437
|
const isGoal = (name: string) => goals.has(name);
|
|
418
|
-
const
|
|
438
|
+
const definitionLookup = createLookup([...available, ...module.definitions, ...clauses]);
|
|
439
|
+
const resolve = (expression: Expression) =>
|
|
440
|
+
resolveSubexpressions(
|
|
441
|
+
expression,
|
|
442
|
+
definitionLookup,
|
|
443
|
+
(name) => isGoal(name) && clauses.every((clause) => clause.name !== name),
|
|
444
|
+
);
|
|
419
445
|
// A name in a theorem, a proof, or a fact may also start with a step, a theorem, or a symbol that
|
|
420
446
|
// no definition names.
|
|
421
447
|
const isProofGoal = (name: string) => isGoal(name) || !lookup(name);
|