tla-ts 0.0.3-dev.2032e26 → 0.0.3-dev.252cf06
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/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/run-cli.cjs +3 -2
- package/dist/run-cli.js +3 -2
- package/dist/transfer.cjs +14 -14
- package/dist/transfer.js +14 -14
- package/package.json +1 -1
- package/src/ast.ts +90 -0
- package/src/check.ts +70 -28
- package/src/codegen.ts +1 -3
- package/src/dependencies.ts +2 -2
- package/src/environment.ts +10 -10
- package/src/evaluate.ts +51 -112
- package/src/exit-codes.ts +20 -30
- package/src/instances.ts +12 -11
- package/src/levels.ts +8 -8
- package/src/live-check.ts +710 -0
- package/src/liveness.ts +5 -523
- package/src/resolve.ts +16 -15
- package/src/run-cli.ts +9 -2
- package/src/runtime.ts +1 -1
- package/src/spec-description.ts +7 -2
- package/src/subexpressions.ts +10 -10
- package/src/successors.ts +12 -7
- package/src/tlc-ext.ts +2 -10
package/src/subexpressions.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import {
|
|
2
|
+
getChildren,
|
|
3
|
+
type Bound,
|
|
4
|
+
type Definition,
|
|
5
|
+
type Expression,
|
|
6
|
+
type Instance,
|
|
7
|
+
type Module,
|
|
8
|
+
type OperatorParam,
|
|
9
|
+
type Selector,
|
|
10
|
+
type SourceLocation,
|
|
10
11
|
} from "./ast";
|
|
11
12
|
import { TlaSyntaxError } from "./errors";
|
|
12
|
-
import { getChildren } from "./evaluate";
|
|
13
13
|
import { getSourceName, mapChildren, mapDefinition } from "./instances";
|
|
14
14
|
import { getArity, getBoundNames, getPatternNames, LOCAL_RESOLUTION } from "./resolve";
|
|
15
15
|
|
package/src/successors.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
getChildren,
|
|
3
|
+
isLocallyResolved,
|
|
4
|
+
type Bound,
|
|
5
|
+
type Definition,
|
|
6
|
+
type Expression,
|
|
7
|
+
} from "./ast";
|
|
2
8
|
import { getReadVariables } from "./dependencies";
|
|
3
9
|
import { TlaEvaluationError, UNEXPECTED_EXCEPTION } from "./errors";
|
|
4
10
|
import { EXIT_STATUS, setExitCode } from "./exit-codes";
|
|
@@ -14,14 +20,12 @@ import {
|
|
|
14
20
|
expectBoolean,
|
|
15
21
|
forEachBinding,
|
|
16
22
|
getBoundsDomain,
|
|
17
|
-
getChildren,
|
|
18
23
|
getDefinition,
|
|
19
24
|
getEnumeratedElements,
|
|
20
25
|
getReevaluatedDefinitions,
|
|
21
26
|
lookupScope,
|
|
22
27
|
resolveApplyOperator,
|
|
23
28
|
resolveGlobalOperator,
|
|
24
|
-
isLocallyResolved,
|
|
25
29
|
type Context,
|
|
26
30
|
type Environment,
|
|
27
31
|
type Scope,
|
|
@@ -916,18 +920,19 @@ export const isEnabled = (expression: Expression, context: Context): boolean =>
|
|
|
916
920
|
);
|
|
917
921
|
}
|
|
918
922
|
const environment = context.environment;
|
|
919
|
-
const
|
|
923
|
+
const run: Run = { environment, isInit: false, current: state, isStopped: false };
|
|
924
|
+
// TLC stops computing ENABLED at the first successor, so it skips the rest of the action.
|
|
920
925
|
getRunner(expression, environment, false)(
|
|
921
|
-
|
|
926
|
+
run,
|
|
922
927
|
context.scope,
|
|
923
928
|
getEmptyState(environment),
|
|
924
929
|
undefined,
|
|
925
930
|
false,
|
|
926
931
|
() => {
|
|
927
|
-
|
|
932
|
+
run.isStopped = true;
|
|
928
933
|
},
|
|
929
934
|
);
|
|
930
|
-
return
|
|
935
|
+
return run.isStopped;
|
|
931
936
|
};
|
|
932
937
|
|
|
933
938
|
export const forEachInitialState = (
|
package/src/tlc-ext.ts
CHANGED
|
@@ -10,16 +10,8 @@ import {
|
|
|
10
10
|
} from "./builtins";
|
|
11
11
|
import { TlaEvaluationError, TlaModuleError, TlaUnsupportedError } from "./errors";
|
|
12
12
|
import { getTlcFingerprint } from "./tlc-random";
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
expectBoolean,
|
|
16
|
-
getChildren,
|
|
17
|
-
getDefinition,
|
|
18
|
-
isLocallyResolved,
|
|
19
|
-
type Builtin,
|
|
20
|
-
type Environment,
|
|
21
|
-
} from "./evaluate";
|
|
22
|
-
import type { Definition, Expression } from "./ast";
|
|
13
|
+
import { evaluate, expectBoolean, getDefinition, type Builtin, type Environment } from "./evaluate";
|
|
14
|
+
import { getChildren, isLocallyResolved, type Definition, type Expression } from "./ast";
|
|
23
15
|
import type { TraceStep } from "./check";
|
|
24
16
|
import {
|
|
25
17
|
getNamedRegisters,
|