gdp-wired 0.34.0 → 0.36.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.
- package/dist/core/counts.d.ts +31 -0
- package/dist/core/counts.js +264 -0
- package/dist/core/dsl.d.ts +10 -0
- package/dist/core/dsl.js +19 -1
- package/dist/core/extract-check.d.ts +1 -0
- package/dist/core/extract-check.js +43 -6
- package/dist/core/extract-ir.d.ts +6 -0
- package/dist/core/extract-ir.js +2 -0
- package/dist/core/extract-print.js +29 -2
- package/dist/core/extract-read.d.ts +12 -0
- package/dist/core/extract-step.d.ts +78 -3
- package/dist/core/extract-step.js +515 -34
- package/dist/core/extract.js +17 -2
- package/dist/core/machine.d.ts +8 -1
- package/dist/core/machine.js +35 -5
- package/dist/core/py/harness.py +28 -10
- package/dist/core/py/reader.py +57 -4
- package/dist/core/rb/harness.rb +10 -5
- package/dist/core/rb/reader.rb +49 -2
- package/dist/core/watch.js +1 -1
- package/dist/kernel/kernel.d.ts +25 -0
- package/dist/kernel/kernel.js +159 -2
- package/dist/lean-kernel/emit.d.ts +8 -1
- package/dist/lean-kernel/emit.js +68 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as I from './extract-ir.js';
|
|
2
2
|
import type { B, K, L, N } from './extract-ir.js';
|
|
3
|
-
import { type LeastRead, type MapDecl, type Model, Refusal, type Term, type Var } from './extract-read.js';
|
|
3
|
+
import { type Fold, type LeastRead, type MapDecl, type Model, Refusal, type Term, type Var } from './extract-read.js';
|
|
4
4
|
import { type Extraction, type Name } from './extract.js';
|
|
5
5
|
import type { Rule } from './dsl.js';
|
|
6
6
|
import { type Sorts } from './extract-print.js';
|
|
@@ -133,6 +133,31 @@ export type SModule = {
|
|
|
133
133
|
split?: boolean;
|
|
134
134
|
truth?: 'nil-false';
|
|
135
135
|
stubs?: boolean;
|
|
136
|
+
kinds?: Record<string, string[]>;
|
|
137
|
+
exc?: {
|
|
138
|
+
mro: string[];
|
|
139
|
+
raise: unknown;
|
|
140
|
+
};
|
|
141
|
+
lists?: boolean;
|
|
142
|
+
};
|
|
143
|
+
export type Handler = {
|
|
144
|
+
p?: string;
|
|
145
|
+
any?: boolean;
|
|
146
|
+
names: string[];
|
|
147
|
+
mro?: string[];
|
|
148
|
+
open?: boolean;
|
|
149
|
+
raise?: unknown;
|
|
150
|
+
as?: string;
|
|
151
|
+
body: SS[];
|
|
152
|
+
};
|
|
153
|
+
type Kind = {
|
|
154
|
+
mro: string[];
|
|
155
|
+
open?: boolean;
|
|
156
|
+
} | null | undefined;
|
|
157
|
+
type Try = {
|
|
158
|
+
hs: Handler[];
|
|
159
|
+
to: [Path, number, Kind][];
|
|
160
|
+
ws: B[];
|
|
136
161
|
};
|
|
137
162
|
export type StoreDecl = {
|
|
138
163
|
get?: string[];
|
|
@@ -356,6 +381,7 @@ type Path = {
|
|
|
356
381
|
called: string[];
|
|
357
382
|
locks: string[];
|
|
358
383
|
defers: string[];
|
|
384
|
+
cont?: true;
|
|
359
385
|
};
|
|
360
386
|
type Flow = {
|
|
361
387
|
live?: Path;
|
|
@@ -402,6 +428,10 @@ export type PArg = {
|
|
|
402
428
|
name: string;
|
|
403
429
|
} | {
|
|
404
430
|
k: 'dflt';
|
|
431
|
+
} | {
|
|
432
|
+
k: 'list';
|
|
433
|
+
name: string;
|
|
434
|
+
item: PArg;
|
|
405
435
|
};
|
|
406
436
|
export type Answer = {
|
|
407
437
|
key: string;
|
|
@@ -421,6 +451,12 @@ export type Answer = {
|
|
|
421
451
|
}[];
|
|
422
452
|
ty?: string;
|
|
423
453
|
fit?: boolean;
|
|
454
|
+
raises?: {
|
|
455
|
+
name: string;
|
|
456
|
+
cls: unknown[];
|
|
457
|
+
m: string;
|
|
458
|
+
}[];
|
|
459
|
+
pass?: boolean;
|
|
424
460
|
};
|
|
425
461
|
export type StepRead = {
|
|
426
462
|
ints: Record<string, IntTy>;
|
|
@@ -482,6 +518,11 @@ export declare class Stepper {
|
|
|
482
518
|
args: [string, PArg][];
|
|
483
519
|
vals: Map<string, V>;
|
|
484
520
|
}>;
|
|
521
|
+
readonly seqs: MapDecl[];
|
|
522
|
+
readonly used: Set<string>;
|
|
523
|
+
readonly folds: Fold[];
|
|
524
|
+
hidden: number;
|
|
525
|
+
inFold: number;
|
|
485
526
|
readonly initHeap: Map<string, Obj>;
|
|
486
527
|
readonly storeMaps: Map<string, {
|
|
487
528
|
store: string;
|
|
@@ -504,7 +545,7 @@ export declare class Stepper {
|
|
|
504
545
|
rec(name: string, at: {
|
|
505
546
|
p: string;
|
|
506
547
|
}): SRec;
|
|
507
|
-
newVar(name: string, sort: Var['sort'], role: Var['role'], note?: string): Var;
|
|
548
|
+
newVar(name: string, sort: Var['sort'], role: Var['role'], note?: string, own?: boolean): Var;
|
|
508
549
|
valueOf(v: Var): V;
|
|
509
550
|
scalar(t: SType): Var['sort'] | undefined;
|
|
510
551
|
why(t: SType): string;
|
|
@@ -521,7 +562,35 @@ export declare class Stepper {
|
|
|
521
562
|
assume(p: Path, c: B): Path;
|
|
522
563
|
fail(p: Path, c: B, at: {
|
|
523
564
|
p: string;
|
|
524
|
-
}, what: string): void;
|
|
565
|
+
}, what: string, kind?: Kind): void;
|
|
566
|
+
tries: Try[];
|
|
567
|
+
handling: Kind[][];
|
|
568
|
+
cms: number[];
|
|
569
|
+
kindOf(what: string, at: {
|
|
570
|
+
p: string;
|
|
571
|
+
}): Kind;
|
|
572
|
+
catcher(k: Kind, at: {
|
|
573
|
+
p: string;
|
|
574
|
+
}, loose?: boolean): [Try, number] | undefined;
|
|
575
|
+
raise(p: Path, c: B, w: B, [t, i]: [Try, number], k: Kind, at: {
|
|
576
|
+
p: string;
|
|
577
|
+
}): void;
|
|
578
|
+
tryStmt(s: SS, p: Path): Flow;
|
|
579
|
+
listOf(v: V, p: Path, at: SX, carried?: boolean): {
|
|
580
|
+
id: string;
|
|
581
|
+
o: Extract<Obj, {
|
|
582
|
+
k: 'map';
|
|
583
|
+
}>;
|
|
584
|
+
len: N;
|
|
585
|
+
held: (k: K) => B;
|
|
586
|
+
} | undefined;
|
|
587
|
+
forStmt(s: SS, p: Path): Flow;
|
|
588
|
+
foldExpr(x: SX, p: Path): [V, Path];
|
|
589
|
+
changedFrom(e: Path, p: Path): boolean;
|
|
590
|
+
joinSome(ps: Path[], at: {
|
|
591
|
+
p: string;
|
|
592
|
+
}): Path | undefined;
|
|
593
|
+
mayRaise(a: Answer, name: string, at: SX, p: Path): Path;
|
|
525
594
|
unwritten(p: Path, at: {
|
|
526
595
|
p: string;
|
|
527
596
|
}, what: string): void;
|
|
@@ -653,7 +722,12 @@ export declare class Stepper {
|
|
|
653
722
|
match(list: string[] | undefined, names: string[]): string | undefined;
|
|
654
723
|
skipped(names: string[]): boolean;
|
|
655
724
|
answer(key: string, names: string[], patch: Patch | undefined, at: SX, p: Path, awaited: boolean, type?: string | SType, how?: string): [V, Path];
|
|
725
|
+
passing(key: string, name: string, patch: Patch | undefined, at: SX, p: Path, awaited: boolean): Path;
|
|
656
726
|
readonly pend: Map<string, Pend>;
|
|
727
|
+
readonly returnedBy: Map<string, {
|
|
728
|
+
id: string;
|
|
729
|
+
roots: string[];
|
|
730
|
+
}>;
|
|
657
731
|
readonly entryIds: Set<string>;
|
|
658
732
|
boundary(x: SX, b: Bound, p: Path, awaited: boolean): [V, Path];
|
|
659
733
|
argVals(x: SX, p: Path): [V[], Path];
|
|
@@ -665,6 +739,7 @@ export declare class Stepper {
|
|
|
665
739
|
fnTag(fn: SFunc): Tag | undefined;
|
|
666
740
|
ownPatch(fn: SFunc, self: V | undefined): Patch | undefined;
|
|
667
741
|
ownCut(fn: SFunc, self: V | undefined, x: SX): Bound | undefined;
|
|
742
|
+
cuttable(why: string): SFunc | undefined;
|
|
668
743
|
promote(e: Refusal): Refusal | undefined;
|
|
669
744
|
ev(x: SX, p: Path, awaited?: boolean): [V, Path];
|
|
670
745
|
copy(v: V, p: Path, at: SX): [V, Path];
|