gdp-wired 0.31.1 → 0.33.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 (84) hide show
  1. package/README.md +95 -6
  2. package/dist/core/c/reader.d.ts +86 -0
  3. package/dist/core/c/reader.js +860 -0
  4. package/dist/core/check.js +20 -6
  5. package/dist/core/cli.d.ts +76 -0
  6. package/dist/core/cli.js +636 -0
  7. package/dist/core/dsl.d.ts +6 -4
  8. package/dist/core/dsl.js +30 -16
  9. package/dist/core/effect.d.ts +6 -4
  10. package/dist/core/effect.js +48 -10
  11. package/dist/core/ex/harness.exs +177 -0
  12. package/dist/core/ex/json.exs +46 -0
  13. package/dist/core/ex/reader.exs +462 -0
  14. package/dist/core/exists.d.ts +3 -0
  15. package/dist/core/exists.js +19 -5
  16. package/dist/core/extract-c.d.ts +35 -0
  17. package/dist/core/extract-c.js +424 -0
  18. package/dist/core/extract-check.js +27 -6
  19. package/dist/core/extract-ex.d.ts +16 -0
  20. package/dist/core/extract-ex.js +33 -0
  21. package/dist/core/extract-go-check.d.ts +28 -0
  22. package/dist/core/extract-go-check.js +639 -0
  23. package/dist/core/extract-go.d.ts +231 -0
  24. package/dist/core/extract-go.js +1166 -0
  25. package/dist/core/extract-jvm.d.ts +23 -0
  26. package/dist/core/extract-jvm.js +220 -0
  27. package/dist/core/extract-print.js +17 -7
  28. package/dist/core/extract-py.d.ts +15 -0
  29. package/dist/core/extract-py.js +31 -0
  30. package/dist/core/extract-rb.d.ts +17 -0
  31. package/dist/core/extract-rb.js +31 -0
  32. package/dist/core/extract-read.d.ts +20 -0
  33. package/dist/core/extract-read.js +46 -6
  34. package/dist/core/extract-rs.d.ts +12 -0
  35. package/dist/core/extract-rs.js +306 -0
  36. package/dist/core/extract-shapes.d.ts +2 -0
  37. package/dist/core/extract-shapes.js +6 -5
  38. package/dist/core/extract-step.d.ts +806 -0
  39. package/dist/core/extract-step.js +4141 -0
  40. package/dist/core/extract-swift.d.ts +27 -0
  41. package/dist/core/extract-swift.js +484 -0
  42. package/dist/core/extract-xstate.d.ts +10 -3
  43. package/dist/core/extract-xstate.js +50 -4
  44. package/dist/core/extract.d.ts +22 -3
  45. package/dist/core/extract.js +107 -18
  46. package/dist/core/go/go.mod +3 -0
  47. package/dist/core/go/reader.go +901 -0
  48. package/dist/core/infer.d.ts +4 -0
  49. package/dist/core/infer.js +1838 -69
  50. package/dist/core/jvm/Harness.java +361 -0
  51. package/dist/core/jvm/JavaReader.java +825 -0
  52. package/dist/core/jvm/Jvm.java +332 -0
  53. package/dist/core/jvm/KtReader.java +960 -0
  54. package/dist/core/jvm/Rt.java +10 -0
  55. package/dist/core/laws.d.ts +83 -0
  56. package/dist/core/laws.js +623 -0
  57. package/dist/core/machine.d.ts +2 -0
  58. package/dist/core/machine.js +87 -0
  59. package/dist/core/py/harness.py +328 -0
  60. package/dist/core/py/reader.py +447 -0
  61. package/dist/core/rb/harness.rb +233 -0
  62. package/dist/core/rb/reader.rb +375 -0
  63. package/dist/core/relational.d.ts +49 -0
  64. package/dist/core/relational.js +345 -0
  65. package/dist/core/rs/Cargo.lock +108 -0
  66. package/dist/core/rs/Cargo.toml +14 -0
  67. package/dist/core/rs/src/main.rs +681 -0
  68. package/dist/core/swift/Harness.swift +124 -0
  69. package/dist/core/swift/Main.swift +34 -0
  70. package/dist/core/swift/Package.swift +13 -0
  71. package/dist/core/swift/Sources/gdp-swiftreader/main.swift +1341 -0
  72. package/dist/interchange/check.d.ts +16 -0
  73. package/dist/interchange/check.js +111 -0
  74. package/dist/interchange/format.d.ts +150 -0
  75. package/dist/interchange/format.js +678 -0
  76. package/dist/kernel/epr.d.ts +40 -0
  77. package/dist/kernel/epr.js +1882 -0
  78. package/dist/kernel/kernel.d.ts +45 -1
  79. package/dist/kernel/kernel.js +138 -13
  80. package/dist/kernel/prove.d.ts +45 -0
  81. package/dist/kernel/prove.js +658 -51
  82. package/dist/lean-kernel/emit.d.ts +17 -2
  83. package/dist/lean-kernel/emit.js +87 -7
  84. package/package.json +57 -2
