tla-ts 0.0.0-stage → 0.0.2
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/LICENSE +21 -0
- package/README.md +172 -2
- package/dist/cli.cjs +10 -0
- package/dist/cli.d.cts +9 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +10 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +607 -0
- package/dist/index.d.ts +607 -0
- package/dist/index.js +9 -0
- package/dist/parallel-worker.cjs +12 -0
- package/dist/parallel-worker.d.cts +9 -0
- package/dist/parallel-worker.d.ts +9 -0
- package/dist/parallel-worker.js +12 -0
- package/dist/parallel.cjs +12 -0
- package/dist/parallel.js +12 -0
- package/dist/run-cli.cjs +10 -0
- package/dist/run-cli.js +10 -0
- package/dist/transfer.cjs +409 -0
- package/dist/transfer.js +409 -0
- package/package.json +75 -3
- package/src/ast.ts +448 -0
- package/src/bags.ts +275 -0
- package/src/builtins.ts +341 -0
- package/src/bundled-modules.ts +82 -0
- package/src/canonical.ts +39 -0
- package/src/check.ts +1378 -0
- package/src/cli.ts +6 -0
- package/src/codegen.ts +339 -0
- package/src/config.ts +337 -0
- package/src/dependencies.ts +51 -0
- package/src/environment.ts +928 -0
- package/src/errors.ts +56 -0
- package/src/evaluate.ts +1876 -0
- package/src/exit-codes.ts +75 -0
- package/src/fingerprints.ts +69 -0
- package/src/index.ts +22 -0
- package/src/instances.ts +744 -0
- package/src/java-overrides.ts +241 -0
- package/src/json.ts +215 -0
- package/src/levels.ts +850 -0
- package/src/lexer.ts +498 -0
- package/src/liveness.ts +1018 -0
- package/src/parallel-worker.ts +305 -0
- package/src/parallel.ts +278 -0
- package/src/parser.ts +1572 -0
- package/src/pretty-print.ts +259 -0
- package/src/randomization.ts +99 -0
- package/src/resolve.ts +793 -0
- package/src/run-cli.ts +210 -0
- package/src/runtime.ts +94 -0
- package/src/spec-description.ts +509 -0
- package/src/standard-levels.ts +105 -0
- package/src/standard-modules.ts +412 -0
- package/src/subexpressions.ts +449 -0
- package/src/substitution-levels.ts +184 -0
- package/src/successors.ts +1025 -0
- package/src/symmetry.ts +236 -0
- package/src/tableau.ts +626 -0
- package/src/tlc-ext.ts +334 -0
- package/src/tlc-module.ts +238 -0
- package/src/tlc-modules.ts +1022 -0
- package/src/tlc-order.ts +497 -0
- package/src/tlc-random.ts +411 -0
- package/src/tlc-summary.ts +109 -0
- package/src/transfer.ts +113 -0
- package/src/values.ts +2082 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license tla-ts
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Aiden Bai
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
interface LocalResolution {
|
|
10
|
+
kind: "Local";
|
|
11
|
+
}
|
|
12
|
+
interface SourceLocation {
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
15
|
+
range?: SourceRange;
|
|
16
|
+
}
|
|
17
|
+
interface SourceRange {
|
|
18
|
+
module: string;
|
|
19
|
+
start: SourceLocation;
|
|
20
|
+
end: SourceLocation;
|
|
21
|
+
}
|
|
22
|
+
interface NumberExpression {
|
|
23
|
+
kind: "Number";
|
|
24
|
+
value: number;
|
|
25
|
+
text?: string;
|
|
26
|
+
location: SourceLocation;
|
|
27
|
+
}
|
|
28
|
+
interface DecimalExpression {
|
|
29
|
+
kind: "Decimal";
|
|
30
|
+
text: string;
|
|
31
|
+
location: SourceLocation;
|
|
32
|
+
}
|
|
33
|
+
interface StringExpression {
|
|
34
|
+
kind: "String";
|
|
35
|
+
value: string;
|
|
36
|
+
location: SourceLocation;
|
|
37
|
+
}
|
|
38
|
+
interface IdentifierExpression {
|
|
39
|
+
kind: "Identifier";
|
|
40
|
+
name: string;
|
|
41
|
+
location: SourceLocation;
|
|
42
|
+
resolution?: LocalResolution;
|
|
43
|
+
}
|
|
44
|
+
interface ApplyExpression {
|
|
45
|
+
kind: "Apply";
|
|
46
|
+
operator: string;
|
|
47
|
+
args: Expression[];
|
|
48
|
+
location: SourceLocation;
|
|
49
|
+
resolution?: LocalResolution;
|
|
50
|
+
}
|
|
51
|
+
interface OperatorReferenceExpression {
|
|
52
|
+
kind: "OperatorReference";
|
|
53
|
+
operator: string;
|
|
54
|
+
location: SourceLocation;
|
|
55
|
+
}
|
|
56
|
+
interface LambdaExpression {
|
|
57
|
+
kind: "Lambda";
|
|
58
|
+
params: string[];
|
|
59
|
+
body: Expression;
|
|
60
|
+
location: SourceLocation;
|
|
61
|
+
}
|
|
62
|
+
interface JunctionExpression {
|
|
63
|
+
kind: "And" | "Or";
|
|
64
|
+
operands: Expression[];
|
|
65
|
+
location: SourceLocation;
|
|
66
|
+
}
|
|
67
|
+
interface PrimeExpression {
|
|
68
|
+
kind: "Prime";
|
|
69
|
+
expression: Expression;
|
|
70
|
+
location: SourceLocation;
|
|
71
|
+
}
|
|
72
|
+
interface UnchangedExpression {
|
|
73
|
+
kind: "Unchanged";
|
|
74
|
+
expression: Expression;
|
|
75
|
+
location: SourceLocation;
|
|
76
|
+
}
|
|
77
|
+
interface EnabledExpression {
|
|
78
|
+
kind: "Enabled";
|
|
79
|
+
expression: Expression;
|
|
80
|
+
location: SourceLocation;
|
|
81
|
+
}
|
|
82
|
+
interface IfExpression {
|
|
83
|
+
kind: "If";
|
|
84
|
+
condition: Expression;
|
|
85
|
+
consequent: Expression;
|
|
86
|
+
alternative: Expression;
|
|
87
|
+
location: SourceLocation;
|
|
88
|
+
}
|
|
89
|
+
interface CaseArm {
|
|
90
|
+
condition: Expression;
|
|
91
|
+
body: Expression;
|
|
92
|
+
}
|
|
93
|
+
interface CaseExpression {
|
|
94
|
+
kind: "Case";
|
|
95
|
+
arms: CaseArm[];
|
|
96
|
+
other: Expression | undefined;
|
|
97
|
+
location: SourceLocation;
|
|
98
|
+
}
|
|
99
|
+
interface LetExpression {
|
|
100
|
+
kind: "Let";
|
|
101
|
+
definitions: Definition[];
|
|
102
|
+
instances?: Instance[];
|
|
103
|
+
body: Expression;
|
|
104
|
+
location: SourceLocation;
|
|
105
|
+
}
|
|
106
|
+
type BoundPattern = {
|
|
107
|
+
kind: "Name";
|
|
108
|
+
name: string;
|
|
109
|
+
} | {
|
|
110
|
+
kind: "Tuple";
|
|
111
|
+
names: string[];
|
|
112
|
+
};
|
|
113
|
+
interface Bound {
|
|
114
|
+
pattern: BoundPattern;
|
|
115
|
+
set: Expression;
|
|
116
|
+
}
|
|
117
|
+
interface QuantifierExpression {
|
|
118
|
+
kind: "Forall" | "Exists";
|
|
119
|
+
bounds: Bound[];
|
|
120
|
+
body: Expression;
|
|
121
|
+
location: SourceLocation;
|
|
122
|
+
}
|
|
123
|
+
interface UnboundedQuantifierExpression {
|
|
124
|
+
kind: "UnboundedQuantifier";
|
|
125
|
+
names: string[];
|
|
126
|
+
isTemporal?: boolean;
|
|
127
|
+
body: Expression;
|
|
128
|
+
location: SourceLocation;
|
|
129
|
+
}
|
|
130
|
+
interface ChooseExpression {
|
|
131
|
+
kind: "Choose";
|
|
132
|
+
pattern: BoundPattern;
|
|
133
|
+
set: Expression | undefined;
|
|
134
|
+
body: Expression;
|
|
135
|
+
location: SourceLocation;
|
|
136
|
+
}
|
|
137
|
+
interface SetEnumerationExpression {
|
|
138
|
+
kind: "SetEnumeration";
|
|
139
|
+
elements: Expression[];
|
|
140
|
+
location: SourceLocation;
|
|
141
|
+
}
|
|
142
|
+
interface SetFilterExpression {
|
|
143
|
+
kind: "SetFilter";
|
|
144
|
+
bound: Bound;
|
|
145
|
+
predicate: Expression;
|
|
146
|
+
location: SourceLocation;
|
|
147
|
+
}
|
|
148
|
+
interface SetMapExpression {
|
|
149
|
+
kind: "SetMap";
|
|
150
|
+
expression: Expression;
|
|
151
|
+
bounds: Bound[];
|
|
152
|
+
location: SourceLocation;
|
|
153
|
+
}
|
|
154
|
+
interface TupleExpression {
|
|
155
|
+
kind: "Tuple";
|
|
156
|
+
elements: Expression[];
|
|
157
|
+
location: SourceLocation;
|
|
158
|
+
}
|
|
159
|
+
interface FunctionConstructionExpression {
|
|
160
|
+
kind: "FunctionConstruction";
|
|
161
|
+
bounds: Bound[];
|
|
162
|
+
body: Expression;
|
|
163
|
+
location: SourceLocation;
|
|
164
|
+
isRecursive?: boolean;
|
|
165
|
+
}
|
|
166
|
+
interface FunctionSetExpression {
|
|
167
|
+
kind: "FunctionSet";
|
|
168
|
+
domain: Expression;
|
|
169
|
+
range: Expression;
|
|
170
|
+
location: SourceLocation;
|
|
171
|
+
}
|
|
172
|
+
interface RecordField {
|
|
173
|
+
name: string;
|
|
174
|
+
value: Expression;
|
|
175
|
+
}
|
|
176
|
+
interface RecordExpression {
|
|
177
|
+
kind: "Record" | "RecordSet";
|
|
178
|
+
fields: RecordField[];
|
|
179
|
+
location: SourceLocation;
|
|
180
|
+
}
|
|
181
|
+
type ExceptPathStep = {
|
|
182
|
+
kind: "Field";
|
|
183
|
+
name: string;
|
|
184
|
+
} | {
|
|
185
|
+
kind: "Index";
|
|
186
|
+
args: Expression[];
|
|
187
|
+
};
|
|
188
|
+
interface ExceptUpdate {
|
|
189
|
+
path: ExceptPathStep[];
|
|
190
|
+
value: Expression;
|
|
191
|
+
}
|
|
192
|
+
interface ExceptExpression {
|
|
193
|
+
kind: "Except";
|
|
194
|
+
function: Expression;
|
|
195
|
+
updates: ExceptUpdate[];
|
|
196
|
+
location: SourceLocation;
|
|
197
|
+
}
|
|
198
|
+
interface ExceptAtExpression {
|
|
199
|
+
kind: "ExceptAt";
|
|
200
|
+
location: SourceLocation;
|
|
201
|
+
}
|
|
202
|
+
interface FunctionApplicationExpression {
|
|
203
|
+
kind: "FunctionApplication";
|
|
204
|
+
function: Expression;
|
|
205
|
+
args: Expression[];
|
|
206
|
+
location: SourceLocation;
|
|
207
|
+
}
|
|
208
|
+
interface FieldAccessExpression {
|
|
209
|
+
kind: "FieldAccess";
|
|
210
|
+
record: Expression;
|
|
211
|
+
field: string;
|
|
212
|
+
location: SourceLocation;
|
|
213
|
+
}
|
|
214
|
+
interface ProductExpression {
|
|
215
|
+
kind: "Product";
|
|
216
|
+
factors: Expression[];
|
|
217
|
+
location: SourceLocation;
|
|
218
|
+
}
|
|
219
|
+
interface TemporalExpression {
|
|
220
|
+
kind: "Always" | "Eventually";
|
|
221
|
+
expression: Expression;
|
|
222
|
+
location: SourceLocation;
|
|
223
|
+
}
|
|
224
|
+
interface ActionExpression {
|
|
225
|
+
kind: "BoxAction" | "AngleAction";
|
|
226
|
+
action: Expression;
|
|
227
|
+
subscript: Expression;
|
|
228
|
+
location: SourceLocation;
|
|
229
|
+
}
|
|
230
|
+
interface FairnessExpression {
|
|
231
|
+
kind: "WeakFairness" | "StrongFairness";
|
|
232
|
+
subscript: Expression;
|
|
233
|
+
action: Expression;
|
|
234
|
+
enabled?: Expression;
|
|
235
|
+
location: SourceLocation;
|
|
236
|
+
}
|
|
237
|
+
interface LabelExpression {
|
|
238
|
+
kind: "Label";
|
|
239
|
+
name: string;
|
|
240
|
+
params: string[];
|
|
241
|
+
body: Expression;
|
|
242
|
+
location: SourceLocation;
|
|
243
|
+
}
|
|
244
|
+
type Selector = {
|
|
245
|
+
kind: "Name";
|
|
246
|
+
name: string;
|
|
247
|
+
args: Expression[];
|
|
248
|
+
} | {
|
|
249
|
+
kind: "Operand";
|
|
250
|
+
operand: number | "<<" | ">>";
|
|
251
|
+
} | {
|
|
252
|
+
kind: "Bound";
|
|
253
|
+
args: Expression[];
|
|
254
|
+
} | {
|
|
255
|
+
kind: "At";
|
|
256
|
+
} | {
|
|
257
|
+
kind: "Colon";
|
|
258
|
+
};
|
|
259
|
+
interface SubexpressionExpression {
|
|
260
|
+
kind: "Subexpression";
|
|
261
|
+
selectors: Selector[];
|
|
262
|
+
location: SourceLocation;
|
|
263
|
+
}
|
|
264
|
+
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;
|
|
265
|
+
interface OperatorParam {
|
|
266
|
+
name: string;
|
|
267
|
+
arity: number;
|
|
268
|
+
}
|
|
269
|
+
interface OperatorDefinition {
|
|
270
|
+
kind: "Operator";
|
|
271
|
+
name: string;
|
|
272
|
+
params: OperatorParam[];
|
|
273
|
+
body: Expression;
|
|
274
|
+
bodyRange?: SourceRange;
|
|
275
|
+
isLocal: boolean;
|
|
276
|
+
isRecursive: boolean;
|
|
277
|
+
location: SourceLocation;
|
|
278
|
+
}
|
|
279
|
+
interface FunctionDefinition {
|
|
280
|
+
kind: "Function";
|
|
281
|
+
name: string;
|
|
282
|
+
bounds: Bound[];
|
|
283
|
+
body: Expression;
|
|
284
|
+
isLocal: boolean;
|
|
285
|
+
isRecursive: boolean;
|
|
286
|
+
location: SourceLocation;
|
|
287
|
+
}
|
|
288
|
+
type Definition = OperatorDefinition | FunctionDefinition;
|
|
289
|
+
interface Declaration {
|
|
290
|
+
name: string;
|
|
291
|
+
arity: number;
|
|
292
|
+
location: SourceLocation;
|
|
293
|
+
}
|
|
294
|
+
interface Assumption {
|
|
295
|
+
name: string | undefined;
|
|
296
|
+
expression: Expression;
|
|
297
|
+
isAxiom: boolean;
|
|
298
|
+
location: SourceLocation;
|
|
299
|
+
}
|
|
300
|
+
interface InstanceSubstitution {
|
|
301
|
+
name: string;
|
|
302
|
+
expression: Expression;
|
|
303
|
+
}
|
|
304
|
+
interface Instance {
|
|
305
|
+
kind: "Instance";
|
|
306
|
+
name: string | undefined;
|
|
307
|
+
params: OperatorParam[];
|
|
308
|
+
module: string;
|
|
309
|
+
substitutions: InstanceSubstitution[];
|
|
310
|
+
isLocal: boolean;
|
|
311
|
+
location: SourceLocation;
|
|
312
|
+
}
|
|
313
|
+
interface NewSymbol {
|
|
314
|
+
kind: "NewSymbol";
|
|
315
|
+
name: string;
|
|
316
|
+
arity: number;
|
|
317
|
+
level: "Constant" | "Variable" | "State" | "Action" | "Temporal";
|
|
318
|
+
set: Expression | undefined;
|
|
319
|
+
location: SourceLocation;
|
|
320
|
+
}
|
|
321
|
+
interface AssumeProve {
|
|
322
|
+
kind: "AssumeProve";
|
|
323
|
+
assumptions: (Expression | NewSymbol | AssumeProve)[];
|
|
324
|
+
conclusion: Expression;
|
|
325
|
+
location: SourceLocation;
|
|
326
|
+
}
|
|
327
|
+
type Fact = Expression | {
|
|
328
|
+
kind: "ModuleFact";
|
|
329
|
+
name: string;
|
|
330
|
+
location: SourceLocation;
|
|
331
|
+
};
|
|
332
|
+
interface UseOrHide {
|
|
333
|
+
kind: "Use" | "Hide";
|
|
334
|
+
isOnly: boolean;
|
|
335
|
+
facts: Fact[];
|
|
336
|
+
defs: Fact[];
|
|
337
|
+
location: SourceLocation;
|
|
338
|
+
}
|
|
339
|
+
type Proof = {
|
|
340
|
+
kind: "Obvious" | "Omitted";
|
|
341
|
+
location: SourceLocation;
|
|
342
|
+
} | {
|
|
343
|
+
kind: "By";
|
|
344
|
+
isOnly: boolean;
|
|
345
|
+
facts: Fact[];
|
|
346
|
+
defs: Fact[];
|
|
347
|
+
location: SourceLocation;
|
|
348
|
+
} | {
|
|
349
|
+
kind: "Steps";
|
|
350
|
+
level: number;
|
|
351
|
+
steps: ProofStep[];
|
|
352
|
+
location: SourceLocation;
|
|
353
|
+
};
|
|
354
|
+
interface DefineStep {
|
|
355
|
+
kind: "Define";
|
|
356
|
+
definitions: (Definition | Instance)[];
|
|
357
|
+
location: SourceLocation;
|
|
358
|
+
}
|
|
359
|
+
type StepBody = UseOrHide | Instance | DefineStep | {
|
|
360
|
+
kind: "Have";
|
|
361
|
+
expression: Expression;
|
|
362
|
+
} | {
|
|
363
|
+
kind: "Take";
|
|
364
|
+
names: string[];
|
|
365
|
+
bounds: Bound[];
|
|
366
|
+
} | {
|
|
367
|
+
kind: "Witness";
|
|
368
|
+
expressions: Expression[];
|
|
369
|
+
} | {
|
|
370
|
+
kind: "Pick";
|
|
371
|
+
names: string[];
|
|
372
|
+
bounds: Bound[];
|
|
373
|
+
body: Expression;
|
|
374
|
+
} | {
|
|
375
|
+
kind: "Case";
|
|
376
|
+
expression: Expression;
|
|
377
|
+
} | {
|
|
378
|
+
kind: "Assert";
|
|
379
|
+
isSuffices: boolean;
|
|
380
|
+
statement: Expression | AssumeProve;
|
|
381
|
+
} | {
|
|
382
|
+
kind: "Qed";
|
|
383
|
+
};
|
|
384
|
+
interface ProofStep {
|
|
385
|
+
name: string | undefined;
|
|
386
|
+
body: StepBody;
|
|
387
|
+
proof: Proof | undefined;
|
|
388
|
+
location: SourceLocation;
|
|
389
|
+
}
|
|
390
|
+
interface Theorem {
|
|
391
|
+
name: string | undefined;
|
|
392
|
+
statement: Expression | AssumeProve;
|
|
393
|
+
proof: Proof | undefined;
|
|
394
|
+
location: SourceLocation;
|
|
395
|
+
}
|
|
396
|
+
interface Module {
|
|
397
|
+
name: string;
|
|
398
|
+
modules: Module[];
|
|
399
|
+
extends: string[];
|
|
400
|
+
constants: Declaration[];
|
|
401
|
+
variables: Declaration[];
|
|
402
|
+
definitions: Definition[];
|
|
403
|
+
instances: Instance[];
|
|
404
|
+
assumptions: Assumption[];
|
|
405
|
+
location: SourceLocation;
|
|
406
|
+
theorems: Theorem[];
|
|
407
|
+
uses: UseOrHide[];
|
|
408
|
+
}
|
|
409
|
+
type ConfigValue = {
|
|
410
|
+
kind: "Number";
|
|
411
|
+
value: number;
|
|
412
|
+
} | {
|
|
413
|
+
kind: "String";
|
|
414
|
+
value: string;
|
|
415
|
+
} | {
|
|
416
|
+
kind: "Boolean";
|
|
417
|
+
value: boolean;
|
|
418
|
+
} | {
|
|
419
|
+
kind: "ModelValue";
|
|
420
|
+
name: string;
|
|
421
|
+
} | {
|
|
422
|
+
kind: "Set";
|
|
423
|
+
elements: ConfigValue[];
|
|
424
|
+
};
|
|
425
|
+
interface ConstantAssignment {
|
|
426
|
+
name: string;
|
|
427
|
+
value: ConfigValue;
|
|
428
|
+
args?: ConfigValue[];
|
|
429
|
+
module?: string;
|
|
430
|
+
}
|
|
431
|
+
interface Substitution {
|
|
432
|
+
name: string;
|
|
433
|
+
target: string;
|
|
434
|
+
module?: string;
|
|
435
|
+
}
|
|
436
|
+
interface ModelConfig {
|
|
437
|
+
init: string | undefined;
|
|
438
|
+
next: string | undefined;
|
|
439
|
+
specification: string | undefined;
|
|
440
|
+
invariants: string[];
|
|
441
|
+
properties: string[];
|
|
442
|
+
constraints: string[];
|
|
443
|
+
actionConstraints: string[];
|
|
444
|
+
constants: ConstantAssignment[];
|
|
445
|
+
substitutions: Substitution[];
|
|
446
|
+
checkDeadlock: boolean;
|
|
447
|
+
symmetry: string | undefined;
|
|
448
|
+
view: string | undefined;
|
|
449
|
+
alias: string | undefined;
|
|
450
|
+
postconditions: string[];
|
|
451
|
+
possible: string[];
|
|
452
|
+
periodic: string | undefined;
|
|
453
|
+
rlReward: string | undefined;
|
|
454
|
+
}
|
|
455
|
+
export declare const parseConfig: (source: string) => ModelConfig;
|
|
456
|
+
export declare class TlaError extends Error {
|
|
457
|
+
constructor(message: string, cause?: unknown);
|
|
458
|
+
}
|
|
459
|
+
export declare class TlaSyntaxError extends TlaError {
|
|
460
|
+
constructor(message: string, cause?: unknown);
|
|
461
|
+
}
|
|
462
|
+
export declare class TlaConfigError extends TlaError {
|
|
463
|
+
constructor(message: string, cause?: unknown);
|
|
464
|
+
}
|
|
465
|
+
export declare class TlaEvaluationError extends TlaError {
|
|
466
|
+
constructor(message: string, cause?: unknown);
|
|
467
|
+
}
|
|
468
|
+
export declare class TlaUnsupportedError extends TlaError {
|
|
469
|
+
constructor(message: string, cause?: unknown);
|
|
470
|
+
}
|
|
471
|
+
interface ModelValue {
|
|
472
|
+
kind: "ModelValue";
|
|
473
|
+
name: string;
|
|
474
|
+
}
|
|
475
|
+
interface SetValue {
|
|
476
|
+
kind: "Set";
|
|
477
|
+
elements: Value[];
|
|
478
|
+
hash: number;
|
|
479
|
+
fingerprint: number;
|
|
480
|
+
}
|
|
481
|
+
interface MixedSetValue {
|
|
482
|
+
kind: "MixedSet";
|
|
483
|
+
elements: Value[];
|
|
484
|
+
}
|
|
485
|
+
interface FunctionValue {
|
|
486
|
+
kind: "Function";
|
|
487
|
+
domain: Value[];
|
|
488
|
+
range: Value[];
|
|
489
|
+
hash: number;
|
|
490
|
+
fingerprint: number;
|
|
491
|
+
writtenKeys: Value[] | undefined;
|
|
492
|
+
}
|
|
493
|
+
interface IntervalValue {
|
|
494
|
+
kind: "Interval";
|
|
495
|
+
low: number;
|
|
496
|
+
high: number;
|
|
497
|
+
}
|
|
498
|
+
interface InfiniteSetValue {
|
|
499
|
+
kind: "InfiniteSet";
|
|
500
|
+
name: "Nat" | "Int" | "STRING" | "Any";
|
|
501
|
+
}
|
|
502
|
+
interface SubsetValue {
|
|
503
|
+
kind: "Subset";
|
|
504
|
+
base: Value;
|
|
505
|
+
}
|
|
506
|
+
interface FunctionSetValue {
|
|
507
|
+
kind: "FunctionSet";
|
|
508
|
+
domain: Value;
|
|
509
|
+
range: Value;
|
|
510
|
+
}
|
|
511
|
+
interface RecordSetValue {
|
|
512
|
+
kind: "RecordSet";
|
|
513
|
+
names: string[];
|
|
514
|
+
sets: Value[];
|
|
515
|
+
}
|
|
516
|
+
interface ProductSetValue {
|
|
517
|
+
kind: "ProductSet";
|
|
518
|
+
factors: Value[];
|
|
519
|
+
}
|
|
520
|
+
interface SequenceSetValue {
|
|
521
|
+
kind: "SequenceSet";
|
|
522
|
+
base: Value;
|
|
523
|
+
}
|
|
524
|
+
interface SetOperationValue {
|
|
525
|
+
kind: "SetOperation";
|
|
526
|
+
operator: "\\cup" | "\\cap" | "\\";
|
|
527
|
+
left: Value;
|
|
528
|
+
right: Value;
|
|
529
|
+
}
|
|
530
|
+
interface FilteredSetValue {
|
|
531
|
+
kind: "FilteredSet";
|
|
532
|
+
base: Value;
|
|
533
|
+
test: (element: Value) => boolean;
|
|
534
|
+
}
|
|
535
|
+
interface UnionValue {
|
|
536
|
+
kind: "Union";
|
|
537
|
+
base: Value;
|
|
538
|
+
}
|
|
539
|
+
interface LazyFunctionParameter {
|
|
540
|
+
name: string;
|
|
541
|
+
domain: Value;
|
|
542
|
+
}
|
|
543
|
+
interface LazyFunctionSource {
|
|
544
|
+
parameters: LazyFunctionParameter[];
|
|
545
|
+
body: string;
|
|
546
|
+
}
|
|
547
|
+
interface LazyFunctionValue {
|
|
548
|
+
kind: "LazyFunction";
|
|
549
|
+
domain: Value;
|
|
550
|
+
apply: (argument: Value) => Value;
|
|
551
|
+
source?: LazyFunctionSource;
|
|
552
|
+
}
|
|
553
|
+
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
554
|
+
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
555
|
+
interface CheckOptions {
|
|
556
|
+
source: string;
|
|
557
|
+
config: string | ModelConfig;
|
|
558
|
+
loadModule?: (name: string) => string | undefined;
|
|
559
|
+
loadClass?: (name: string) => Uint8Array | undefined;
|
|
560
|
+
onPrint?: (text: string) => void;
|
|
561
|
+
onPause?: () => void;
|
|
562
|
+
readFile?: (path: string) => string | undefined;
|
|
563
|
+
writeFile?: (path: string, content: string) => void;
|
|
564
|
+
seed?: bigint;
|
|
565
|
+
workers?: number;
|
|
566
|
+
livenessCheck?: "default" | "final";
|
|
567
|
+
}
|
|
568
|
+
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
569
|
+
interface TraceStep {
|
|
570
|
+
action: string | undefined;
|
|
571
|
+
label: string | undefined;
|
|
572
|
+
state: Record<string, Value>;
|
|
573
|
+
}
|
|
574
|
+
interface Violation {
|
|
575
|
+
name: string;
|
|
576
|
+
trace: TraceStep[];
|
|
577
|
+
loopStart: number | undefined;
|
|
578
|
+
loopLabel?: string;
|
|
579
|
+
message?: string;
|
|
580
|
+
counts?: string;
|
|
581
|
+
unwitnessed?: Postcondition;
|
|
582
|
+
}
|
|
583
|
+
interface Postcondition {
|
|
584
|
+
name: string;
|
|
585
|
+
message: string;
|
|
586
|
+
counts?: string;
|
|
587
|
+
}
|
|
588
|
+
interface EvaluationFailure {
|
|
589
|
+
message: string;
|
|
590
|
+
trace: TraceStep[];
|
|
591
|
+
initialState: Record<string, Value> | undefined;
|
|
592
|
+
exitCode: number;
|
|
593
|
+
}
|
|
594
|
+
interface CheckResult {
|
|
595
|
+
status: CheckStatus;
|
|
596
|
+
violation: Violation | undefined;
|
|
597
|
+
failure: EvaluationFailure | undefined;
|
|
598
|
+
generatedStates: number;
|
|
599
|
+
distinctStates: number;
|
|
600
|
+
queuedStates: number;
|
|
601
|
+
depth: number;
|
|
602
|
+
outDegrees: number[] | undefined;
|
|
603
|
+
fingerprintDistance: bigint | undefined;
|
|
604
|
+
}
|
|
605
|
+
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
606
|
+
export declare const parseModule: (source: string) => Module;
|
|
607
|
+
export type { CheckOptions, CheckResult, CheckStatus, ConfigValue, ConstantAssignment, EvaluationFailure, ModelConfig, Module, Substitution, TraceStep, Value, Violation };
|