tla-ts 0.0.3-dev.3cf2ad0 → 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/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 +158 -8
- package/dist/index.d.ts +158 -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 +88 -18
- package/dist/transfer.js +88 -18
- package/package.json +5 -1
- package/src/ast.ts +146 -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 +524 -140
- 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 +37 -5
- 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 +436 -144
- 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 +1424 -415
- 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 +189 -53
- 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,32 +38,41 @@ 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;
|
|
68
|
+
operator?: string;
|
|
61
69
|
location: SourceLocation;
|
|
62
70
|
}
|
|
63
71
|
interface JunctionExpression {
|
|
64
72
|
kind: "And" | "Or";
|
|
65
73
|
operands: Expression[];
|
|
66
74
|
isBulleted?: boolean;
|
|
75
|
+
prefixEnds?: SourceLocation[];
|
|
67
76
|
location: SourceLocation;
|
|
68
77
|
}
|
|
69
78
|
interface PrimeExpression {
|
|
@@ -108,9 +117,11 @@ interface LetExpression {
|
|
|
108
117
|
type BoundPattern = {
|
|
109
118
|
kind: "Name";
|
|
110
119
|
name: string;
|
|
120
|
+
ranges?: SourceRange[];
|
|
111
121
|
} | {
|
|
112
122
|
kind: "Tuple";
|
|
113
123
|
names: string[];
|
|
124
|
+
ranges?: SourceRange[];
|
|
114
125
|
};
|
|
115
126
|
interface Bound {
|
|
116
127
|
pattern: BoundPattern;
|
|
@@ -126,6 +137,7 @@ interface UnboundedQuantifierExpression {
|
|
|
126
137
|
kind: "UnboundedQuantifier";
|
|
127
138
|
quantifier: "Forall" | "Exists";
|
|
128
139
|
names: string[];
|
|
140
|
+
nameRanges?: SourceRange[];
|
|
129
141
|
isTemporal?: boolean;
|
|
130
142
|
body: Expression;
|
|
131
143
|
location: SourceLocation;
|
|
@@ -175,6 +187,7 @@ interface FunctionSetExpression {
|
|
|
175
187
|
interface RecordField {
|
|
176
188
|
name: string;
|
|
177
189
|
value: Expression;
|
|
190
|
+
location: SourceLocation;
|
|
178
191
|
}
|
|
179
192
|
interface RecordExpression {
|
|
180
193
|
kind: "Record" | "RecordSet";
|
|
@@ -208,6 +221,11 @@ interface FunctionApplicationExpression {
|
|
|
208
221
|
args: Expression[];
|
|
209
222
|
location: SourceLocation;
|
|
210
223
|
}
|
|
224
|
+
interface BracketExpression {
|
|
225
|
+
kind: "Bracket";
|
|
226
|
+
args: Expression[];
|
|
227
|
+
location: SourceLocation;
|
|
228
|
+
}
|
|
211
229
|
interface FieldAccessExpression {
|
|
212
230
|
kind: "FieldAccess";
|
|
213
231
|
record: Expression;
|
|
@@ -241,6 +259,7 @@ interface LabelExpression {
|
|
|
241
259
|
kind: "Label";
|
|
242
260
|
name: string;
|
|
243
261
|
params: string[];
|
|
262
|
+
paramRanges?: SourceRange[];
|
|
244
263
|
body: Expression;
|
|
245
264
|
location: SourceLocation;
|
|
246
265
|
}
|
|
@@ -262,9 +281,11 @@ type Selector = {
|
|
|
262
281
|
interface SubexpressionExpression {
|
|
263
282
|
kind: "Subexpression";
|
|
264
283
|
selectors: Selector[];
|
|
284
|
+
selectorRanges?: SourceRange[];
|
|
285
|
+
argumentRanges?: (SourceRange | undefined)[];
|
|
265
286
|
location: SourceLocation;
|
|
266
287
|
}
|
|
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;
|
|
288
|
+
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
289
|
interface OperatorParam {
|
|
269
290
|
name: string;
|
|
270
291
|
arity: number;
|
|
@@ -287,6 +308,7 @@ interface FunctionDefinition {
|
|
|
287
308
|
body: Expression;
|
|
288
309
|
isLocal: boolean;
|
|
289
310
|
isRecursive: boolean;
|
|
311
|
+
isSelfReferential?: boolean;
|
|
290
312
|
location: SourceLocation;
|
|
291
313
|
}
|
|
292
314
|
type Definition = OperatorDefinition | FunctionDefinition;
|
|
@@ -303,6 +325,7 @@ interface Assumption {
|
|
|
303
325
|
}
|
|
304
326
|
interface InstanceSubstitution {
|
|
305
327
|
name: string;
|
|
328
|
+
nameRange: SourceRange;
|
|
306
329
|
expression: Expression;
|
|
307
330
|
}
|
|
308
331
|
interface Instance {
|
|
@@ -322,6 +345,7 @@ interface NewSymbol {
|
|
|
322
345
|
arity: number;
|
|
323
346
|
level: "Constant" | "Variable" | "State" | "Action" | "Temporal";
|
|
324
347
|
set: Expression | undefined;
|
|
348
|
+
nameRange?: SourceRange;
|
|
325
349
|
location: SourceLocation;
|
|
326
350
|
}
|
|
327
351
|
interface AssumeProve {
|
|
@@ -371,6 +395,7 @@ type StepBody = UseOrHide | Instance | DefineStep | {
|
|
|
371
395
|
} | {
|
|
372
396
|
kind: "Take";
|
|
373
397
|
names: string[];
|
|
398
|
+
nameRanges?: SourceRange[];
|
|
374
399
|
bounds: Bound[];
|
|
375
400
|
} | {
|
|
376
401
|
kind: "Witness";
|
|
@@ -378,6 +403,7 @@ type StepBody = UseOrHide | Instance | DefineStep | {
|
|
|
378
403
|
} | {
|
|
379
404
|
kind: "Pick";
|
|
380
405
|
names: string[];
|
|
406
|
+
nameRanges?: SourceRange[];
|
|
381
407
|
bounds: Bound[];
|
|
382
408
|
body: Expression;
|
|
383
409
|
} | {
|
|
@@ -395,6 +421,7 @@ interface ProofStep {
|
|
|
395
421
|
token: string;
|
|
396
422
|
body: StepBody;
|
|
397
423
|
head: SourceRange;
|
|
424
|
+
statement: SourceRange;
|
|
398
425
|
proof: Proof | undefined;
|
|
399
426
|
location: SourceLocation;
|
|
400
427
|
}
|
|
@@ -405,11 +432,9 @@ interface Theorem {
|
|
|
405
432
|
location: SourceLocation;
|
|
406
433
|
}
|
|
407
434
|
type ModuleUnit = {
|
|
408
|
-
kind: "Constants";
|
|
409
|
-
declarations: Declaration[];
|
|
410
|
-
} | {
|
|
411
|
-
kind: "Variables";
|
|
435
|
+
kind: "Constants" | "Variables";
|
|
412
436
|
declarations: Declaration[];
|
|
437
|
+
location: SourceLocation;
|
|
413
438
|
} | {
|
|
414
439
|
kind: "Recursive";
|
|
415
440
|
declarations: Declaration[];
|
|
@@ -447,6 +472,7 @@ interface Module {
|
|
|
447
472
|
uses: UseOrHide[];
|
|
448
473
|
units: ModuleUnit[];
|
|
449
474
|
}
|
|
475
|
+
type TlcVersion = "1.7.4" | "master";
|
|
450
476
|
type ConfigValue = {
|
|
451
477
|
kind: "Number";
|
|
452
478
|
value: number;
|
|
@@ -493,7 +519,13 @@ interface ModelConfig {
|
|
|
493
519
|
periodic: string | undefined;
|
|
494
520
|
rlReward: string | undefined;
|
|
495
521
|
}
|
|
496
|
-
export declare const parseConfig: (source: string) => ModelConfig;
|
|
522
|
+
export declare const parseConfig: (source: string, version?: TlcVersion) => ModelConfig;
|
|
523
|
+
interface JavaOverride {
|
|
524
|
+
module: string;
|
|
525
|
+
operator: string;
|
|
526
|
+
signature: string;
|
|
527
|
+
isMatched: boolean;
|
|
528
|
+
}
|
|
497
529
|
export declare class TlaError extends Error {
|
|
498
530
|
constructor(message: string, cause?: unknown);
|
|
499
531
|
}
|
|
@@ -503,9 +535,20 @@ interface SyntaxFailure {
|
|
|
503
535
|
column: number;
|
|
504
536
|
isEnd: boolean;
|
|
505
537
|
}
|
|
538
|
+
interface SanyError {
|
|
539
|
+
location: string;
|
|
540
|
+
message: string;
|
|
541
|
+
}
|
|
542
|
+
interface SanyReport {
|
|
543
|
+
errors: SanyError[];
|
|
544
|
+
warnings: SanyError[];
|
|
545
|
+
isFatal: boolean;
|
|
546
|
+
parseError?: string;
|
|
547
|
+
}
|
|
506
548
|
export declare class TlaSyntaxError extends TlaError {
|
|
507
549
|
failure: SyntaxFailure | undefined;
|
|
508
|
-
|
|
550
|
+
sany: SanyReport | undefined;
|
|
551
|
+
constructor(message: string, cause?: unknown, failure?: SyntaxFailure, sany?: SanyReport);
|
|
509
552
|
}
|
|
510
553
|
export declare class TlaConfigError extends TlaError {
|
|
511
554
|
constructor(message: string, cause?: unknown);
|
|
@@ -539,6 +582,7 @@ interface FunctionValue {
|
|
|
539
582
|
hash: number;
|
|
540
583
|
fingerprint: number;
|
|
541
584
|
writtenKeys: Value[] | undefined;
|
|
585
|
+
functionClass: FunctionClass | undefined;
|
|
542
586
|
}
|
|
543
587
|
interface IntervalValue {
|
|
544
588
|
kind: "Interval";
|
|
@@ -577,10 +621,15 @@ interface SetOperationValue {
|
|
|
577
621
|
left: Value;
|
|
578
622
|
right: Value;
|
|
579
623
|
}
|
|
624
|
+
interface FilteredSetSource {
|
|
625
|
+
names: string;
|
|
626
|
+
predicate: string;
|
|
627
|
+
}
|
|
580
628
|
interface FilteredSetValue {
|
|
581
629
|
kind: "FilteredSet";
|
|
582
630
|
base: Value;
|
|
583
631
|
test: (element: Value) => boolean;
|
|
632
|
+
source?: FilteredSetSource;
|
|
584
633
|
}
|
|
585
634
|
interface UnionValue {
|
|
586
635
|
kind: "Union";
|
|
@@ -599,9 +648,22 @@ interface LazyFunctionValue {
|
|
|
599
648
|
domain: Value;
|
|
600
649
|
apply: (argument: Value) => Value;
|
|
601
650
|
source?: LazyFunctionSource;
|
|
651
|
+
functionClass?: FunctionClass;
|
|
602
652
|
}
|
|
603
653
|
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
654
|
+
type FunctionClass = "lambda" | "tuple" | "record";
|
|
604
655
|
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
656
|
+
interface FingerprintFailure {
|
|
657
|
+
sources: Expression[];
|
|
658
|
+
reason: string;
|
|
659
|
+
}
|
|
660
|
+
interface StateDump {
|
|
661
|
+
path: string;
|
|
662
|
+
dot?: boolean;
|
|
663
|
+
colorize?: boolean;
|
|
664
|
+
actionLabels?: boolean;
|
|
665
|
+
snapshot?: boolean;
|
|
666
|
+
}
|
|
605
667
|
interface CheckOptions {
|
|
606
668
|
source: string;
|
|
607
669
|
config: string | ModelConfig;
|
|
@@ -614,32 +676,111 @@ interface CheckOptions {
|
|
|
614
676
|
seed?: bigint;
|
|
615
677
|
workers?: number;
|
|
616
678
|
livenessCheck?: "default" | "final";
|
|
679
|
+
dump?: StateDump;
|
|
680
|
+
isTool?: boolean;
|
|
681
|
+
isTraceRecorded?: boolean;
|
|
682
|
+
isSanyReported?: boolean;
|
|
683
|
+
isWarningEnabled?: boolean;
|
|
684
|
+
version?: TlcVersion;
|
|
685
|
+
onProgress?: (progress: CheckProgress) => void;
|
|
686
|
+
}
|
|
687
|
+
interface InitialStatesProgress {
|
|
688
|
+
kind: "initial-states-progress";
|
|
689
|
+
count: number;
|
|
690
|
+
}
|
|
691
|
+
interface InitialStateViolation {
|
|
692
|
+
kind: "initial-state-violation";
|
|
693
|
+
status: "invariant-violation" | "liveness-violation";
|
|
694
|
+
name: string;
|
|
695
|
+
state: Record<string, Value>;
|
|
617
696
|
}
|
|
697
|
+
type OutputLine = string | InitialStatesProgress | InitialStateViolation;
|
|
698
|
+
type CheckProgress = {
|
|
699
|
+
kind: "parsed";
|
|
700
|
+
} | {
|
|
701
|
+
kind: "constant-level-invariant";
|
|
702
|
+
name: string;
|
|
703
|
+
} | {
|
|
704
|
+
kind: "state-level-property";
|
|
705
|
+
name: string;
|
|
706
|
+
} | {
|
|
707
|
+
kind: "liveness-initializing";
|
|
708
|
+
isSymmetric: boolean;
|
|
709
|
+
isConstrained: boolean;
|
|
710
|
+
} | {
|
|
711
|
+
kind: "liveness-prepared";
|
|
712
|
+
branches: number;
|
|
713
|
+
} | {
|
|
714
|
+
kind: "initial-states-started";
|
|
715
|
+
} | InitialStatesProgress | {
|
|
716
|
+
kind: "initial-states-computed";
|
|
717
|
+
initialStates: InitialStates;
|
|
718
|
+
} | {
|
|
719
|
+
kind: "progress";
|
|
720
|
+
statistics: SearchStatistics;
|
|
721
|
+
} | {
|
|
722
|
+
kind: "liveness-started";
|
|
723
|
+
branches: number;
|
|
724
|
+
isComplete: boolean;
|
|
725
|
+
states: number;
|
|
726
|
+
statistics: SearchStatistics;
|
|
727
|
+
} | {
|
|
728
|
+
kind: "liveness-finished";
|
|
729
|
+
} | {
|
|
730
|
+
kind: "warning";
|
|
731
|
+
code: number;
|
|
732
|
+
text: string;
|
|
733
|
+
} | ({
|
|
734
|
+
kind: "java-override";
|
|
735
|
+
} & JavaOverride);
|
|
736
|
+
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth"> {}
|
|
618
737
|
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
619
738
|
interface TraceStep {
|
|
620
739
|
action: string | undefined;
|
|
621
740
|
label: string | undefined;
|
|
622
741
|
state: Record<string, Value>;
|
|
742
|
+
output?: OutputLine[];
|
|
623
743
|
}
|
|
624
744
|
interface Violation {
|
|
625
745
|
name: string;
|
|
746
|
+
properties?: string[];
|
|
626
747
|
trace: TraceStep[];
|
|
748
|
+
traceOutput?: OutputLine[];
|
|
627
749
|
loopStart: number | undefined;
|
|
628
750
|
loopLabel?: string;
|
|
629
751
|
message?: string;
|
|
630
752
|
counts?: string;
|
|
631
753
|
unwitnessed?: Postcondition;
|
|
754
|
+
postcondition?: Postcondition;
|
|
755
|
+
warning?: {
|
|
756
|
+
code: number;
|
|
757
|
+
text: string;
|
|
758
|
+
};
|
|
632
759
|
}
|
|
633
760
|
interface Postcondition {
|
|
634
761
|
name: string;
|
|
762
|
+
code: number;
|
|
635
763
|
message: string;
|
|
636
764
|
counts?: string;
|
|
637
765
|
}
|
|
638
766
|
interface EvaluationFailure {
|
|
767
|
+
code: number;
|
|
639
768
|
message: string;
|
|
769
|
+
toolMessage: string;
|
|
640
770
|
trace: TraceStep[];
|
|
771
|
+
traceOutput?: OutputLine[];
|
|
641
772
|
initialState: Record<string, Value> | undefined;
|
|
642
773
|
exitCode: number;
|
|
774
|
+
callStack: Expression[] | undefined;
|
|
775
|
+
isCallStackFirst?: boolean;
|
|
776
|
+
fingerprint?: FingerprintFailure;
|
|
777
|
+
traceFailure?: FailureMessage;
|
|
778
|
+
postcondition?: Postcondition;
|
|
779
|
+
isWithoutStatistics?: boolean;
|
|
780
|
+
}
|
|
781
|
+
interface InitialStates {
|
|
782
|
+
generated: number;
|
|
783
|
+
distinct: number;
|
|
643
784
|
}
|
|
644
785
|
interface CheckResult {
|
|
645
786
|
status: CheckStatus;
|
|
@@ -649,9 +790,18 @@ interface CheckResult {
|
|
|
649
790
|
distinctStates: number;
|
|
650
791
|
queuedStates: number;
|
|
651
792
|
depth: number;
|
|
793
|
+
initialStates: InitialStates | undefined;
|
|
652
794
|
outDegrees: number[] | undefined;
|
|
653
795
|
fingerprintDistance: bigint | undefined;
|
|
796
|
+
additionalViolation?: Violation;
|
|
797
|
+
liveCallStack?: Expression[];
|
|
798
|
+
violationOutDegrees?: number[];
|
|
799
|
+
}
|
|
800
|
+
interface FailureMessage {
|
|
801
|
+
code: number;
|
|
802
|
+
message: string;
|
|
803
|
+
toolMessage: string;
|
|
654
804
|
}
|
|
655
805
|
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
656
806
|
export declare const parseModule: (source: string) => Module;
|
|
657
|
-
export type { CheckOptions, CheckResult, CheckStatus, ConfigValue, ConstantAssignment, EvaluationFailure, ModelConfig, Module, Substitution, TraceStep, Value, Violation };
|
|
807
|
+
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};
|