@@ -1,4 +1,4 @@
1
- import type { C, E, Law, Machine } from '../core/machine.js';
1
+ import type { C, E, Law, Machine, MapUpdate } from '../core/machine.js';
2
2
  import { type Constraint, type Lin, type Step } from '../core/solver.js';
3
3
  export declare function unreachable(value: never): never;
4
4
  export type Tree = {
@@ -287,4 +287,48 @@ export declare function checkQMachine(m: QMachine, laws: QLaw[], trees: Record<s
287
287
  start: Tree;
288
288
  step: Tree;
289
289
  }>): boolean;
290
+ export type Count = {
291
+ v: string;
292
+ key: string;
293
+ below: E;
294
+ body: E;
295
+ };
296
+ export type CountInst = {
297
+ wit: string;
298
+ below: E;
299
+ terms: [number, string][];
300
+ unit: number;
301
+ };
302
+ export type CountedGoal = {
303
+ name: string;
304
+ hyps: C[];
305
+ counts: Count[];
306
+ };
307
+ export declare function countHyp(cs: Count[], i: CountInst): C | undefined;
308
+ export declare function countHyps(cs: Count[], is: CountInst[]): C[] | undefined;
309
+ export declare const witFresh: (hyps: C[], cs: Count[], is: CountInst[], w: string) => boolean;
310
+ export declare function countedOk(hyps: C[], cs: Count[], is: CountInst[]): boolean;
311
+ export declare function checkCounted(g: CountedGoal, cert: {
312
+ insts: CountInst[];
313
+ tree: Tree;
314
+ }): boolean;
315
+ export declare function countedGoal(g: CountedGoal, insts: CountInst[]): Goal | undefined;
316
+ export type GhostMap = {
317
+ start: number;
318
+ write: MapUpdate;
319
+ };
320
+ export type Ghosted = {
321
+ orig: Machine;
322
+ vars: Record<string, {
323
+ start: E;
324
+ step: E;
325
+ }>;
326
+ maps: Record<string, GhostMap>;
327
+ };
328
+ export declare function ghostedMachine(g: Ghosted): Machine;
329
+ export declare function ghostedOk(g: Ghosted): boolean;
330
+ export declare const checkGhostedLaws: (g: Ghosted, laws: Law[], proof: {
331
+ instances: Record<string, Instances>;
332
+ trees: Record<string, Tree>;
333
+ }) => boolean;
290
334
  export {};
