gdp-wired 0.31.0 → 0.32.0

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.
Files changed (73) hide show
  1. package/README.md +82 -6
  2. package/dist/core/c/reader.d.ts +86 -0
  3. package/dist/core/c/reader.js +860 -0
  4. package/dist/core/cli.d.ts +66 -0
  5. package/dist/core/cli.js +582 -0
  6. package/dist/core/dsl.d.ts +4 -2
  7. package/dist/core/dsl.js +22 -12
  8. package/dist/core/effect.d.ts +6 -4
  9. package/dist/core/effect.js +48 -10
  10. package/dist/core/ex/harness.exs +177 -0
  11. package/dist/core/ex/json.exs +46 -0
  12. package/dist/core/ex/reader.exs +462 -0
  13. package/dist/core/exists.d.ts +3 -0
  14. package/dist/core/exists.js +3 -1
  15. package/dist/core/extract-c.d.ts +35 -0
  16. package/dist/core/extract-c.js +424 -0
  17. package/dist/core/extract-check.js +27 -6
  18. package/dist/core/extract-ex.d.ts +16 -0
  19. package/dist/core/extract-ex.js +33 -0
  20. package/dist/core/extract-go-check.d.ts +28 -0
  21. package/dist/core/extract-go-check.js +639 -0
  22. package/dist/core/extract-go.d.ts +231 -0
  23. package/dist/core/extract-go.js +1166 -0
  24. package/dist/core/extract-jvm.d.ts +23 -0
  25. package/dist/core/extract-jvm.js +220 -0
  26. package/dist/core/extract-print.js +17 -7
  27. package/dist/core/extract-py.d.ts +15 -0
  28. package/dist/core/extract-py.js +31 -0
  29. package/dist/core/extract-rb.d.ts +17 -0
  30. package/dist/core/extract-rb.js +31 -0
  31. package/dist/core/extract-read.d.ts +20 -0
  32. package/dist/core/extract-read.js +46 -6
  33. package/dist/core/extract-rs.d.ts +12 -0
  34. package/dist/core/extract-rs.js +306 -0
  35. package/dist/core/extract-shapes.d.ts +2 -0
  36. package/dist/core/extract-shapes.js +6 -5
  37. package/dist/core/extract-step.d.ts +806 -0
  38. package/dist/core/extract-step.js +4141 -0
  39. package/dist/core/extract-swift.d.ts +27 -0
  40. package/dist/core/extract-swift.js +484 -0
  41. package/dist/core/extract-xstate.d.ts +10 -3
  42. package/dist/core/extract-xstate.js +50 -4
  43. package/dist/core/extract.d.ts +22 -3
  44. package/dist/core/extract.js +107 -18
  45. package/dist/core/go/go.mod +3 -0
  46. package/dist/core/go/reader.go +901 -0
  47. package/dist/core/infer.js +1770 -52
  48. package/dist/core/jvm/Harness.java +361 -0
  49. package/dist/core/jvm/JavaReader.java +825 -0
  50. package/dist/core/jvm/Jvm.java +332 -0
  51. package/dist/core/jvm/KtReader.java +960 -0
  52. package/dist/core/jvm/Rt.java +10 -0
  53. package/dist/core/laws.d.ts +66 -0
  54. package/dist/core/laws.js +522 -0
  55. package/dist/core/py/harness.py +328 -0
  56. package/dist/core/py/reader.py +447 -0
  57. package/dist/core/rb/harness.rb +233 -0
  58. package/dist/core/rb/reader.rb +375 -0
  59. package/dist/core/rs/Cargo.lock +108 -0
  60. package/dist/core/rs/Cargo.toml +14 -0
  61. package/dist/core/rs/src/main.rs +681 -0
  62. package/dist/core/swift/Harness.swift +124 -0
  63. package/dist/core/swift/Main.swift +34 -0
  64. package/dist/core/swift/Package.swift +13 -0
  65. package/dist/core/swift/Sources/gdp-swiftreader/main.swift +1341 -0
  66. package/dist/kernel/cdcl.js +43 -18
  67. package/dist/kernel/epr.d.ts +35 -0
  68. package/dist/kernel/epr.js +1676 -0
  69. package/dist/kernel/prove.d.ts +44 -0
  70. package/dist/kernel/prove.js +668 -54
  71. package/dist/lean-kernel/emit.d.ts +1 -0
  72. package/dist/lean-kernel/emit.js +21 -4
  73. package/package.json +53 -6
