gdp-wired 0.44.0 → 0.45.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 (66) hide show
  1. package/dist/core/c/reader.js +22 -7
  2. package/dist/core/check.js +3 -2
  3. package/dist/core/cli.d.ts +1 -0
  4. package/dist/core/cli.js +136 -6
  5. package/dist/core/counts.d.ts +1 -1
  6. package/dist/core/counts.js +30 -12
  7. package/dist/core/data.d.ts +6 -1
  8. package/dist/core/data.js +894 -152
  9. package/dist/core/dsl.d.ts +2 -0
  10. package/dist/core/dsl.js +88 -10
  11. package/dist/core/effect-prims.js +2 -2
  12. package/dist/core/ex/reader.exs +17 -1
  13. package/dist/core/exists.d.ts +15 -1
  14. package/dist/core/exists.js +263 -41
  15. package/dist/core/extract-c.js +19 -12
  16. package/dist/core/extract-check.d.ts +6 -0
  17. package/dist/core/extract-check.js +49 -3
  18. package/dist/core/extract-ex.js +3 -3
  19. package/dist/core/extract-go-check.js +19 -12
  20. package/dist/core/extract-go.js +20 -5
  21. package/dist/core/extract-jvm.js +63 -14
  22. package/dist/core/extract-print.js +3 -0
  23. package/dist/core/extract-py.js +3 -3
  24. package/dist/core/extract-rb.js +3 -3
  25. package/dist/core/extract-read.d.ts +8 -0
  26. package/dist/core/extract-read.js +55 -0
  27. package/dist/core/extract-rs.js +17 -19
  28. package/dist/core/extract-shapes.js +20 -0
  29. package/dist/core/extract-sol.js +19 -8
  30. package/dist/core/extract-step.d.ts +50 -3
  31. package/dist/core/extract-step.js +289 -58
  32. package/dist/core/extract-swift.js +20 -13
  33. package/dist/core/extract.d.ts +1 -0
  34. package/dist/core/extract.js +27 -2
  35. package/dist/core/fresh.d.ts +2 -2
  36. package/dist/core/fresh.js +7 -3
  37. package/dist/core/go/reader.go +7 -1
  38. package/dist/core/infer.js +115 -42
  39. package/dist/core/jvm/JavaReader.java +10 -2
  40. package/dist/core/jvm/Jvm.java +17 -1
  41. package/dist/core/jvm/KtReader.java +57 -5
  42. package/dist/core/machine.d.ts +1 -2
  43. package/dist/core/machine.js +27 -15
  44. package/dist/core/py/harness.py +77 -11
  45. package/dist/core/py/reader.py +50 -5
  46. package/dist/core/rb/reader.rb +52 -5
  47. package/dist/core/rs/src/main.rs +10 -0
  48. package/dist/core/sol/harness.py +6 -3
  49. package/dist/core/solver.js +5 -4
  50. package/dist/core/system.d.ts +62 -1
  51. package/dist/core/system.js +262 -3
  52. package/dist/core/transfer.js +17 -0
  53. package/dist/core/watch.js +1 -1
  54. package/dist/interchange/check.js +10 -10
  55. package/dist/interchange/format.d.ts +4 -0
  56. package/dist/interchange/format.js +13 -5
  57. package/dist/kernel/cdcl.js +33 -2
  58. package/dist/kernel/epr.js +35 -5
  59. package/dist/kernel/kernel.d.ts +2 -0
  60. package/dist/kernel/kernel.js +67 -40
  61. package/dist/kernel/prove.d.ts +22 -0
  62. package/dist/kernel/prove.js +156 -7
  63. package/dist/lean-kernel/emit.d.ts +9 -3
  64. package/dist/lean-kernel/emit.js +170 -29
  65. package/dist/lean-kernel/library.js +1 -1
  66. package/package.json +2 -2
@@ -108,6 +108,7 @@ export type SRec = {
108
108
  module: string;
109
109
  p: string;
110
110
  rets?: Record<string, SType>;
111
+ cattrs?: Record<string, number | string | boolean | null>;
111
112
  };