@@ -50,13 +50,16 @@ export const canonFlip = (lin) => {
50
50
  export const atomOf = (lin, holds) => ({ lin: holds ? lin : add(k(1), scale(lin, -1)), label: '' });
51
51
  // Is lin <= 0 decided by the path? A constant atom decides itself.
52
52
  // Over the integers lin <= 0 fails exactly when 1 - lin <= 0 holds, so either atom decides the other.
53
+ // A form with a coefficient past a safe integer decides nothing: it may be a rounded difference, and its flip is
54
+ // rounded again (1 - (2^53 + 1) reads as the safe 1 - 2^53), so an atom about another form would decide it.
53
55
  function decide(lin, path) {
54
56
  let constant = true;
55
- for (const key in lin)
56
- if (key !== '1') {
57
+ for (const key in lin) {
58
+ if (!Number.isSafeInteger(lin[key]))
59
+ return undefined;
60
+ if (key !== '1')
57
61
  constant = false;
58
- break;
59
- }
62
+ }
60
63
  if (constant)
61
64
  return (lin['1'] ?? 0) <= 0;
62
65
  const direct = look(path, canon(lin));
@@ -124,14 +127,21 @@ export function linear(e, path) {
124
127
  memo.set(e, out);
125
128
  return out;
126
129
  }
130
+ // A form with a coefficient past a safe integer is no form: its float may be rounded, and every part is read through
131
+ // here, so no rounding inside a term goes unseen (core/check.ts refuses such rows too).
127
132
  function linearOf(e, path) {
133
+ const out = linearOp(e, path);
134
+ return out && safe(out) ? out : undefined;
135
+ }
136
+ const safe = (lin) => Object.values(lin).every(c => Number.isSafeInteger(c));
137
+ function linearOp(e, path) {
128
138
  switch (e.op) {
129
139
  case 'var': return e.name === '1' || /[*[\],:⟦]/.test(e.name) ? undefined : v(e.name); // those characters build cells, monomials and term columns
130
140
  case 'const': return k(e.value);
131
141
  case 'mul': {
132
142
  const a = linear(e.a, path);
133
- return a && scale(a, e.k);
134
- }
143
+ return a && Number.isSafeInteger(e.k) ? scale(a, e.k) : undefined;
144
+ } // (10 · 0.1 is a float 1)
135
145
  case 'prod': {
136
146
  const a = linear(e.a, path), b = linear(e.b, path);
137
147
  return a && b && times(a, b);
@@ -231,16 +241,23 @@ export function termRows(name, path) {
231
241
  // product is of its branch). Forgetting how monomials relate (x*x to x, say, or two monomials over cells the path
232
242
  // proves equal) only weakens what a leaf may use, so it stays sound; distributing is what proves spend <= m·count over
233
243
  // a node from the same law at its children.
244
+ // Every coefficient, product and partial sum a safe integer, else no product: a rounded product is past 2^53, but a
245
+ // monomial's other products could bring its sum back under it (and a square's form is the prover's, any float).
234
246
  function times(a, b) {
235
- const out = [];
247
+ const out = {};
236
248
  for (const [p, cp] of Object.entries(a))
237
249
  for (const [q, cq] of Object.entries(b)) {
238
250
  if (p.includes('⟦') || q.includes('⟦'))
239
251
  return undefined;
240
- const fs = [...(p === '1' ? [] : factorsOf(p)), ...(q === '1' ? [] : factorsOf(q))].sort();
241
- out.push({ [fs.length ? fs.join('*') : '1']: cp * cq });
252
+ const fs = [...(p === '1' ? [] : factorsOf(p)), ...(q === '1' ? [] : factorsOf(q))].sort(), key = fs.length ? fs.join('*') : '1', c = (out[key] ?? 0) + cp * cq;
253
+ if (!(Number.isSafeInteger(cp) && Number.isSafeInteger(cq) && Number.isSafeInteger(cp * cq) && Number.isSafeInteger(c)))
254
+ return undefined;
255
+ out[key] = c;
242
256
  }
243
- return add(...out);
257
+ for (const key in out)
258
+ if (out[key] === 0)
259
+ delete out[key];
260
+ return out;
244
261
  }
245
262
  // A name's factors: split at each '*' outside a cell's brackets (a cell's key may itself read a monomial).
246
263
  const factorMemo = new Map();
@@ -291,7 +308,10 @@ function comparisonOf(c, path) {
291
308
  const a = linear(c.a, path), b = linear(c.b, path);
292
309
  if (!a || !b)
293
310
  return undefined;
311
+ // A rounded difference gives no fact: one past 2^53 is refused as a row, but plus 1 it may be safe again.
294
312
  const ab = sub(a, b), ba = sub(b, a);
313
+ if (!safe(ab))
314
+ return undefined;
295
315
  if (c.op === '<=')
296
316
  return { when: [ab], unless: [[add(ba, k(1))]] };
297
317
  if (c.op === '<')
@@ -1341,18 +1361,21 @@ const isFC = (c) => c.op === '<' && c.a.op === 'const' && c.b.op === 'const' ? c
1341
1361
  const kE = (value) => ({ op: 'const', value });
1342
1362
  // Lean's folds, on kernel.ts's terms: an and of several (Lean: each and of two, nested to the right) is false if one is,
1343
1363
  // else the rest that aren't true, and so for or; read through the Lean text, the two give the same terms.
1344
- const foldMul = (k0, a) => (k0 === 0 ? kE(0) : k0 === 1 ? a : a.op === 'const' ? kE(k0 * a.value) : { op: 'mul', k: k0, a });
1364
+ // A constant folded past a safe integer is left unfolded (`kF`): its float may be rounded (2 + (2^53 - 1) is 2^53), and
1365
+ // the term unfolded has its value exactly, which the kernel's linear forms then refuse (Lean's Nat folds it exactly).
1366
+ const kF = (value, e) => (Number.isSafeInteger(value) ? kE(value) : e);
1367
+ const foldMul = (k0, a) => (k0 === 0 ? kE(0) : k0 === 1 ? a : a.op === 'const' ? kF(k0 * a.value, { op: 'mul', k: k0, a }) : { op: 'mul', k: k0, a });
1345
1368
  function foldTerm(e, f, fc) {
1346
1369
  switch (e.op) {
1347
1370
  case 'var':
1348
1371
  case 'const': return e;
1349
1372
  case 'add': {
1350
1373
  const a = f(e.a), b = f(e.b);
1351
- return a.op === 'const' && a.value === 0 ? b : b.op === 'const' && b.value === 0 ? a : a.op === 'const' && b.op === 'const' ? kE(a.value + b.value) : { op: 'add', a, b };
1374
+ return a.op === 'const' && a.value === 0 ? b : b.op === 'const' && b.value === 0 ? a : a.op === 'const' && b.op === 'const' ? kF(a.value + b.value, { op: 'add', a, b }) : { op: 'add', a, b };
1352
1375
  }
1353
1376
  case 'sub': {
1354
1377
  const a = f(e.a), b = f(e.b);
1355
- return b.op === 'const' && b.value === 0 ? a : a.op === 'const' && b.op === 'const' ? kE(Math.max(0, a.value - b.value)) : { op: 'sub', a, b };
1378
+ return b.op === 'const' && b.value === 0 ? a : a.op === 'const' && b.op === 'const' ? kF(Math.max(0, a.value - b.value), { op: 'sub', a, b }) : { op: 'sub', a, b };
1356
1379
  }
1357
1380
  case 'mul': return foldMul(e.k, f(e.a));
1358
1381
  case 'min':
@@ -1919,3 +1942,105 @@ export function checkQMachine(m, laws, trees) {
1919
1942
  return !!t && !qOccurs(law.holds, m.inputs) && checkQTree(goals.start, t.start) && checkQTree(goals.step, t.step);
1920
1943
  });
1921
1944
  }
1945
+ // Lean's beqE: equal by structure (every field, keys in order).
1946
+ const stable = (t) => JSON.stringify(t, (_, x) => (x && typeof x === 'object' && !Array.isArray(x) ? Object.fromEntries(Object.keys(x).sort().map(key => [key, x[key]])) : x));
1947
+ const sameE = (a, b) => stable(a) === stable(b);
1948
+ // findCount: the first count with the variable.
1949
+ const findCount = (cs, v) => cs.find(c => c.v === v);
1950
+ // resolve: each term's count, if every term names one whose bound is the instance's.
1951
+ function resolve(cs, B, ts) {
1952
+ const out = [];
1953
+ for (const [z, v] of ts) {
1954
+ const c = findCount(cs, v);
1955
+ if (!c || !sameE(c.below, B))
1956
+ return undefined;
1957
+ out.push([z, c]);
1958
+ }
1959
+ return out;
1960
+ }
1961
+ // sumE: a sum, right-nested from 0. posP, negP: Int.toNat z and Int.toNat (−z).
1962
+ const sumE = (es) => es.reduceRight((acc, e) => ({ op: 'add', a: e, b: acc }), { op: 'const', value: 0 });
1963
+ const posP = (z) => Math.max(z, 0), negP = (z) => Math.max(-z, 0);
1964
+ // side: each count read by rd times its coefficient's part, then the unit's part times `one`.
1965
+ const side = (part, rd, one, u, rs) => ({ op: 'add', a: sumE(rs.map(([z, c]) => ({ op: 'mul', k: part(z), a: rd(c) }))), b: { op: 'mul', k: part(u), a: one } });
1966
+ // atCount: the count's variable; atWit: its body at the witness (substE [(key, var w)] body).
1967
+ const atCount = (c) => ({ op: 'var', name: c.v });
1968
+ const atWit = (w) => (c) => substE(c.body, { vars: { [c.key]: { op: 'var', name: w } }, maps: {}, flags: {} });
1969
+ // countHyp: the instance's hypothesis (and/or binary, as Lean's .and/.or).
1970
+ export function countHyp(cs, i) {
1971
+ const rs = resolve(cs, i.below, i.terms);
1972
+ if (!rs)
1973
+ return undefined;
1974
+ const one = { op: 'const', value: 1 }, w = atWit(i.wit);
1975
+ return { op: 'or', xs: [
1976
+ { op: '<=', a: side(posP, atCount, i.below, i.unit, rs), b: side(negP, atCount, i.below, i.unit, rs) },
1977
+ { op: 'and', xs: [{ op: '<', a: { op: 'var', name: i.wit }, b: i.below }, { op: '<', a: side(negP, w, one, i.unit, rs), b: side(posP, w, one, i.unit, rs) }] }
1978
+ ] };
1979
+ }
1980
+ // countHyps: every instance's, in order, or none if one isn't built.
1981
+ export function countHyps(cs, is) {
1982
+ const out = [];
1983
+ for (const i of is) {
1984
+ const h = countHyp(cs, i);
1985
+ if (!h)
1986
+ return undefined;
1987
+ out.push(h);
1988
+ }
1989
+ return out;
1990
+ }
1991
+ // witFresh: no hypothesis reads w, no count names it or reads it (in its bound or body), no instance's bound reads it.
1992
+ const readsVar = (t, w) => reads(t).vars.has(w);
1993
+ export const witFresh = (hyps, cs, is, w) => hyps.every(h => !readsVar(h, w)) && cs.every(c => c.v !== w && !readsVar(c.below, w) && !readsVar(c.body, w)) && is.every(j => !readsVar(j.below, w));
1994
+ // countedOk: the witnesses distinct (cDistinct), each fresh.
1995
+ export function countedOk(hyps, cs, is) {
1996
+ const ws = is.map(i => i.wit);
1997
+ return new Set(ws).size === ws.length && is.every(i => witFresh(hyps, cs, is, i.wit));
1998
+ }
1999
+ // checkCounted, and TypeScript's own condition on the certificate, an input from outside: every witness a name (Lean's
2000
+ // is a variable; a number 5 would pass `reads` yet be read as the variable "5") and every coefficient a safe integer
2001
+ // (Lean's are Int).
2002
+ const typed = (is) => is.every(i => typeof i.wit === 'string' && Number.isSafeInteger(i.unit) && i.terms.every(([z]) => Number.isSafeInteger(z)));
2003
+ export function checkCounted(g, cert) {
2004
+ if (!(countedOk(g.hyps, g.counts, cert.insts) && typed(cert.insts)))
2005
+ return false;
2006
+ const goal = countedGoal(g, cert.insts);
2007
+ return goal !== undefined && check(goal, cert.tree);
2008
+ }
2009
+ // The goal a certificate's tree refutes: the goal's hypotheses, then the instances' (also what the search and the
2010
+ // exporter read), or none.
2011
+ export function countedGoal(g, insts) {
2012
+ const hs = countHyps(g.counts, insts);
2013
+ return hs && { name: g.name, hyps: [...g.hyps, ...hs] };
2014
+ }
2015
+ // SGhostedM.full: the original with each ghost's start and step after its own (Lean: lists appended; here records, whose
2016
+ // names smghostOk keeps apart from the original's).
2017
+ export function ghostedMachine(g) {
2018
+ const o = g.orig, gv = Object.entries(g.vars), gm = Object.entries(g.maps);
2019
+ return { ...o,
2020
+ state: { ...o.state, ...Object.fromEntries(gv.map(([name, x]) => [name, x.start])) },
2021
+ maps: { ...o.maps, ...Object.fromEntries(gm.map(([name, x]) => [name, x.start])) },
2022
+ step: { ...o.step,
2023
+ state: { ...o.step.state, ...Object.fromEntries(gv.map(([name, x]) => [name, x.step])) },
2024
+ maps: { ...o.step.maps, ...Object.fromEntries(gm.map(([name, x]) => [name, x.write])) } } };
2025
+ }
2026
+ // smghostOk: the original takes no history and no sums (Lean's SGhostedM is over SMachine); the ghost variables are none of
2027
+ // its variables (extVars: inputs, quantified flags and their witnesses; the state; the plain flags; the keys its writes
2028
+ // and quantified flags bind); the ghost maps none of its maps (origMaps: started, written, carried); and none of its
2029
+ // parts reads a ghost (pre, assume, flags, the start, the step, the writes, the facts; a flag f reads Lean's ?f). Lean's
2030
+ // distinct ghosts and ghost writes of ghost maps only hold here by construction (record keys; a ghost map's write is its
2031
+ // own).
2032
+ export function ghostedOk(g) {
2033
+ const o = g.orig, vs = Object.keys(g.vars), ms = Object.keys(g.maps);
2034
+ const fl = Object.entries(o.step.flags ?? {}), ws = Object.values(o.step.maps ?? {});
2035
+ const quant = fl.filter((e) => e[1].op === 'all');
2036
+ const varNames = [...o.inputs, ...quant.flatMap(([f, q]) => [`?${f}`, ...witnessesOf(f, q)]), ...Object.keys(o.state), ...Object.keys(o.step.state ?? {}),
2037
+ ...fl.map(([f]) => `?${f}`), ...ws.flatMap(w => ('each' in w ? [w.each] : [])), ...quant.flatMap(([, q]) => boundOf(q))];
2038
+ const mapNames = [...Object.keys(o.maps ?? {}), ...Object.keys(o.step.maps ?? {}), ...(o.inputMaps ?? [])];
2039
+ const parts = [o.pre ?? trueC, o.assume ?? trueC, ...fl.map(([, c]) => c), ...Object.values(o.state), ...Object.values(o.step.state ?? {}),
2040
+ ...ws.flatMap(w => ('each' in w ? [w.value] : [w.key, w.value])), ...(o.facts ?? []).map(l => l.holds)];
2041
+ const apart = (t) => { const r = reads(t); return vs.every(v => !r.vars.has(v) && !(v.startsWith('?') && r.flags.has(v.slice(1)))) && ms.every(mp => !r.maps.has(mp)); };
2042
+ return !o.history && !o.sums && vs.every(v => !varNames.includes(v)) && ms.every(mp => !mapNames.includes(mp)) && parts.every(apart);
2043
+ }
2044
+ // The laws of a ghosted machine, checked: the ghosts as smghostOk says, and the laws of the ghosted machine as checkLaws
2045
+ // says (Lean: smghostOk and checkSMachine of SGhostedM.full).
2046
+ export const checkGhostedLaws = (g, laws, proof) => ghostedOk(g) && checkLaws(ghostedMachine(g), laws, proof);
@@ -1,6 +1,7 @@
1
1
  import { type C, type E, type Law, type Machine } from '../core/machine.js';
2
2
  import { type Lin } from '../core/solver.js';
3
3
  import type { Cyclic } from './cyclic.js';
4
+ import { type Diagram, type Patterns } from './epr.js';
4
5
  import { type Goal, type Instances, type Liveness, type Loop, type Path, type StepLaw, type Tree, leafConstraintsReusing } from './kernel.js';
5
6
  export declare const pairedKeys: {
6
7
  skip: boolean;
@@ -44,6 +45,7 @@ export type Outcome = {
44
45
  } | {
45
46
  stuck: 'sat' | 'unknown';
46
47
  witness?: Record<string, number>;
48
+ diagram?: Diagram;
47
49
  path: Path;
48
50
  why?: string;
49
51
  };
@@ -51,6 +53,9 @@ export declare const clock: () => number;
51
53
  export declare function counted<T>(perMs: number, f: () => T, full?: boolean): T;
52
54
  export declare const fullRate = 250;
53
55
  export declare const fullWork: () => number;
56
+ export declare const withWork: <T>(cap: number, f: () => T) => T;
57
+ export declare const pastWall: () => boolean;
58
+ export declare function withWall<T>(end: number, f: () => T): T;
54
59
  export declare const late: (until: number) => boolean;
55
60
  export declare const withinDeadline: (until: number) => number;
56
61
  export declare function withDeadline<T>(until: number, f: () => T): T;
@@ -72,6 +77,10 @@ export declare const queryHook: {
72
77
  depth: number;
73
78
  };
74
79
  export declare function logged(kind: string, goal: Goal, f: () => Outcome): Outcome;
80
+ export declare const eprScope: {
81
+ patterns?: Patterns;
82
+ busy?: boolean;
83
+ };
75
84
  export declare const realModels: {
76
85
  on: boolean;
77
86
  };
@@ -93,6 +102,7 @@ export declare function withModels<T>(m: Machine, laws: Law[], inst: Instances,
93
102
  result: T;
94
103
  inst: Instances;
95
104
  };
105
+ export declare const relatedMost = 512, relatedBudget = 8192;
96
106
  export declare const minimal: {
97
107
  on: boolean;
98
108
  };
@@ -130,6 +140,39 @@ export declare function proveLaws(m: Machine, laws: Law[]): Report & {
130
140
  export declare const atPoint: {
131
141
  on: boolean;
132
142
  };
143
+ type Decided = {
144
+ proven: true;
145
+ uses: string[];
146
+ } | {
147
+ proven: false;
148
+ goal: string;
149
+ stuck: 'sat';
150
+ witness: Record<string, number>;
151
+ diagram?: Diagram;
152
+ } | undefined;
153
+ export declare const decideLawHook: {
154
+ on?: (m: Machine, laws: Law[], i: number, out: Decided, ms: number) => void;
155
+ };
156
+ export declare function decideLaw(m: Machine, laws: Law[], i: number, rounds?: number): Decided;
157
+ export declare const decideNote: {
158
+ refuted: boolean;
159
+ };
160
+ export declare const memoHits: {
161
+ n: number;
162
+ miss: number;
163
+ setKey: string;
164
+ setJson: string;
165
+ };
166
+ export declare const machineKey: (m: Machine) => string;
167
+ export declare function proveSetFast(m: Machine, laws: Law[]): Report & {
168
+ proof?: {
169
+ instances: Record<string, Instances>;
170
+ trees: Record<string, Tree>;
171
+ };
172
+ failed?: Report['failed'] & {
173
+ diagram?: Diagram;
174
+ };
175
+ };
133
176
  export declare function proveLaw(m: Machine, laws: Law[], i: number): {
134
177
  proven: true;
135
178
  } | {
@@ -137,7 +180,9 @@ export declare function proveLaw(m: Machine, laws: Law[], i: number): {
137
180
  goal: string;
138
181
  stuck: string;
139
182
  witness?: Record<string, number>;
183
+ diagram?: Diagram;
140
184
  };
185
+ export declare const withStrict: <T>(f: () => T) => T;
141
186
  export declare function lawInstances(m: Machine, laws: Law[], i: number): Instances;
142
187
  export declare const usualCheck: {
143
188
  on: boolean;