tla-ts 0.0.3-dev.4c8c06c → 0.0.3-dev.4fdd845
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 +16 -2
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +157 -8
- package/dist/index.d.ts +157 -8
- 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 -19
- package/dist/run-cli.js +1351 -19
- package/dist/transfer.cjs +86 -16
- package/dist/transfer.js +86 -16
- package/package.json +5 -1
- package/src/ast.ts +142 -6
- package/src/bags.ts +4 -7
- package/src/builtins.ts +29 -11
- package/src/bundled-modules.ts +3 -3
- package/src/canonical.ts +4 -3
- package/src/check.ts +1539 -235
- package/src/cli-options.ts +11 -5
- package/src/cli.ts +8 -1
- package/src/codegen.ts +77 -37
- package/src/config.ts +252 -179
- package/src/dependencies.ts +2 -2
- package/src/environment.ts +518 -137
- package/src/errors.ts +224 -3
- package/src/evaluate.ts +796 -246
- package/src/exit-codes.ts +22 -43
- package/src/index.ts +1 -0
- package/src/instances.ts +19 -16
- package/src/java-overrides.ts +104 -25
- package/src/levels.ts +191 -45
- package/src/lexer.ts +32 -4
- package/src/live-check.ts +828 -0
- package/src/liveness.ts +218 -572
- package/src/obligation-expression.ts +2 -2
- package/src/obligation-source.ts +2 -0
- package/src/parallel-worker.ts +13 -4
- package/src/parallel.ts +73 -6
- package/src/parser.ts +447 -128
- 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 +1380 -420
- package/src/run-cli.ts +1200 -143
- package/src/runtime.ts +19 -1
- 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 +42 -11
- package/src/standard-modules.ts +200 -148
- package/src/standard-ranges.ts +116 -0
- package/src/state-graph.ts +180 -0
- package/src/subexpressions.ts +231 -171
- package/src/substitution-levels.ts +38 -17
- package/src/successors.ts +219 -107
- package/src/symmetry.ts +180 -52
- package/src/tableau.ts +54 -25
- package/src/tlc-ext.ts +42 -29
- package/src/tlc-messages.ts +329 -0
- package/src/tlc-module.ts +52 -43
- package/src/tlc-order.ts +73 -9
- package/src/tlc-random.ts +37 -9
- package/src/tlc-replay.ts +655 -0
- package/src/tlc-summary.ts +20 -5
- package/src/tlc-version.ts +18 -0
- package/src/transfer.ts +15 -3
- package/src/value-sources.ts +29 -0
- package/src/values.ts +708 -180
package/dist/index.d.ts
CHANGED
|
@@ -38,25 +38,32 @@ interface StringExpression {
|
|
|
38
38
|
interface IdentifierExpression {
|
|
39
39
|
kind: "Identifier";
|
|
40
40
|
name: string;
|
|
41
|
+
selectorRanges?: SourceRange[];
|
|
41
42
|
location: SourceLocation;
|
|
42
43
|
resolution?: LocalResolution;
|
|
43
44
|
}
|
|
44
45
|
interface ApplyExpression {
|
|
45
46
|
kind: "Apply";
|
|
46
47
|
operator: string;
|
|
48
|
+
spelling?: string;
|
|
47
49
|
args: Expression[];
|
|
48
50
|
argumentCounts?: number[];
|
|
51
|
+
argumentsRange?: SourceRange;
|
|
52
|
+
selectorRanges?: SourceRange[];
|
|
53
|
+
argumentRanges?: (SourceRange | undefined)[];
|
|
49
54
|
location: SourceLocation;
|
|
50
55
|
resolution?: LocalResolution;
|
|
51
56
|
}
|
|
52
57
|
interface OperatorReferenceExpression {
|
|
53
58
|
kind: "OperatorReference";
|
|
54
59
|
operator: string;
|
|
60
|
+
spelling?: string;
|
|
55
61
|
location: SourceLocation;
|
|
56
62
|
}
|
|
57
63
|
interface LambdaExpression {
|
|
58
64
|
kind: "Lambda";
|
|
59
65
|
params: string[];
|
|
66
|
+
paramRanges?: SourceRange[];
|
|
60
67
|
body: Expression;
|
|
61
68
|
location: SourceLocation;
|
|
62
69
|
}
|
|
@@ -64,6 +71,7 @@ interface JunctionExpression {
|
|
|
64
71
|
kind: "And" | "Or";
|
|
65
72
|
operands: Expression[];
|
|
66
73
|
isBulleted?: boolean;
|
|
74
|
+
prefixEnds?: SourceLocation[];
|
|
67
75
|
location: SourceLocation;
|
|
68
76
|
}
|
|
69
77
|
interface PrimeExpression {
|
|
@@ -108,9 +116,11 @@ interface LetExpression {
|
|
|
108
116
|
type BoundPattern = {
|
|
109
117
|
kind: "Name";
|
|
110
118
|
name: string;
|
|
119
|
+
ranges?: SourceRange[];
|
|
111
120
|
} | {
|
|
112
121
|
kind: "Tuple";
|
|
113
122
|
names: string[];
|
|
123
|
+
ranges?: SourceRange[];
|
|
114
124
|
};
|
|
115
125
|
interface Bound {
|
|
116
126
|
pattern: BoundPattern;
|
|
@@ -126,6 +136,7 @@ interface UnboundedQuantifierExpression {
|
|
|
126
136
|
kind: "UnboundedQuantifier";
|
|
127
137
|
quantifier: "Forall" | "Exists";
|
|
128
138
|
names: string[];
|
|
139
|
+
nameRanges?: SourceRange[];
|
|
129
140
|
isTemporal?: boolean;
|
|
130
141
|
body: Expression;
|
|
131
142
|
location: SourceLocation;
|
|
@@ -175,6 +186,7 @@ interface FunctionSetExpression {
|
|
|
175
186
|
interface RecordField {
|
|
176
187
|
name: string;
|
|
177
188
|
value: Expression;
|
|
189
|
+
location: SourceLocation;
|
|
178
190
|
}
|
|
179
191
|
interface RecordExpression {
|
|
180
192
|
kind: "Record" | "RecordSet";
|
|
@@ -208,6 +220,11 @@ interface FunctionApplicationExpression {
|
|
|
208
220
|
args: Expression[];
|
|
209
221
|
location: SourceLocation;
|
|
210
222
|
}
|
|
223
|
+
interface BracketExpression {
|
|
224
|
+
kind: "Bracket";
|
|
225
|
+
args: Expression[];
|
|
226
|
+
location: SourceLocation;
|
|
227
|
+
}
|
|
211
228
|
interface FieldAccessExpression {
|
|
212
229
|
kind: "FieldAccess";
|
|
213
230
|
record: Expression;
|
|
@@ -241,6 +258,7 @@ interface LabelExpression {
|
|
|
241
258
|
kind: "Label";
|
|
242
259
|
name: string;
|
|
243
260
|
params: string[];
|
|
261
|
+
paramRanges?: SourceRange[];
|
|
244
262
|
body: Expression;
|
|
245
263
|
location: SourceLocation;
|
|
246
264
|
}
|
|
@@ -262,9 +280,11 @@ type Selector = {
|
|
|
262
280
|
interface SubexpressionExpression {
|
|
263
281
|
kind: "Subexpression";
|
|
264
282
|
selectors: Selector[];
|
|
283
|
+
selectorRanges?: SourceRange[];
|
|
284
|
+
argumentRanges?: (SourceRange | undefined)[];
|
|
265
285
|
location: SourceLocation;
|
|
266
286
|
}
|
|
267
|
-
type Expression = NumberExpression | DecimalExpression | StringExpression | IdentifierExpression | ApplyExpression | OperatorReferenceExpression | LambdaExpression | JunctionExpression | PrimeExpression | UnchangedExpression | EnabledExpression | IfExpression | CaseExpression | LetExpression | QuantifierExpression | UnboundedQuantifierExpression | ChooseExpression | SetEnumerationExpression | SetFilterExpression | SetMapExpression | TupleExpression | FunctionConstructionExpression | FunctionSetExpression | RecordExpression | ExceptExpression | ExceptAtExpression | FunctionApplicationExpression | FieldAccessExpression | ProductExpression | TemporalExpression | ActionExpression | FairnessExpression | LabelExpression | SubexpressionExpression;
|
|
287
|
+
type Expression = NumberExpression | DecimalExpression | StringExpression | IdentifierExpression | ApplyExpression | OperatorReferenceExpression | LambdaExpression | JunctionExpression | PrimeExpression | UnchangedExpression | EnabledExpression | IfExpression | CaseExpression | LetExpression | QuantifierExpression | UnboundedQuantifierExpression | ChooseExpression | SetEnumerationExpression | SetFilterExpression | SetMapExpression | TupleExpression | FunctionConstructionExpression | FunctionSetExpression | RecordExpression | ExceptExpression | ExceptAtExpression | FunctionApplicationExpression | BracketExpression | FieldAccessExpression | ProductExpression | TemporalExpression | ActionExpression | FairnessExpression | LabelExpression | SubexpressionExpression;
|
|
268
288
|
interface OperatorParam {
|
|
269
289
|
name: string;
|
|
270
290
|
arity: number;
|
|
@@ -287,6 +307,7 @@ interface FunctionDefinition {
|
|
|
287
307
|
body: Expression;
|
|
288
308
|
isLocal: boolean;
|
|
289
309
|
isRecursive: boolean;
|
|
310
|
+
isSelfReferential?: boolean;
|
|
290
311
|
location: SourceLocation;
|
|
291
312
|
}
|
|
292
313
|
type Definition = OperatorDefinition | FunctionDefinition;
|
|
@@ -303,6 +324,7 @@ interface Assumption {
|
|
|
303
324
|
}
|
|
304
325
|
interface InstanceSubstitution {
|
|
305
326
|
name: string;
|
|
327
|
+
nameRange: SourceRange;
|
|
306
328
|
expression: Expression;
|
|
307
329
|
}
|
|
308
330
|
interface Instance {
|
|
@@ -322,6 +344,7 @@ interface NewSymbol {
|
|
|
322
344
|
arity: number;
|
|
323
345
|
level: "Constant" | "Variable" | "State" | "Action" | "Temporal";
|
|
324
346
|
set: Expression | undefined;
|
|
347
|
+
nameRange?: SourceRange;
|
|
325
348
|
location: SourceLocation;
|
|
326
349
|
}
|
|
327
350
|
interface AssumeProve {
|
|
@@ -371,6 +394,7 @@ type StepBody = UseOrHide | Instance | DefineStep | {
|
|
|
371
394
|
} | {
|
|
372
395
|
kind: "Take";
|
|
373
396
|
names: string[];
|
|
397
|
+
nameRanges?: SourceRange[];
|
|
374
398
|
bounds: Bound[];
|
|
375
399
|
} | {
|
|
376
400
|
kind: "Witness";
|
|
@@ -378,6 +402,7 @@ type StepBody = UseOrHide | Instance | DefineStep | {
|
|
|
378
402
|
} | {
|
|
379
403
|
kind: "Pick";
|
|
380
404
|
names: string[];
|
|
405
|
+
nameRanges?: SourceRange[];
|
|
381
406
|
bounds: Bound[];
|
|
382
407
|
body: Expression;
|
|
383
408
|
} | {
|
|
@@ -395,6 +420,7 @@ interface ProofStep {
|
|
|
395
420
|
token: string;
|
|
396
421
|
body: StepBody;
|
|
397
422
|
head: SourceRange;
|
|
423
|
+
statement: SourceRange;
|
|
398
424
|
proof: Proof | undefined;
|
|
399
425
|
location: SourceLocation;
|
|
400
426
|
}
|
|
@@ -405,11 +431,9 @@ interface Theorem {
|
|
|
405
431
|
location: SourceLocation;
|
|
406
432
|
}
|
|
407
433
|
type ModuleUnit = {
|
|
408
|
-
kind: "Constants";
|
|
409
|
-
declarations: Declaration[];
|
|
410
|
-
} | {
|
|
411
|
-
kind: "Variables";
|
|
434
|
+
kind: "Constants" | "Variables";
|
|
412
435
|
declarations: Declaration[];
|
|
436
|
+
location: SourceLocation;
|
|
413
437
|
} | {
|
|
414
438
|
kind: "Recursive";
|
|
415
439
|
declarations: Declaration[];
|
|
@@ -447,6 +471,7 @@ interface Module {
|
|
|
447
471
|
uses: UseOrHide[];
|
|
448
472
|
units: ModuleUnit[];
|
|
449
473
|
}
|
|
474
|
+
type TlcVersion = "1.7.4" | "master";
|
|
450
475
|
type ConfigValue = {
|
|
451
476
|
kind: "Number";
|
|
452
477
|
value: number;
|
|
@@ -493,7 +518,13 @@ interface ModelConfig {
|
|
|
493
518
|
periodic: string | undefined;
|
|
494
519
|
rlReward: string | undefined;
|
|
495
520
|
}
|
|
496
|
-
export declare const parseConfig: (source: string) => ModelConfig;
|
|
521
|
+
export declare const parseConfig: (source: string, version?: TlcVersion) => ModelConfig;
|
|
522
|
+
interface JavaOverride {
|
|
523
|
+
module: string;
|
|
524
|
+
operator: string;
|
|
525
|
+
signature: string;
|
|
526
|
+
isMatched: boolean;
|
|
527
|
+
}
|
|
497
528
|
export declare class TlaError extends Error {
|
|
498
529
|
constructor(message: string, cause?: unknown);
|
|
499
530
|
}
|
|
@@ -503,9 +534,20 @@ interface SyntaxFailure {
|
|
|
503
534
|
column: number;
|
|
504
535
|
isEnd: boolean;
|
|
505
536
|
}
|
|
537
|
+
interface SanyError {
|
|
538
|
+
location: string;
|
|
539
|
+
message: string;
|
|
540
|
+
}
|
|
541
|
+
interface SanyReport {
|
|
542
|
+
errors: SanyError[];
|
|
543
|
+
warnings: SanyError[];
|
|
544
|
+
isFatal: boolean;
|
|
545
|
+
parseError?: string;
|
|
546
|
+
}
|
|
506
547
|
export declare class TlaSyntaxError extends TlaError {
|
|
507
548
|
failure: SyntaxFailure | undefined;
|
|
508
|
-
|
|
549
|
+
sany: SanyReport | undefined;
|
|
550
|
+
constructor(message: string, cause?: unknown, failure?: SyntaxFailure, sany?: SanyReport);
|
|
509
551
|
}
|
|
510
552
|
export declare class TlaConfigError extends TlaError {
|
|
511
553
|
constructor(message: string, cause?: unknown);
|
|
@@ -539,6 +581,7 @@ interface FunctionValue {
|
|
|
539
581
|
hash: number;
|
|
540
582
|
fingerprint: number;
|
|
541
583
|
writtenKeys: Value[] | undefined;
|
|
584
|
+
functionClass: FunctionClass | undefined;
|
|
542
585
|
}
|
|
543
586
|
interface IntervalValue {
|
|
544
587
|
kind: "Interval";
|
|
@@ -577,10 +620,15 @@ interface SetOperationValue {
|
|
|
577
620
|
left: Value;
|
|
578
621
|
right: Value;
|
|
579
622
|
}
|
|
623
|
+
interface FilteredSetSource {
|
|
624
|
+
names: string;
|
|
625
|
+
predicate: string;
|
|
626
|
+
}
|
|
580
627
|
interface FilteredSetValue {
|
|
581
628
|
kind: "FilteredSet";
|
|
582
629
|
base: Value;
|
|
583
630
|
test: (element: Value) => boolean;
|
|
631
|
+
source?: FilteredSetSource;
|
|
584
632
|
}
|
|
585
633
|
interface UnionValue {
|
|
586
634
|
kind: "Union";
|
|
@@ -599,9 +647,22 @@ interface LazyFunctionValue {
|
|
|
599
647
|
domain: Value;
|
|
600
648
|
apply: (argument: Value) => Value;
|
|
601
649
|
source?: LazyFunctionSource;
|
|
650
|
+
functionClass?: FunctionClass;
|
|
602
651
|
}
|
|
603
652
|
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
653
|
+
type FunctionClass = "lambda" | "tuple" | "record";
|
|
604
654
|
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
655
|
+
interface FingerprintFailure {
|
|
656
|
+
sources: Expression[];
|
|
657
|
+
reason: string;
|
|
658
|
+
}
|
|
659
|
+
interface StateDump {
|
|
660
|
+
path: string;
|
|
661
|
+
dot?: boolean;
|
|
662
|
+
colorize?: boolean;
|
|
663
|
+
actionLabels?: boolean;
|
|
664
|
+
snapshot?: boolean;
|
|
665
|
+
}
|
|
605
666
|
interface CheckOptions {
|
|
606
667
|
source: string;
|
|
607
668
|
config: string | ModelConfig;
|
|
@@ -614,32 +675,111 @@ interface CheckOptions {
|
|
|
614
675
|
seed?: bigint;
|
|
615
676
|
workers?: number;
|
|
616
677
|
livenessCheck?: "default" | "final";
|
|
678
|
+
dump?: StateDump;
|
|
679
|
+
isTool?: boolean;
|
|
680
|
+
isTraceRecorded?: boolean;
|
|
681
|
+
isSanyReported?: boolean;
|
|
682
|
+
isWarningEnabled?: boolean;
|
|
683
|
+
version?: TlcVersion;
|
|
684
|
+
onProgress?: (progress: CheckProgress) => void;
|
|
685
|
+
}
|
|
686
|
+
interface InitialStatesProgress {
|
|
687
|
+
kind: "initial-states-progress";
|
|
688
|
+
count: number;
|
|
689
|
+
}
|
|
690
|
+
interface InitialStateViolation {
|
|
691
|
+
kind: "initial-state-violation";
|
|
692
|
+
status: "invariant-violation" | "liveness-violation";
|
|
693
|
+
name: string;
|
|
694
|
+
state: Record<string, Value>;
|
|
617
695
|
}
|
|
696
|
+
type OutputLine = string | InitialStatesProgress | InitialStateViolation;
|
|
697
|
+
type CheckProgress = {
|
|
698
|
+
kind: "parsed";
|
|
699
|
+
} | {
|
|
700
|
+
kind: "constant-level-invariant";
|
|
701
|
+
name: string;
|
|
702
|
+
} | {
|
|
703
|
+
kind: "state-level-property";
|
|
704
|
+
name: string;
|
|
705
|
+
} | {
|
|
706
|
+
kind: "liveness-initializing";
|
|
707
|
+
isSymmetric: boolean;
|
|
708
|
+
isConstrained: boolean;
|
|
709
|
+
} | {
|
|
710
|
+
kind: "liveness-prepared";
|
|
711
|
+
branches: number;
|
|
712
|
+
} | {
|
|
713
|
+
kind: "initial-states-started";
|
|
714
|
+
} | InitialStatesProgress | {
|
|
715
|
+
kind: "initial-states-computed";
|
|
716
|
+
initialStates: InitialStates;
|
|
717
|
+
} | {
|
|
718
|
+
kind: "progress";
|
|
719
|
+
statistics: SearchStatistics;
|
|
720
|
+
} | {
|
|
721
|
+
kind: "liveness-started";
|
|
722
|
+
branches: number;
|
|
723
|
+
isComplete: boolean;
|
|
724
|
+
states: number;
|
|
725
|
+
statistics: SearchStatistics;
|
|
726
|
+
} | {
|
|
727
|
+
kind: "liveness-finished";
|
|
728
|
+
} | {
|
|
729
|
+
kind: "warning";
|
|
730
|
+
code: number;
|
|
731
|
+
text: string;
|
|
732
|
+
} | ({
|
|
733
|
+
kind: "java-override";
|
|
734
|
+
} & JavaOverride);
|
|
735
|
+
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth"> {}
|
|
618
736
|
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
619
737
|
interface TraceStep {
|
|
620
738
|
action: string | undefined;
|
|
621
739
|
label: string | undefined;
|
|
622
740
|
state: Record<string, Value>;
|
|
741
|
+
output?: OutputLine[];
|
|
623
742
|
}
|
|
624
743
|
interface Violation {
|
|
625
744
|
name: string;
|
|
745
|
+
properties?: string[];
|
|
626
746
|
trace: TraceStep[];
|
|
747
|
+
traceOutput?: OutputLine[];
|
|
627
748
|
loopStart: number | undefined;
|
|
628
749
|
loopLabel?: string;
|
|
629
750
|
message?: string;
|
|
630
751
|
counts?: string;
|
|
631
752
|
unwitnessed?: Postcondition;
|
|
753
|
+
postcondition?: Postcondition;
|
|
754
|
+
warning?: {
|
|
755
|
+
code: number;
|
|
756
|
+
text: string;
|
|
757
|
+
};
|
|
632
758
|
}
|
|
633
759
|
interface Postcondition {
|
|
634
760
|
name: string;
|
|
761
|
+
code: number;
|
|
635
762
|
message: string;
|
|
636
763
|
counts?: string;
|
|
637
764
|
}
|
|
638
765
|
interface EvaluationFailure {
|
|
766
|
+
code: number;
|
|
639
767
|
message: string;
|
|
768
|
+
toolMessage: string;
|
|
640
769
|
trace: TraceStep[];
|
|
770
|
+
traceOutput?: OutputLine[];
|
|
641
771
|
initialState: Record<string, Value> | undefined;
|
|
642
772
|
exitCode: number;
|
|
773
|
+
callStack: Expression[] | undefined;
|
|
774
|
+
isCallStackFirst?: boolean;
|
|
775
|
+
fingerprint?: FingerprintFailure;
|
|
776
|
+
traceFailure?: FailureMessage;
|
|
777
|
+
postcondition?: Postcondition;
|
|
778
|
+
isWithoutStatistics?: boolean;
|
|
779
|
+
}
|
|
780
|
+
interface InitialStates {
|
|
781
|
+
generated: number;
|
|
782
|
+
distinct: number;
|
|
643
783
|
}
|
|
644
784
|
interface CheckResult {
|
|
645
785
|
status: CheckStatus;
|
|
@@ -649,9 +789,18 @@ interface CheckResult {
|
|
|
649
789
|
distinctStates: number;
|
|
650
790
|
queuedStates: number;
|
|
651
791
|
depth: number;
|
|
792
|
+
initialStates: InitialStates | undefined;
|
|
652
793
|
outDegrees: number[] | undefined;
|
|
653
794
|
fingerprintDistance: bigint | undefined;
|
|
795
|
+
additionalViolation?: Violation;
|
|
796
|
+
liveCallStack?: Expression[];
|
|
797
|
+
violationOutDegrees?: number[];
|
|
798
|
+
}
|
|
799
|
+
interface FailureMessage {
|
|
800
|
+
code: number;
|
|
801
|
+
message: string;
|
|
802
|
+
toolMessage: string;
|
|
654
803
|
}
|
|
655
804
|
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
656
805
|
export declare const parseModule: (source: string) => Module;
|
|
657
|
-
export type { CheckOptions, CheckResult, CheckStatus, ConfigValue, ConstantAssignment, EvaluationFailure, ModelConfig, Module, Substitution, TraceStep, Value, Violation };
|
|
806
|
+
export type { CheckOptions, CheckProgress, CheckResult, CheckStatus, ConfigValue, ConstantAssignment, EvaluationFailure, ModelConfig, Module, Substitution, TraceStep, Value, Violation };
|
package/dist/index.js
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import{
|
|
9
|
+
import{Z as e,at as t,ft as n,ot as r,pt as i,q as a,st as o,w as s}from"./transfer.js";import{t as c}from"./parallel.js";export{t as TlaConfigError,r as TlaError,o as TlaEvaluationError,n as TlaSyntaxError,i as TlaUnsupportedError,c as check,a as formatValue,e as parseConfig,s as parseModule};
|
package/dist/parallel-worker.cjs
CHANGED
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
const e=require("./transfer.cjs"),t=async()=>typeof globalThis.postMessage==`function`?globalThis:(await import(
|
|
10
10
|
/* @vite-ignore */
|
|
11
11
|
/* webpackIgnore: true */
|
|
12
|
-
`node:worker_threads`)).parentPort,n=(t,n)=>{let r=new Map(t.modules),i=e=>r.get(e),a=new Map(t.classes);e.
|
|
12
|
+
`node:worker_threads`)).parentPort,n=(t,n)=>{let r=new Map(t.modules),i=e=>r.get(e),a=new Map(t.classes);e.Y(e.x(t.source,t.config,i)),e.X(t.version);let o=e.J(),s=e.y(t.config,{source:t.source,loadModule:i,loadClass:e=>a.get(e),print:()=>{},files:{readFile:void 0,writeFile:void 0},isTool:t.isTool,isTraceRecorded:t.isTraceRecorded,isWarningEnabled:t.isWarningEnabled,version:t.version}).environment,c=e.u(t.config,s,()=>e.b(t.source,i,`variable`)),l=c?.spec.next;if(!c||l===void 0)return n.postMessage({type:`abort`});let u=t.index,d=e.G(),f=e.t(s.variables.length),p={fingerprints:t.fingerprints},m=t.requests,h=t.remaining,g=c.isSymmetric?e.r():void 0,_=/* @__PURE__ */ new Int32Array(2),v={resume:()=>{},loot:e=>{}};t.ports.forEach(e=>{e?.addEventListener(`message`,e=>v.loot(e.data)),e?.start?.()});let y={states:f(t.seed).map(d)},b=(n,r)=>{let i=Atomics.load(m,u)-1,a=Math.floor((n.end-n.origin-1)/2),o=e.n(),s=n.states.slice(n.end-a,n.end),c=a>0&&s.every(o.encode);c&&(n.end-=a);let l=c?o.finish():e.n().finish();t.ports[i]?.postMessage(l,[l.words.buffer]),Atomics.store(m,u,r),Atomics.notify(m,u)},x=e=>{Atomics.store(h,u,0),Atomics.compareExchange(m,u,0,-1)!==0&&b(e,-1)},S=e=>{Atomics.store(h,u,e.end-e.origin),Atomics.store(m,u,0)},C=n=>{for(;n.origin<n.end;n.origin++){let r=n.states[n.origin];if(!n.successors&&(Atomics.load(m,u)>0&&b(n,0),Atomics.store(h,u,n.end-n.origin-1),n.successors=e.F(l,r,s,c.spec.scope),n.generated+=n.successors.length,n.successors.length===0&&t.config.checkDeadlock))return;let i=n.successors;for(;n.index<i.length;n.index++){if(e.s(p.fingerprints))return`paused`;let t=i[n.index];if(c.findViolatedActionProperty(r,t.state))return;if(!c.satisfiesActionConstraints(r,t.state)){if(c.findViolatedInvariant(t.state,r))return;continue}if(g&&(e.c(t.state,_),!g.insert(_[0],_[1])))continue;d(t.state);let a=c.getFingerprintState(t.state);if(e.c(a,_),e.o(p.fingerprints,_[0],_[1])){if(c.findViolatedInvariant(t.state,r))return;c.satisfiesConstraints(t.state,r)&&(n.next.push(t.state),n.fingerprintStates.push(a),n.added++)}}n.outDegrees[Math.min(n.added,31)]++,n.successors=void 0,n.index=0,n.added=0}return`done`},w=async e=>{let n=/* @__PURE__ */ new Set;for(;;){let r=t.ports.reduce((e,t,r)=>!t||n.has(r)||Atomics.load(h,r)<2?e:e===void 0||Atomics.load(h,r)>Atomics.load(h,e)?r:e,void 0);if(r===void 0)return!1;let i=Atomics.compareExchange(m,r,0,u+1);if(i===-1&&n.add(r),i>0&&Atomics.wait(m,r,i),i!==0)continue;let a=await new Promise(e=>v.loot=e);if(a.count===0)n.add(r);else return e.states=f(a).map(d),e.origin=0,e.end=e.states.length,S(e),!0}},T=e=>n.postMessage(e,e.type===`level`?[e.fingerprints.buffer]:[]),E=async t=>{let n={states:y.states,origin:0,end:y.states.length,successors:void 0,index:0,added:0,generated:0,outDegrees:Array.from({length:32},()=>0),next:[],fingerprintStates:[]};for(;;){let e=C(n);if(e===void 0)return;if(x(n),e===`paused`){let e=new Promise(e=>v.resume=e);T({type:`paused`}),await e,S(n)}else if(!await w(n))break}if(e.J()===o)return y.states=n.next,Atomics.store(h,u,y.states.length),{type:`level`,level:t,generated:n.generated,added:n.next.length,outDegrees:n.outDegrees,fingerprints:c.getStoredFingerprints(n.next,n.fingerprintStates)}},D=e=>{E(e).then(e=>T(e??{type:`abort`}),()=>T({type:`abort`}))};n.addEventListener(`message`,e=>{let t=e.data;t.type===`level`&&D(t.level),t.type===`resize`&&(p.fingerprints=t.fingerprints,v.resume())}),Atomics.store(h,u,y.states.length),T({type:`ready`})};t().then(e=>{let t=r=>{let i=r.data;if(i.type===`start`){e.removeEventListener?.(`message`,t);try{n(i,e)}catch{e.postMessage({type:`abort`})}}};e.addEventListener(`message`,t),e.start?.()});
|
package/dist/parallel-worker.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import{
|
|
9
|
+
import{F as e,G as t,J as n,X as r,Y as i,b as a,c as o,n as s,o as c,r as l,s as u,t as d,u as f,x as p,y as m}from"./transfer.js";const h=async()=>typeof globalThis.postMessage==`function`?globalThis:(await import(
|
|
10
10
|
/* @vite-ignore */
|
|
11
11
|
/* webpackIgnore: true */
|
|
12
|
-
`node:worker_threads`)).parentPort,
|
|
12
|
+
`node:worker_threads`)).parentPort,g=(h,g)=>{let _=new Map(h.modules),v=e=>_.get(e),y=new Map(h.classes);i(p(h.source,h.config,v)),r(h.version);let b=n(),x=m(h.config,{source:h.source,loadModule:v,loadClass:e=>y.get(e),print:()=>{},files:{readFile:void 0,writeFile:void 0},isTool:h.isTool,isTraceRecorded:h.isTraceRecorded,isWarningEnabled:h.isWarningEnabled,version:h.version}).environment,S=f(h.config,x,()=>a(h.source,v,`variable`)),C=S?.spec.next;if(!S||C===void 0)return g.postMessage({type:`abort`});let w=h.index,T=t(),E=d(x.variables.length),D={fingerprints:h.fingerprints},O=h.requests,k=h.remaining,A=S.isSymmetric?l():void 0,j=/* @__PURE__ */ new Int32Array(2),M={resume:()=>{},loot:e=>{}};h.ports.forEach(e=>{e?.addEventListener(`message`,e=>M.loot(e.data)),e?.start?.()});let N={states:E(h.seed).map(T)},P=(e,t)=>{let n=Atomics.load(O,w)-1,r=Math.floor((e.end-e.origin-1)/2),i=s(),a=e.states.slice(e.end-r,e.end),o=r>0&&a.every(i.encode);o&&(e.end-=r);let c=o?i.finish():s().finish();h.ports[n]?.postMessage(c,[c.words.buffer]),Atomics.store(O,w,t),Atomics.notify(O,w)},F=e=>{Atomics.store(k,w,0),Atomics.compareExchange(O,w,0,-1)!==0&&P(e,-1)},I=e=>{Atomics.store(k,w,e.end-e.origin),Atomics.store(O,w,0)},L=t=>{for(;t.origin<t.end;t.origin++){let n=t.states[t.origin];if(!t.successors&&(Atomics.load(O,w)>0&&P(t,0),Atomics.store(k,w,t.end-t.origin-1),t.successors=e(C,n,x,S.spec.scope),t.generated+=t.successors.length,t.successors.length===0&&h.config.checkDeadlock))return;let r=t.successors;for(;t.index<r.length;t.index++){if(u(D.fingerprints))return`paused`;let e=r[t.index];if(S.findViolatedActionProperty(n,e.state))return;if(!S.satisfiesActionConstraints(n,e.state)){if(S.findViolatedInvariant(e.state,n))return;continue}if(A&&(o(e.state,j),!A.insert(j[0],j[1])))continue;T(e.state);let i=S.getFingerprintState(e.state);if(o(i,j),c(D.fingerprints,j[0],j[1])){if(S.findViolatedInvariant(e.state,n))return;S.satisfiesConstraints(e.state,n)&&(t.next.push(e.state),t.fingerprintStates.push(i),t.added++)}}t.outDegrees[Math.min(t.added,31)]++,t.successors=void 0,t.index=0,t.added=0}return`done`},R=async e=>{let t=/* @__PURE__ */ new Set;for(;;){let n=h.ports.reduce((e,n,r)=>!n||t.has(r)||Atomics.load(k,r)<2?e:e===void 0||Atomics.load(k,r)>Atomics.load(k,e)?r:e,void 0);if(n===void 0)return!1;let r=Atomics.compareExchange(O,n,0,w+1);if(r===-1&&t.add(n),r>0&&Atomics.wait(O,n,r),r!==0)continue;let i=await new Promise(e=>M.loot=e);if(i.count===0)t.add(n);else return e.states=E(i).map(T),e.origin=0,e.end=e.states.length,I(e),!0}},z=e=>g.postMessage(e,e.type===`level`?[e.fingerprints.buffer]:[]),B=async e=>{let t={states:N.states,origin:0,end:N.states.length,successors:void 0,index:0,added:0,generated:0,outDegrees:Array.from({length:32},()=>0),next:[],fingerprintStates:[]};for(;;){let e=L(t);if(e===void 0)return;if(F(t),e===`paused`){let e=new Promise(e=>M.resume=e);z({type:`paused`}),await e,I(t)}else if(!await R(t))break}if(n()===b)return N.states=t.next,Atomics.store(k,w,N.states.length),{type:`level`,level:e,generated:t.generated,added:t.next.length,outDegrees:t.outDegrees,fingerprints:S.getStoredFingerprints(t.next,t.fingerprintStates)}},V=e=>{B(e).then(e=>z(e??{type:`abort`}),()=>z({type:`abort`}))};g.addEventListener(`message`,e=>{let t=e.data;t.type===`level`&&V(t.level),t.type===`resize`&&(D.fingerprints=t.fingerprints,M.resume())}),Atomics.store(k,w,N.states.length),z({type:`ready`})};h().then(e=>{let t=n=>{let r=n.data;if(r.type===`start`){e.removeEventListener?.(`message`,t);try{g(r,e)}catch{e.postMessage({type:`abort`})}}};e.addEventListener(`message`,t),e.start?.()});
|
package/dist/parallel.cjs
CHANGED
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
const e=require("./transfer.cjs"),t=async e=>{if(typeof Worker==`function`){let t=new Worker(new URL(`./parallel-worker.js`,require("url").pathToFileURL(__filename).href),{type:`module`});return t.addEventListener(`message`,t=>e(t.data)),t.addEventListener(`error`,()=>e({type:`abort`})),t}let t=new(await(import(
|
|
10
10
|
/* @vite-ignore */
|
|
11
11
|
/* webpackIgnore: true */
|
|
12
|
-
`node:worker_threads`))).Worker(new URL(`./parallel-worker.js`,require("url").pathToFileURL(__filename).href));return t.on(`message`,e),t.on(`error`,()=>e({type:`abort`})),{postMessage:(e,n)=>t.postMessage(e,n),terminate:()=>void t.terminate()}},n=async n=>{let r=typeof n.config==`string`?e.
|
|
12
|
+
`node:worker_threads`))).Worker(new URL(`./parallel-worker.js`,require("url").pathToFileURL(__filename).href));return t.on(`message`,e),t.on(`error`,()=>e({type:`abort`})),{postMessage:(e,n)=>t.postMessage(e,n),terminate:()=>void t.terminate()}},n=async n=>{let r=typeof n.config==`string`?e.Z(n.config,n.version):n.config,i=n.onPrint??console.log,a={count:0},o=e=>[e.kind,`name`in e?e.name:``,`count`in e?e.count:``,`text`in e?e.text:``].join(` `),s=/* @__PURE__ */ new Set,c=e=>{s.add(o(e)),n.onProgress?.(e)},l=()=>{let t={count:a.count};return e.l({...n,config:r,onPrint:e=>t.count-->0?void 0:i(e),onProgress:e=>{s.has(o(e))||n.onProgress?.(e)}})},u=n.workers??1;if(u<2||typeof SharedArrayBuffer!=`function`||n.dump!==void 0||r.view!==void 0||r.postconditions.length>0||r.possible.length>0)return l();let d=/* @__PURE__ */ new Map,f=e=>{let t=n.loadModule?.(e);return d.set(e,t),t},p=/* @__PURE__ */ new Map,m=e=>{let t=n.loadClass?.(e);return p.set(e,t),t};e.Y(e.x(n.source,r,f)),e.X(n.version);let h=e.J(),g=e.y(r,{source:n.source,loadModule:f,loadClass:m,print:e=>{a.count++,i(e)},files:{readFile:n.readFile,writeFile:n.writeFile},isTool:n.isTool,isTraceRecorded:n.isTraceRecorded,isSanyReported:n.isSanyReported,isWarningEnabled:n.isWarningEnabled,version:n.version});e.p(g,r,c);let _=g.environment,v=e.u(r,_,()=>e.S(n.source,f),c);if(e.d(g.assumptions,_)||!v||v.spec.init===void 0||v.spec.next===void 0||v.properties.liveness.length>0||e.N(_))return l();let y=e.G(),b={fingerprints:e.i()},x=/* @__PURE__ */ new Int32Array(2),S=Array.from({length:u},e.n),C={generatedStates:0,distinctStates:0,queuedStates:0,depth:0,initialStates:void 0,outDegrees:Array.from({length:32},()=>0)},w=[],T=()=>({status:`success`,violation:void 0,failure:void 0,...C,fingerprintDistance:e.g(C.distinctStates,C.generatedStates,()=>{let e=new BigInt64Array(C.distinctStates);return w.reduce((t,n)=>(e.set(n,t),t+n.length),0),e})}),E=t=>{let n=[];for(let r of e.P(t,_,v.spec.scope))if(e.f(C.generatedStates,c),y(r),C.generatedStates++,e.c(v.getFingerprintState(r),x),e.s(b.fingerprints)&&(b.fingerprints=e.a(b.fingerprints)),e.o(b.fingerprints,x[0],x[1])){if(v.findViolatedInvariant(r)||v.findFailedInitialPredicate(r))return!1;if(v.satisfiesConstraints(r)){if(!S[n.length%u].encode(r))return!1;n.push(r),C.distinctStates++}}return w.push(BigInt64Array.from(n,e=>_.runtime.getFingerprint(e))),!0};c({kind:`initial-states-started`});try{if(!E(v.spec.init))return l()}catch(t){if(!(t instanceof e.st))throw t;return l()}if(e.J()!==h)return l();if(C.depth=C.generatedStates===0?0:1,C.initialStates={generated:C.generatedStates,distinct:C.distinctStates},c({kind:`initial-states-computed`,initialStates:C.initialStates}),C.distinctStates===0)return T();let D=[],O={count:u,resolve:e=>{}},k=e=>{D.push(e),(e.type===`abort`||D.length===O.count)&&O.resolve(D.splice(0))},A=e=>new Promise(t=>{O.count=e,O.resolve=t}),j=A(u),M=new Int32Array(new SharedArrayBuffer(u*4)),N=new Int32Array(new SharedArrayBuffer(u*4)),P=await Promise.all(Array.from({length:u},()=>t(k))),F=()=>P.forEach(e=>e.terminate()),I=/* @__PURE__ */ new Map,L=(e,t)=>{let n=e<t?`${e}:${t}`:`${t}:${e}`,r=I.get(n)??new MessageChannel;return I.set(n,r),e<t?r.port1:r.port2};P.forEach((e,t)=>{let i=Array.from({length:u},(e,n)=>n===t?void 0:L(t,n)),a=S[t].finish(),o={type:`start`,source:n.source,config:r,modules:[...d],classes:[...p],index:t,ports:i,seed:a,isTool:n.isTool,isTraceRecorded:n.isTraceRecorded,isWarningEnabled:n.isWarningEnabled,version:n.version,fingerprints:b.fingerprints,requests:M,remaining:N};e.postMessage(o,[...i.filter(e=>e!==void 0),a.words.buffer])});let R=e=>e.some(e=>e.type===`abort`),z=e=>P.forEach(t=>t.postMessage(e)),B=async t=>{let n=t.filter(e=>e.type===`paused`).length;if(n===0||R(t))return t;b.fingerprints=e.a(b.fingerprints);let r=A(n);return z({type:`resize`,fingerprints:b.fingerprints}),[...t.filter(e=>e.type!==`paused`),...await B(await r)]};if(R(await j))return F(),l();for(let e=1;;e++){let t=A(u);M.forEach((e,t)=>Atomics.store(M,t,0)),z({type:`level`,level:e});let n=await B(await t);if(R(n))return F(),l();let r=n.flatMap(e=>e.type===`level`?[e]:[]),i=r.reduce((e,t)=>e+t.added,0);if(C.generatedStates+=r.reduce((e,t)=>e+t.generated,0),C.distinctStates+=i,r.forEach(e=>{e.outDegrees.forEach((e,t)=>C.outDegrees[t]+=e),w.push(e.fingerprints)}),i===0)return F(),T();C.depth++}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/dist/parallel.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import{
|
|
9
|
+
import{G as e,J as t,N as n,P as r,S as i,X as ee,Y as te,Z as a,a as o,c as ne,d as s,f as c,g as l,i as u,l as d,n as f,o as re,p,s as ie,st as m,u as h,x as g,y as _}from"./transfer.js";const ae=async e=>{if(typeof Worker==`function`){let t=new Worker(new URL(`./parallel-worker.js`,import.meta.url),{type:`module`});return t.addEventListener(`message`,t=>e(t.data)),t.addEventListener(`error`,()=>e({type:`abort`})),t}let t=new(await(import(
|
|
10
10
|
/* @vite-ignore */
|
|
11
11
|
/* webpackIgnore: true */
|
|
12
|
-
`node:worker_threads`))).Worker(new URL(`./parallel-worker.js`,import.meta.url));return t.on(`message`,e),t.on(`error`,()=>e({type:`abort`})),{postMessage:(e,n)=>t.postMessage(e,n),terminate:()=>void t.terminate()}},
|
|
12
|
+
`node:worker_threads`))).Worker(new URL(`./parallel-worker.js`,import.meta.url));return t.on(`message`,e),t.on(`error`,()=>e({type:`abort`})),{postMessage:(e,n)=>t.postMessage(e,n),terminate:()=>void t.terminate()}},v=async v=>{let y=typeof v.config==`string`?a(v.config,v.version):v.config,b=v.onPrint??console.log,x={count:0},S=e=>[e.kind,`name`in e?e.name:``,`count`in e?e.count:``,`text`in e?e.text:``].join(` `),C=/* @__PURE__ */ new Set,w=e=>{C.add(S(e)),v.onProgress?.(e)},T=()=>{let e={count:x.count};return d({...v,config:y,onPrint:t=>e.count-->0?void 0:b(t),onProgress:e=>{C.has(S(e))||v.onProgress?.(e)}})},E=v.workers??1;if(E<2||typeof SharedArrayBuffer!=`function`||v.dump!==void 0||y.view!==void 0||y.postconditions.length>0||y.possible.length>0)return T();let D=/* @__PURE__ */ new Map,O=e=>{let t=v.loadModule?.(e);return D.set(e,t),t},k=/* @__PURE__ */ new Map,A=e=>{let t=v.loadClass?.(e);return k.set(e,t),t};te(g(v.source,y,O)),ee(v.version);let oe=t(),j=_(y,{source:v.source,loadModule:O,loadClass:A,print:e=>{x.count++,b(e)},files:{readFile:v.readFile,writeFile:v.writeFile},isTool:v.isTool,isTraceRecorded:v.isTraceRecorded,isSanyReported:v.isSanyReported,isWarningEnabled:v.isWarningEnabled,version:v.version});p(j,y,w);let M=j.environment,N=h(y,M,()=>i(v.source,O),w);if(s(j.assumptions,M)||!N||N.spec.init===void 0||N.spec.next===void 0||N.properties.liveness.length>0||n(M))return T();let P=e(),F={fingerprints:u()},I=/* @__PURE__ */ new Int32Array(2),L=Array.from({length:E},f),R={generatedStates:0,distinctStates:0,queuedStates:0,depth:0,initialStates:void 0,outDegrees:Array.from({length:32},()=>0)},z=[],B=()=>({status:`success`,violation:void 0,failure:void 0,...R,fingerprintDistance:l(R.distinctStates,R.generatedStates,()=>{let e=new BigInt64Array(R.distinctStates);return z.reduce((t,n)=>(e.set(n,t),t+n.length),0),e})}),V=e=>{let t=[];for(let n of r(e,M,N.spec.scope))if(c(R.generatedStates,w),P(n),R.generatedStates++,ne(N.getFingerprintState(n),I),ie(F.fingerprints)&&(F.fingerprints=o(F.fingerprints)),re(F.fingerprints,I[0],I[1])){if(N.findViolatedInvariant(n)||N.findFailedInitialPredicate(n))return!1;if(N.satisfiesConstraints(n)){if(!L[t.length%E].encode(n))return!1;t.push(n),R.distinctStates++}}return z.push(BigInt64Array.from(t,e=>M.runtime.getFingerprint(e))),!0};w({kind:`initial-states-started`});try{if(!V(N.spec.init))return T()}catch(e){if(!(e instanceof m))throw e;return T()}if(t()!==oe)return T();if(R.depth=R.generatedStates===0?0:1,R.initialStates={generated:R.generatedStates,distinct:R.distinctStates},w({kind:`initial-states-computed`,initialStates:R.initialStates}),R.distinctStates===0)return B();let H=[],U={count:E,resolve:e=>{}},W=e=>{H.push(e),(e.type===`abort`||H.length===U.count)&&U.resolve(H.splice(0))},G=e=>new Promise(t=>{U.count=e,U.resolve=t}),K=G(E),q=new Int32Array(new SharedArrayBuffer(E*4)),se=new Int32Array(new SharedArrayBuffer(E*4)),J=await Promise.all(Array.from({length:E},()=>ae(W))),Y=()=>J.forEach(e=>e.terminate()),X=/* @__PURE__ */ new Map,ce=(e,t)=>{let n=e<t?`${e}:${t}`:`${t}:${e}`,r=X.get(n)??new MessageChannel;return X.set(n,r),e<t?r.port1:r.port2};J.forEach((e,t)=>{let n=Array.from({length:E},(e,n)=>n===t?void 0:ce(t,n)),r=L[t].finish(),i={type:`start`,source:v.source,config:y,modules:[...D],classes:[...k],index:t,ports:n,seed:r,isTool:v.isTool,isTraceRecorded:v.isTraceRecorded,isWarningEnabled:v.isWarningEnabled,version:v.version,fingerprints:F.fingerprints,requests:q,remaining:se};e.postMessage(i,[...n.filter(e=>e!==void 0),r.words.buffer])});let Z=e=>e.some(e=>e.type===`abort`),Q=e=>J.forEach(t=>t.postMessage(e)),$=async e=>{let t=e.filter(e=>e.type===`paused`).length;if(t===0||Z(e))return e;F.fingerprints=o(F.fingerprints);let n=G(t);return Q({type:`resize`,fingerprints:F.fingerprints}),[...e.filter(e=>e.type!==`paused`),...await $(await n)]};if(Z(await K))return Y(),T();for(let e=1;;e++){let t=G(E);q.forEach((e,t)=>Atomics.store(q,t,0)),Q({type:`level`,level:e});let n=await $(await t);if(Z(n))return Y(),T();let r=n.flatMap(e=>e.type===`level`?[e]:[]),i=r.reduce((e,t)=>e+t.added,0);if(R.generatedStates+=r.reduce((e,t)=>e+t.generated,0),R.distinctStates+=i,r.forEach(e=>{e.outDegrees.forEach((e,t)=>R.outDegrees[t]+=e),z.push(e.fingerprints)}),i===0)return Y(),B();R.depth++}};export{v as t};
|