112
113
  export type SModule = {
113
114
  lang: string;
@@ -164,13 +165,15 @@ type Try = {
164
165
  ws: B[];
165
166
  depth: number;
166
167
  };
167
- export type StoreVal = 'int' | 'float' | string[] | {
168
+ export type StoreVal = 'int' | 'float' | 'str' | string[] | {
168
169
  json: Record<string, string | string[]>;
169
170
  };
170
171
  export type StoreDecl = {
171
172
  get?: string[];
172
173
  set?: string[];
173
174
  delete?: string[];
175
+ add?: string[];
176
+ incr?: string[];
174
177
  skip?: string[];
175
178
  value?: 'int' | 'float' | 'str';
176
179
  attrs?: Record<string, null | boolean | number | string>;
@@ -192,10 +195,13 @@ export type StepOptions = {
192
195
  answers?: Record<string, string>;
193
196
  skip?: string[];
194
197
  stores?: Record<string, StoreDecl>;
198
+ effects?: string[];
199
+ stubs?: string[];
195
200
  strict?: boolean;
196
201
  failures?: 'refuse' | 'kept';
197
202
  onError?: 'refuse' | 'discard';
198
203
  domains?: Record<string, 'nat' | 'int'>;
204
+ types?: Record<string, string>;
199
205
  keep?: string[];
200
206
  defaults?: string[];
201
207
  fields?: Record<string, null | boolean | number | string>;
@@ -329,6 +335,7 @@ type CellWrite = {
329
335
  key: K;
330
336
  has: B;
331
337
  vals: Map<string, V>;
338
+ on?: B;
332
339
  };
333
340
  type Ptr = {
334
341
  k: 'nil';
@@ -412,6 +419,7 @@ type Path = {
412
419
  locks: string[];
413
420
  defers: string[];
414
421
  cont?: true;
422
+ eff?: Map<string, B>;
415
423
  };
416
424
  type Flow = {
417
425
  live?: Path;
@@ -437,6 +445,7 @@ export type Leaf = {
437
445
  store?: string;
438
446
  tpl?: string;
439
447
  ordered?: boolean;
448
+ str?: boolean;
440
449
  json?: JField[];
441
450
  choice?: boolean;
442
451
  };
@@ -492,6 +501,8 @@ export type Answer = {
492
501
  m: string;
493
502
  }[];
494
503
  pass?: boolean;
504
+ effect?: boolean;
505
+ quiet?: boolean;
495
506
  };
496
507
  export type StepRead = {
497
508
  ints: Record<string, IntTy>;
@@ -507,13 +518,22 @@ export type StepRead = {
507
518
  stores: Record<string, StoreDecl>;
508
519
  results: Record<string, 'none' | 'scalar' | 'maybe'>;
509
520
  inject?: string[];
521
+ globals?: {
522
+ name: string;
523
+ mod: string;
524
+ }[];
525
+ effectsOf?: Record<string, string[]>;
526
+ inert?: {
527
+ store: string;
528
+ path: string;
529
+ }[];
510
530
  };
511
531
  export type Inferred = {
512
532
  answers: Map<string, SType>;
513
533
  cut: Map<string, string>;
514
534
  };
515
535
  type Tag = {
516
- k: 'skip' | 'answer' | 'strict';
536
+ k: 'skip' | 'answer' | 'strict' | 'effect';
517
537
  arg: string;
518
538
  };
519
539
  type Bound = {
@@ -747,6 +767,14 @@ export declare class Stepper {
747
767
  readonly storeTypes: Map<string, string>;
748
768
  readonly storeKeyed: Set<string>;
749
769
  readonly injectedFields: string[];
770
+ readonly globalStores: {
771
+ name: string;
772
+ mod: string;
773
+ }[];
774
+ readonly inertAttrs: {
775
+ store: string;
776
+ path: string;
777
+ }[];
750
778
  readonly deps: {
751
779
  name: string;
752
780
  ty?: string;
@@ -816,7 +844,7 @@ export declare class Stepper {
816
844
  equal(a: V, b: V, at: SX, p: Path): B;
817
845
  truth(x: SX, p: Path): [B, Path];
818
846
  boolOp(x: SX, p: Path): [V, Path];
819
- fstr(x: SX, p: Path): [V, Path];
847
+ fstr(x: SX, p: Path, given?: (string | V)[]): [V, Path];
820
848
  call(x: SX, p: Path, awaited: boolean): [V, Path];
821
849
  argsRead(x: SX, p: Path): Path;
822
850
  evArgs<T>(x: SX, p: Path, k: (args: V[], kw: [string, V][], p: Path) => T): T;
@@ -970,6 +998,24 @@ export declare function iteTerm(c: B, a: Term, b: Term): Term;
970
998
  type Raw = number | boolean | string;
971
999
  export declare const node: <T>(id: string) => T;
972
1000
  export declare function asset(rel: string): string;
1001
+ export declare const harnessLimit: () => number;
1002
+ export declare const compileLimit: () => number;
1003
+ export type Built<T> = {
1004
+ ok: T;
1005
+ } | {
1006
+ kind: 'source' | 'harness';
1007
+ why: string;
1008
+ };
1009
+ export declare function buildCheck<T>(tool: string, run: () => T, errorsOf: (e: unknown) => string[], ofSource: (line: string) => boolean, first?: unknown): Built<T>;
1010
+ export declare const builtEvidence: (b: {
1011
+ kind: "source" | "harness";
1012
+ why: string;
1013
+ }) => {
1014
+ source: string;
1015
+ } | {
1016
+ harness: string;
1017
+ };
1018
+ export declare const stopped: (res: Record<string, unknown>) => Record<string, unknown>;
973
1019
  export declare function openHarness(work: string, cmd: string, args: string[], o: Record<string, unknown>): {
974
1020
  child: {
975
1021
  kill: () => void;
@@ -983,6 +1029,7 @@ export type Harness = {
983
1029
  env?: Record<string, string>;
984
1030
  hello: Record<string, unknown>;
985
1031
  error?: string;
1032
+ kind?: 'source' | 'harness';
986
1033
  };
987
1034
  export type StepEvidence = Evidence & {
988
1035
  runMs: number;