@@ -0,0 +1,806 @@
1
+ import * as I from './extract-ir.js';
2
+ import type { B, K, L, N } from './extract-ir.js';
3
+ import { type MapDecl, type Model, Refusal, type Term, type Var } from './extract-read.js';
4
+ import { type Extraction, type Name } from './extract.js';
5
+ import type { Rule } from './dsl.js';
6
+ import { type Sorts } from './extract-print.js';
7
+ import { type Evidence } from './extract-check.js';
8
+ export type SType = {
9
+ k: 'int';
10
+ bits?: number;
11
+ signed?: boolean;
12
+ unit?: string;
13
+ atomic?: string;
14
+ lock?: string;
15
+ rs?: string;
16
+ } | {
17
+ k: 'float' | 'bool' | 'str' | 'none' | 'any' | 'lock';
18
+ atomic?: string;
19
+ lock?: string;
20
+ } | {
21
+ k: 'choice';
22
+ values: string[];
23
+ discs?: number[];
24
+ enum?: string;
25
+ sym?: boolean;
26
+ } | {
27
+ k: 'opt';
28
+ of: SType;
29
+ } | {
30
+ k: 'res';
31
+ of: SType;
32
+ } | {
33
+ k: 'rec';
34
+ name: string;
35
+ } | {
36
+ k: 'map';
37
+ key: SType;
38
+ val: SType;
39
+ } | {
40
+ k: 'list';
41
+ of: SType;
42
+ } | {
43
+ k: 'opaque';
44
+ why: string;
45
+ };
46
+ export type Patch = {
47
+ mod?: string;
48
+ path?: string[];
49
+ self?: string;
50
+ store?: string;
51
+ };
52
+ export type SX = {
53
+ e: string;
54
+ p: string;
55
+ text?: string;
56
+ [k: string]: unknown;
57
+ };
58
+ export type SS = {
59
+ s: string;
60
+ p: string;
61
+ [k: string]: unknown;
62
+ };
63
+ export type SParam = {
64
+ name: string;
65
+ t: SType;
66
+ dflt?: SX;
67
+ kw?: boolean;
68
+ self?: boolean;
69
+ star?: number;
70
+ inject?: boolean;
71
+ };
72
+ export type SFunc = {
73
+ id: string;
74
+ name: string;
75
+ cls?: string;
76
+ p: string;
77
+ span: [string, number, number];
78
+ params: SParam[];
79
+ ret: SType;
80
+ body: SS[];
81
+ async?: boolean;
82
+ static?: boolean;
83
+ decorators: {
84
+ name: string;
85
+ text: string;
86
+ p: string;
87
+ }[];
88
+ recv?: string;
89
+ results?: number;
90
+ why?: string;
91
+ late?: string;
92
+ };
93
+ export type SRec = {
94
+ name: string;
95
+ short: string;
96
+ fields: {
97
+ name: string;
98
+ t: SType;
99
+ dflt?: SX;
100
+ inject?: boolean;
101
+ }[];
102
+ methods: Record<string, string | null>;
103
+ kinds: string[];
104
+ own: boolean;
105
+ module: string;
106
+ p: string;
107
+ rets?: Record<string, SType>;
108
+ };
109
+ export type SModule = {
110
+ lang: string;
111
+ file: string;
112
+ path: string;
113
+ module: string;
114
+ root: string;
115
+ entries: ({
116
+ k: 'class';
117
+ rec: string;
118
+ } | {
119
+ k: 'func';
120
+ id: string;
121
+ } | {
122
+ k: 'missing';
123
+ name: string;
124
+ })[];
125
+ recs: Record<string, SRec>;
126
+ funcs: Record<string, SFunc>;
127
+ enums?: Record<string, {
128
+ values: string[];
129
+ discs: number[];
130
+ data: boolean;
131
+ }>;
132
+ error?: string;
133
+ split?: boolean;
134
+ truth?: 'nil-false';
135
+ stubs?: boolean;
136
+ };
137
+ export type StoreDecl = {
138
+ get?: string[];
139
+ set?: string[];
140
+ delete?: string[];
141
+ skip?: string[];
142
+ value?: 'int' | 'float' | 'str';
143
+ attrs?: Record<string, null | boolean | number | string>;
144
+ async?: Record<string, boolean>;
145
+ };
146
+ export type StepOptions = {
147
+ entry?: string | string[];
148
+ methods?: string[];
149
+ answers?: Record<string, string>;
150
+ skip?: string[];
151
+ stores?: Record<string, StoreDecl>;
152
+ strict?: boolean;
153
+ failures?: 'refuse' | 'kept';
154
+ onError?: 'refuse' | 'discard';
155
+ domains?: Record<string, 'nat' | 'int'>;
156
+ check?: {
157
+ runs?: number;
158
+ depth?: number;
159
+ states?: number;
160
+ seed?: number;
161
+ bound?: number;
162
+ probes?: boolean;
163
+ };
164
+ };
165
+ export type IntTy = {
166
+ bits: number;
167
+ signed: boolean;
168
+ name?: string;
169
+ t?: number;
170
+ ub?: boolean;
171
+ };
172
+ type V = {
173
+ t: 'num';
174
+ e: N;
175
+ ty?: IntTy;
176
+ cmp?: [N, N];
177
+ slen?: K;
178
+ } | {
179
+ t: 'bool';
180
+ e: B;
181
+ } | {
182
+ t: 'str';
183
+ e: K;
184
+ } | {
185
+ t: 'choice';
186
+ e: L;
187
+ } | {
188
+ t: 'none';
189
+ } | {
190
+ t: 'opt';
191
+ has: B;
192
+ v: V;
193
+ } | {
194
+ t: 'ref';
195
+ id: string;
196
+ } | {
197
+ t: 'cell';
198
+ map: string;
199
+ key: K;
200
+ } | {
201
+ t: 'fmt';
202
+ tpl: string;
203
+ k: K;
204
+ } | {
205
+ t: 'opaque';
206
+ why: string;
207
+ firm?: boolean;
208
+ ask?: string;
209
+ sattr?: {
210
+ store: string;
211
+ path: string;
212
+ };
213
+ } | {
214
+ t: 'ext';
215
+ q: string;
216
+ text: string;
217
+ patch?: Patch;
218
+ ret?: SType;
219
+ recv?: V;
220
+ } | {
221
+ t: 'fn';
222
+ id: string;
223
+ self?: V;
224
+ caps?: Map<string, V>;
225
+ } | {
226
+ t: 'cls';
227
+ rec: string;
228
+ patch?: Patch;
229
+ } | {
230
+ t: 'builtin';
231
+ n: string;
232
+ } | {
233
+ t: 'lib';
234
+ q: string;
235
+ } | {
236
+ t: 'sattr';
237
+ store: string;
238
+ path: string;
239
+ } | {
240
+ t: 'tuple';
241
+ xs: V[];
242
+ } | {
243
+ t: 'lock';
244
+ } | {
245
+ t: 'res';
246
+ ok: B;
247
+ v: V;
248
+ e: V;
249
+ } | {
250
+ t: 'ptr';
251
+ to: Ptr;
252
+ } | {
253
+ t: 'struct';
254
+ ty: string;
255
+ f: Map<string, V>;
256
+ } | {
257
+ t: 'err';
258
+ is: B;
259
+ } | {
260
+ t: 'nil';
261
+ } | {
262
+ t: 'map';
263
+ id: string;
264
+ } | {
265
+ t: 'list';
266
+ id: string;
267
+ } | {
268
+ t: 'push';
269
+ id: string;
270
+ x: V;
271
+ } | {
272
+ t: 'pop';
273
+ id: string;
274
+ };
275
+ type Ptr = {
276
+ k: 'nil';
277
+ } | {
278
+ k: 'obj';
279
+ id: string;
280
+ path: string[];
281
+ } | {
282
+ k: 'phi';
283
+ c: B;
284
+ a: Ptr;
285
+ b: Ptr;
286
+ };
287
+ type ListOp = {
288
+ op: 'push';
289
+ x: V;
290
+ when: B;
291
+ } | {
292
+ op: 'pop';
293
+ when: B;
294
+ } | {
295
+ op: 'set';
296
+ i: N;
297
+ x: V;
298
+ when: B;
299
+ };
300
+ type Place = {
301
+ k: 'local';
302
+ id: string;
303
+ path: string[];
304
+ } | {
305
+ k: 'heap';
306
+ ptr: V;
307
+ path: string[];
308
+ } | {
309
+ k: 'blank';
310
+ };
311
+ export type Recipe = {
312
+ k: 'num' | 'bool' | 'str';
313
+ ty?: IntTy;
314
+ } | {
315
+ k: 'big';
316
+ } | {
317
+ k: 'no';
318
+ why: string;
319
+ };
320
+ type Origin = 'state' | 'input' | 'fresh';
321
+ type Obj = {
322
+ k: 'rec';
323
+ ty: string;
324
+ f: Map<string, V>;
325
+ origin: Origin;
326
+ lazy?: string;
327
+ moved?: boolean;
328
+ } | {
329
+ k: 'map';
330
+ decl: MapDecl;
331
+ val?: SType;
332
+ nil?: B;
333
+ w?: {
334
+ key: K;
335
+ has: B;
336
+ vals: Map<string, V>;
337
+ };
338
+ origin: Origin;
339
+ } | {
340
+ k: 'store';
341
+ name: string;
342
+ } | {
343
+ k: 'big';
344
+ v: N;
345
+ origin: Origin;
346
+ } | {
347
+ k: 'list';
348
+ decl: MapDecl;
349
+ ops: ListOp[];
350
+ origin: Origin;
351
+ };
352
+ type Path = {
353
+ pc: B[];
354
+ locals: Map<string, V>;
355
+ heap: Map<string, Obj>;
356
+ called: string[];
357
+ locks: string[];
358
+ defers: string[];
359
+ };
360
+ type Flow = {
361
+ live?: Path;
362
+ rets: [Path, V][];
363
+ brk?: Path[];
364
+ ft?: Path;
365
+ };
366
+ export type { V as StepValue, Path as StepPath, Obj as StepObj, Ptr as StepPtr };
367
+ export type Leaf = {
368
+ t?: SType;
369
+ name: string;
370
+ path: string[];
371
+ kind: 'num' | 'bool' | 'str' | 'choice' | 'none' | 'map' | 'frame';
372
+ float?: boolean;
373
+ cls?: string;
374
+ fields?: {
375
+ name: string;
376
+ float?: boolean;
377
+ }[];
378
+ key?: 'num' | 'str';
379
+ store?: string;
380
+ tpl?: string;
381
+ };
382
+ export type PArg = {
383
+ k: 'in';
384
+ name: string;
385
+ float?: boolean;
386
+ sym?: boolean;
387
+ z?: Raw;
388
+ } | {
389
+ k: 'opt';
390
+ none: string;
391
+ v: PArg;
392
+ } | {
393
+ k: 'rec';
394
+ cls: string;
395
+ f: [string, PArg][];
396
+ } | {
397
+ k: 'inert';
398
+ } | {
399
+ k: 'store';
400
+ name: string;
401
+ } | {
402
+ k: 'dflt';
403
+ };
404
+ export type Answer = {
405
+ key: string;
406
+ patch: Patch;
407
+ async: boolean;
408
+ inputs: {
409
+ name: string;
410
+ none?: string;
411
+ float?: boolean;
412
+ };
413
+ sort: string;
414
+ how?: string;
415
+ at?: {
416
+ p: string;
417
+ end?: string;
418
+ span?: [number, number];
419
+ }[];
420
+ ty?: string;
421
+ fit?: boolean;
422
+ };
423
+ export type StepRead = {
424
+ ints: Record<string, IntTy>;
425
+ madeAt?: string;
426
+ model: Model;
427
+ leaves: Leaf[];
428
+ args: Record<string, [string, PArg][]>;
429
+ answers: Answer[];
430
+ ctor: [string, PArg][];
431
+ kept: boolean;
432
+ arms: [string, number][];
433
+ cls?: string;
434
+ stores: Record<string, StoreDecl>;
435
+ results: Record<string, 'none' | 'scalar' | 'maybe'>;
436
+ inject?: string[];
437
+ };
438
+ export type Inferred = {
439
+ answers: Map<string, SType>;
440
+ cut: Map<string, string>;
441
+ };
442
+ type Tag = {
443
+ k: 'skip' | 'answer' | 'strict';
444
+ arg: string;
445
+ };
446
+ type Bound = {
447
+ key: string;
448
+ name: string;
449
+ patch?: Patch;
450
+ ret?: SType;
451
+ own?: string;
452
+ recv?: V;
453
+ tag?: Tag;
454
+ refusal: string;
455
+ args?: false;
456
+ };
457
+ type Pend = Bound & {
458
+ why: string;
459
+ at: string;
460
+ end?: string;
461
+ };
462
+ export declare class Stepper {
463
+ readonly mod: SModule;
464
+ readonly opts: StepOptions;
465
+ readonly inf?: Inferred | undefined;
466
+ readonly vars: Map<string, Var>;
467
+ readonly inputs: Var[];
468
+ readonly params: Var[];
469
+ readonly notes: Set<string>;
470
+ readonly refusals: B[];
471
+ fails: B[];
472
+ failPaths: Path[];
473
+ readonly maps: MapDecl[];
474
+ readonly answers: Map<string, Answer>;
475
+ readonly arms: Set<string>;
476
+ readonly hints: WeakMap<object, string>;
477
+ readonly lazy: Map<string, {
478
+ prefix: string;
479
+ ty: string;
480
+ args: [string, PArg][];
481
+ vals: Map<string, V>;
482
+ }>;
483
+ readonly initHeap: Map<string, Obj>;
484
+ readonly storeMaps: Map<string, {
485
+ store: string;
486
+ tpl: string;
487
+ id: string;
488
+ decl: MapDecl;
489
+ }>;
490
+ frames: string[];
491
+ fieldNames: Set<string>;
492
+ readonly frozen: Set<string>;
493
+ readonly ints: Map<string, IntTy>;
494
+ readonly paramsOut: B[];
495
+ now?: Var;
496
+ madeAt?: Var;
497
+ method: string;
498
+ fresh: number;
499
+ init: boolean;
500
+ constructor(mod: SModule, opts: StepOptions, inf?: Inferred | undefined);
501
+ rec(name: string, at: {
502
+ p: string;
503
+ }): SRec;
504
+ newVar(name: string, sort: Var['sort'], role: Var['role'], note?: string): Var;
505
+ valueOf(v: Var): V;
506
+ scalar(t: SType): Var['sort'] | undefined;
507
+ why(t: SType): string;
508
+ input(name: string, t: SType, at: {
509
+ p: string;
510
+ }, p: Path, role?: Var['role']): [V, PArg];
511
+ intTy(t: SType): IntTy | undefined;
512
+ typed(v: Var, t: SType | IntTy, role: Var['role'], sel?: I.B): void;
513
+ sel: B;
514
+ clock(at: {
515
+ p: string;
516
+ }, p: Path): [V, Path];
517
+ cond(p: Path): B;
518
+ assume(p: Path, c: B): Path;
519
+ fail(p: Path, c: B, at: {
520
+ p: string;
521
+ }, what: string): void;
522
+ unwritten(p: Path, at: {
523
+ p: string;
524
+ }, what: string): void;
525
+ changed(p: Path): boolean;
526
+ join(ps: Path[], at: {
527
+ p: string;
528
+ }): Path | undefined;
529
+ merge(a: Path, b: Path, at: {
530
+ p: string;
531
+ }): Path;
532
+ mergeObj(c: B, a: Obj, b: Obj, at: {
533
+ p: string;
534
+ }): Obj;
535
+ ite(c: B, a: V, b: V, at: {
536
+ p: string;
537
+ }): V;
538
+ iteFirm(c: B, a: V, b: V, at: {
539
+ p: string;
540
+ }): V;
541
+ baseCell(d: MapDecl, key: K): {
542
+ has: B;
543
+ vals: Map<string, V>;
544
+ };
545
+ narrow(v: V, p: Path): V;
546
+ truthy(v: V, at: {
547
+ p: string;
548
+ }, p?: Path): B;
549
+ plainTruth(ty: string): boolean;
550
+ numOf(v: V, at: SX, p: Path): N;
551
+ keyOf(v: V, at: SX): K;
552
+ func(id: string, at: {
553
+ p: string;
554
+ }): SFunc;
555
+ callFunc(f: SFunc, self: V | undefined, args: V[], kw: [string, V][], at: SX, p0: Path, awaited: boolean, caps?: Map<string, V>): [V, Path];
556
+ arm(ss: SS[]): void;
557
+ block(ss: SS[], p: Path): Flow;
558
+ stmt(s: SS, p: Path): Flow;
559
+ assign(to: SX, v: V, at: {
560
+ p: string;
561
+ }, p: Path, t?: SType): Path;
562
+ setField(o: V, f: string, v: V, at: SX, p: Path, t?: SType): Path;
563
+ declared: Map<string, SType>;
564
+ fit(v: V, f: Var, at: SX): V;
565
+ mapObj(m: V, at: SX, p: Path): [string, Extract<Obj, {
566
+ k: 'map';
567
+ }>];
568
+ cellOf(o: Extract<Obj, {
569
+ k: 'map';
570
+ }>, key: K, _p: Path, _at: SX): {
571
+ has: B;
572
+ vals: Map<string, V>;
573
+ };
574
+ writeCell(id: string, o: Extract<Obj, {
575
+ k: 'map';
576
+ }>, key: K, has: B, vals: Map<string, V>, at: SX, p: Path): Path;
577
+ mapGet(m: V, k: K, at: SX, p: Path, missing: 'fail' | 'none' | V): [V, Path];
578
+ mapSet(m: V, k: K, v: V, at: SX, p: Path): Path;
579
+ mapDel(m: V, k: K, at: SX, p: Path, strict: boolean): Path;
580
+ mapDeclOf(name: string, t: SType, at: {
581
+ p: string;
582
+ }): MapDecl;
583
+ storeMap(store: string, tpl: string, kn: boolean, at: SX, p: Path): [string, Extract<Obj, {
584
+ k: 'map';
585
+ }>];
586
+ storeKey(v: V, at: SX): {
587
+ tpl: string;
588
+ k: K;
589
+ kn: boolean;
590
+ };
591
+ readonly storeAsync: Record<string, Record<string, boolean>>;
592
+ readonly storeDecls: Map<string, StoreDecl>;
593
+ readonly storeTypes: Map<string, string>;
594
+ readonly storeKeyed: Set<string>;
595
+ readonly injectedFields: string[];
596
+ readonly deps: {
597
+ name: string;
598
+ ty?: string;
599
+ keyed: boolean;
600
+ stated: boolean;
601
+ }[];
602
+ injected(pa: SParam, init: SFunc, r: SRec): {
603
+ keyed: boolean;
604
+ ty?: string;
605
+ } | undefined;
606
+ callsOn(r: SRec, fields: string[]): string[];
607
+ storeDecl(store: string): StoreDecl;
608
+ storeCall(store: string, m: string, args: V[], kw: [string, V][], at: SX, p: Path, awaited: boolean): [V, Path];
609
+ calleeNames(x: SX): string[];
610
+ match(list: string[] | undefined, names: string[]): string | undefined;
611
+ skipped(names: string[]): boolean;
612
+ answer(key: string, names: string[], patch: Patch | undefined, at: SX, p: Path, awaited: boolean, type?: string | SType, how?: string): [V, Path];
613
+ readonly pend: Map<string, Pend>;
614
+ readonly entryIds: Set<string>;
615
+ boundary(x: SX, b: Bound, p: Path, awaited: boolean): [V, Path];
616
+ argVals(x: SX, p: Path): [V[], Path];
617
+ stateRef(v: V, p: Path): boolean;
618
+ rootsOf(fn: SFunc, recv: V | undefined, args: V[], p: Path): Set<string>;
619
+ writesState(id: string, roots: Set<string>, seen?: Set<string>): boolean;
620
+ private tagLines;
621
+ tagAt(at: string): Tag | undefined;
622
+ fnTag(fn: SFunc): Tag | undefined;
623
+ ownPatch(fn: SFunc, self: V | undefined): Patch | undefined;
624
+ ownCut(fn: SFunc, self: V | undefined, x: SX): Bound | undefined;
625
+ promote(e: Refusal): Refusal | undefined;
626
+ ev(x: SX, p: Path, awaited?: boolean): [V, Path];
627
+ copy(v: V, p: Path, at: SX): [V, Path];
628
+ isOf(v: V, k: string, at: SX): B;
629
+ inner(v: V, k: string, at: SX): V;
630
+ rmw(x: SX, p: Path): [V, Path];
631
+ get(x: SX, p: Path): [V, Path];
632
+ lazyField(id: string, obj: Extract<Obj, {
633
+ k: 'rec';
634
+ }>, f: string, x: SX, p: Path): [V, Path];
635
+ storeAttr(store: string, path: string, x: SX, p: Path): [V, Path];
636
+ bin(x: SX, p: Path): [V, Path];
637
+ fixed(x: SX, p: Path): [V, Path];
638
+ cast(x: SX, p: Path): [V, Path];
639
+ discsOf(values: string[]): number[];
640
+ floorDiv(a: N, k: number): N;
641
+ compare(x: SX, p: Path): [V, Path];
642
+ equal(a: V, b: V, at: SX, p: Path): B;
643
+ boolOp(x: SX, p: Path): [V, Path];
644
+ fstr(x: SX, p: Path): [V, Path];
645
+ call(x: SX, p: Path, awaited: boolean): [V, Path];
646
+ argsRead(x: SX, p: Path): Path;
647
+ evArgs<T>(x: SX, p: Path, k: (args: V[], kw: [string, V][], p: Path) => T): T;
648
+ dictCall(m: V, name: string, x: SX, p: Path): [V, Path];
649
+ construct(rec: string, args: V[], kw: [string, V][], x: SX, p: Path): [V, Path];
650
+ builtin(n: string, x: SX, p: Path): [V, Path];
651
+ quotient(d: SX, p: Path, round: 'floor' | 'ceil' | 'trunc'): [V, Path];
652
+ lib(q0: string, x: SX, p: Path): [V, Path];
653
+ readonly edges: B[];
654
+ readonly lists: MapDecl[];
655
+ readonly spans: Map<string, [string, number, number]>;
656
+ readonly stateOrigin: Map<string, string>;
657
+ readonly lazyIn: Map<string, {
658
+ id: string;
659
+ fields: [string, string][];
660
+ sel: B;
661
+ recipes: Record<string, Recipe>;
662
+ }>;
663
+ refuseWhere(p: Path, c: B, at: {
664
+ p: string;
665
+ }, what: string, state?: boolean): void;
666
+ cases(p: Ptr, c?: B): {
667
+ nil: B;
668
+ objs: {
669
+ c: B;
670
+ id: string;
671
+ path: string[];
672
+ }[];
673
+ };
674
+ nonNil(to: Ptr, at: {
675
+ p: string;
676
+ }, p: Path, what: string): [ReturnType<Stepper['cases']>, Path];
677
+ shift(p: Ptr, path: string[]): Ptr;
678
+ readObj(o: Obj, path: string[], at: {
679
+ p: string;
680
+ }, p: Path, id: string): V;
681
+ writeObj(o: Obj, path: string[], x: V, at: {
682
+ p: string;
683
+ }): Obj;
684
+ lazyFieldIn(id: string, f: string, p: Path, at: {
685
+ p: string;
686
+ }): V;
687
+ valueOfIn(v: Var, ty: IntTy | undefined, sel: B): V;
688
+ deref(v: V, path: string[], at: {
689
+ p: string;
690
+ }, p: Path): [V, Path];
691
+ writeThrough(v: V, path: string[], x: V, at: {
692
+ p: string;
693
+ }, p: Path): Path;
694
+ place(x: SX, p: Path): [Place, Path];
695
+ read(pl: Place, at: SX | SS | {
696
+ p: string;
697
+ }, p: Path): [V, Path];
698
+ write(pl: Place, x: V, at: {
699
+ p: string;
700
+ }, p: Path): Path;
701
+ secondName(x: V, at: {
702
+ p: string;
703
+ }): void;
704
+ keepsInState(pl: Extract<Place, {
705
+ k: 'heap';
706
+ }>, x: V, at: {
707
+ p: string;
708
+ }, p: Path): void;
709
+ bindLocal(id: string, v: V, at: {
710
+ p: string;
711
+ }, p: Path): Path;
712
+ numv(v: V, at: SX | {
713
+ p: string;
714
+ }): N;
715
+ boolv(v: V, at: SX | {
716
+ p: string;
717
+ }): B;
718
+ binop(op: string, a: V, b: V, x: {
719
+ p: string;
720
+ }, p: Path): V;
721
+ eq(a: V, b: V, x: {
722
+ p: string;
723
+ }, p?: Path): B;
724
+ arith(op: string, a: V, b: V, x: {
725
+ p: string;
726
+ }, p: Path): V;
727
+ quot(a: N, k: number): N;
728
+ rem(a: N, k: number): N;
729
+ bounds(e: N): [number, number];
730
+ wrap(e: N, ty: IntTy, x: {
731
+ p: string;
732
+ }, p: Path): N;
733
+ past(e: N, lo: number, hi: number, p: Path): [B, B];
734
+ within(e: N, b: number, side: 'lo' | 'hi', p: Path): boolean;
735
+ mapAt(m: V, at: SX, p: Path): Extract<Obj, {
736
+ k: 'map';
737
+ }>;
738
+ mkey(k: V, d: MapDecl, at: SX): K;
739
+ mapRead(m: V, k: V, at: SX, p: Path): {
740
+ v: V;
741
+ has: B;
742
+ };
743
+ mapWrite(m: V, k: V, v: V, at: SX, p: Path): Path;
744
+ mapDelete(m: V, k: V, at: SX, p: Path): Path;
745
+ mapAssign(x: SX, v: V, p: Path): Path;
746
+ listObj(s: V, at: SX, p: Path): Extract<Obj, {
747
+ k: 'list';
748
+ }>;
749
+ listLen(s: V, at: SX, p: Path): N;
750
+ inside(s: V, i: V, at: SX, p: Path): [Extract<Obj, {
751
+ k: 'list';
752
+ }>, N, B];
753
+ listGet(s: V, i: V, at: SX, p: Path): [V, Path];
754
+ listSet(s: V, i: V, v: V, at: SX, p: Path): Path;
755
+ listAssign(x: SX, v: V, p: Path): Path;
756
+ newBig(v: N, p: Path): [V, Path];
757
+ bigVal(v: V, at: SX, p: Path): [N, Path];
758
+ bigCall(x: SX, p: Path): [V, Path];
759
+ lockKey(x: SX, p: Path): string;
760
+ lockCall(x: SX, p: Path): [V, Path];
761
+ inline(fn: SFunc, recv: V | undefined, args: V[], at: SX, p: Path): [V, Path];
762
+ assignGo(s: SS, p: Path): Path;
763
+ assignTo(l: SX[], vals: V[], p: Path): Path;
764
+ switchGo(s: SS, p: Path): Flow;
765
+ }
766
+ export declare const phiP: (c: B, a: Ptr, b: Ptr) => Ptr;
767
+ export declare function disjoint(a: string, b: string): boolean;
768
+ export declare function assumed(x: {
769
+ read?: StepRead;
770
+ }, request: Record<string, unknown> | undefined): string[];
771
+ export declare function sourceOf(mod: {
772
+ path: string;
773
+ root: string;
774
+ }, file: string): string | undefined;
775
+ export declare function stubbed(read: StepRead, text: (file: string) => string | undefined, stub: (a: Answer, i: number, call: string) => string): Map<string, string>;
776
+ export declare const entryNames: (opts: {
777
+ entry?: string | string[];
778
+ }) => string[];
779
+ export declare function readStep(mod: SModule, opts: StepOptions): StepRead;
780
+ export declare const rangeOf: (ty: IntTy) => [number, number];
781
+ type CellW = {
782
+ key: K;
783
+ has: B;
784
+ vals: Record<string, Term>;
785
+ };
786
+ export declare function mapWritesOf(g: Stepper, d: MapDecl, sels: B[], ws: (CellW | undefined)[], fix?: (i: number, w: CellW, base: (k: K) => CellW) => CellW): CellW | undefined;
787
+ export declare const rangeLaws: (state: Var[], ints: Map<string, IntTy>) => string[];
788
+ export declare const varTerm: (v: Var) => Term;
789
+ export declare function iteTerm(c: B, a: Term, b: Term): Term;
790
+ type Raw = number | boolean | string;
791
+ export declare const node: <T>(id: string) => T;
792
+ export type Harness = {
793
+ cmd: string;
794
+ args: string[];
795
+ env?: Record<string, string>;
796
+ hello: Record<string, unknown>;
797
+ error?: string;
798
+ };
799
+ export type StepEvidence = Evidence & {
800
+ runMs: number;
801
+ };
802
+ export declare function checkStep(h: Harness, read: StepRead, r: Rule, sorts: Sorts, opts: StepOptions): StepEvidence;
803
+ export declare function extractStep(mod: SModule, h: (read: StepRead) => Harness, opts: StepOptions): Extraction & {
804
+ read?: StepRead;
805
+ };
806
+ export declare function stepNames(read: StepRead): Name[];