gdp-wired 0.24.0 → 0.26.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 (52) hide show
  1. package/README.md +14 -9
  2. package/dist/core/accel.d.ts +44 -0
  3. package/dist/core/accel.js +955 -0
  4. package/dist/core/bmc.d.ts +8 -0
  5. package/dist/core/bmc.js +263 -97
  6. package/dist/core/cycles.d.ts +2 -3
  7. package/dist/core/cycles.js +409 -174
  8. package/dist/core/cyclic.d.ts +4 -1
  9. package/dist/core/cyclic.js +86 -64
  10. package/dist/core/data.d.ts +9 -1
  11. package/dist/core/data.js +872 -168
  12. package/dist/core/discover.js +2 -3
  13. package/dist/core/dsl.d.ts +3 -2
  14. package/dist/core/dsl.js +21 -18
  15. package/dist/core/exists.js +7 -14
  16. package/dist/core/extract-check.d.ts +3 -2
  17. package/dist/core/extract-check.js +137 -50
  18. package/dist/core/extract-print.d.ts +1 -0
  19. package/dist/core/extract-print.js +26 -3
  20. package/dist/core/extract-read.d.ts +85 -4
  21. package/dist/core/extract-read.js +295 -34
  22. package/dist/core/extract-shapes.d.ts +14 -0
  23. package/dist/core/extract-shapes.js +608 -78
  24. package/dist/core/extract-xstate.d.ts +5 -1
  25. package/dist/core/extract-xstate.js +618 -184
  26. package/dist/core/extract.js +73 -27
  27. package/dist/core/infer.d.ts +1 -0
  28. package/dist/core/infer.js +364 -40
  29. package/dist/core/machine.d.ts +6 -0
  30. package/dist/core/machine.js +35 -3
  31. package/dist/core/nonterm.d.ts +9 -2
  32. package/dist/core/nonterm.js +173 -9
  33. package/dist/core/q.d.ts +1 -0
  34. package/dist/core/q.js +2 -2
  35. package/dist/core/relation.d.ts +1 -0
  36. package/dist/core/relation.js +95 -39
  37. package/dist/core/solver.d.ts +12 -0
  38. package/dist/core/solver.js +76 -30
  39. package/dist/core/transfer.js +23 -14
  40. package/dist/core/translate.d.ts +1 -1
  41. package/dist/core/translate.js +22 -49
  42. package/dist/core/xstate.d.ts +6 -1
  43. package/dist/core/xstate.js +336 -55
  44. package/dist/kernel/cdcl.d.ts +5 -0
  45. package/dist/kernel/cdcl.js +44 -8
  46. package/dist/kernel/prove.d.ts +6 -1
  47. package/dist/kernel/prove.js +101 -85
  48. package/dist/kernel/reader.d.ts +1 -0
  49. package/dist/kernel/reader.js +4 -3
  50. package/dist/kernel/simplex.d.ts +1 -1
  51. package/dist/kernel/simplex.js +13 -1
  52. package/package.json +3 -2
@@ -11,9 +11,9 @@
11
11
  // out.verdict // the laws, proven of out.rule: r with its functions and lists made again with the lemmas
12
12
  // out.found // per function or list, the lemmas found, as source to paste into recur(...) or carriesList(...)
13
13
  import { quietly } from "./cyclic.js";
14
- import { any, atMost, compileFunction, evalC, evalE, n, plus, prod, same, times, x } from "./machine.js";
14
+ import { any, atMost, compileFunction, evalC, evalE, n, plus, prod, same, seeded, times, x } from "./machine.js";
15
15
  import { Unproven, lit, proveFold, proveSteps, recur, recurOf } from "./dsl.js";
16
- const seeded = (seed) => { let s = seed; return (k) => { s = (s * 1103515245 + 12345) % 2 ** 31; return Math.floor(s / 2 ** 31 * k); }; };
16
+ import { gcd } from "./solver.js";
17
17
  const valueOf = (t) => (typeof t === 'number' ? t : t.val);
18
18
  const evalLin = (l, at) => Object.entries(l).reduce((s, [a, c]) => s + c * (a === '1' ? 1 : at[a]), 0);
19
19
  const holds = (c, at) => { const v = evalLin(c.lin, at); return c.rel === '=' ? v === 0 : v <= 0; };
@@ -117,7 +117,6 @@ function closedForm(samples, show) {
117
117
  // The law a goal is of (the kernel names each goal after its law: '<law> @step').
118
118
  const lawOfGoal = (goal) => goal.replace(/ @(start|step|step law|\d+ steps|leaf|node)$/, '');
119
119
  const isGoalOf = (goal) => (c) => { const law = lawOfGoal(goal); return law === c.name || law === `${c.name} at y`; };
120
- const gcd = (a, b) => (b === 0 ? Math.abs(a) : gcd(b, a % b));
121
120
  // --- recurrences ---------------------------------------------------------------------------------------------------
122
121
  const showRecur = (a) => (a === 'f' ? 'f(x)' : a === 'g' ? 'f(y)' : a === 'xx' ? 'x·x' : a === 'xxx' ? 'x·x·x' : a);
123
122
  const srcRecur = (a) => (a === 'xx' ? 'x.mul(x)' : a === 'xxx' ? 'x.mul(x).mul(x)' : a);
@@ -1,5 +1,6 @@
1
- import { type C, type E, type Law, type Recurrence, type Machine, type Request, type State } from './machine.js';
1
+ import { type C, type E, type Law, type Recurrence, type Machine, type Rand, type Request, type State } from './machine.js';
2
2
  import { type Fold, type Goal, type Liveness, type Loop, type Recur, type StepLaw, type Tree } from '../kernel/kernel.js';
3
+ import { type Report } from '../kernel/prove.js';
3
4
  export type TermLike = Term | number;
4
5
  export declare const termOf: (t: TermLike) => E;
5
6
  export declare class Term {
@@ -54,7 +55,6 @@ export declare const choose: (c: Cond, then: Cond, otherwise: Cond) => Cond;
54
55
  export declare function same(a: unknown, b: unknown): Cond;
55
56
  export declare const count: (c: Cond) => Term;
56
57
  export declare const sum: (first: TermLike, ...rest: TermLike[]) => Term;
57
- type Rand = (k: number) => number;
58
58
  export type Raw = number | boolean | string | null | undefined | RawObject | readonly Raw[];
59
59
  export type RawObject = {
60
60
  readonly [field: string]: Raw;
@@ -853,6 +853,7 @@ export declare class Unproven extends Error {
853
853
  readonly verdict: Verdict;
854
854
  constructor(what: string, verdict: Verdict);
855
855
  }
856
+ export declare const verdictOf: (out: Report) => Verdict;
856
857
  export declare function proveRule(r: Rule<Obj, Obj, Obj, Obj, Obj, Obj, Obj, Obj>, laws: Law[], opts?: ProveOptions): Verdict;
857
858
  export declare function proveSteps(r: Rule<Obj, Obj, Obj, Obj, Obj, Obj, Obj, Obj>, laws: Law[], stepLaws: StepLaw[], opts?: ProveOptions): Verdict;
858
859
  export type { StepLaw };
package/dist/core/dsl.js CHANGED
@@ -15,7 +15,7 @@
15
15
  //
16
16
  // A step returns its updates as one object: every right-hand side reads the state before the step, as the kernel and
17
17
  // both runtimes do.
18
- import { carriedView, compileFunction, divName, divisor, divisorsIn, evalC, evalE, interpret, isArithmetic, loadJs, modName, numbersOf, pairedArgs, withArithmetic } from "./machine.js";
18
+ import { argsKey, carriedView, compileFunction, divName, divisor, divisorsIn, evalC, evalE, interpret, isArithmetic, loadJs, modName, numbersOf, pairedArgs, seeded, withArithmetic } from "./machine.js";
19
19
  import { allowed, keysOf, requestEnv, watch } from "./watch.js";
20
20
  import { someHolds, substVars } from "./exists.js";
21
21
  import { check, checkRecur, foldObligations, loopObligations } from "../kernel/kernel.js";
@@ -1588,8 +1588,6 @@ const flatFns = (defs) => defs.flatMap(([n, d]) => {
1588
1588
  const uses = Object.entries(d.uses ?? {}).map(([u, ud]) => [`${n}.${u}`, ud]);
1589
1589
  return [...flatFns(uses), [n, d, Object.fromEntries(uses.map(([un, ud]) => [un.slice(n.length + 1), fnTerm(un, ud)]))]];
1590
1590
  });
1591
- const pairE = (a, b) => { const s = { op: 'add', a, b }; return { op: 'add', a: { op: 'prod', a: s, b: s }, b }; };
1592
- const argsKey = (args) => args.slice(1).reduce(pairE, args[0]);
1593
1591
  // A function's JavaScript as one function of its key: its arguments unpaired (left-nested, as argsKey pairs them).
1594
1592
  const jsOf = (d) => (typeof d.js === 'string' ? d.js : String(d.js));
1595
1593
  const fnSource = (name, d) => {
@@ -2653,14 +2651,18 @@ const withKinds = (r, laws) => [...r.kindLaws().filter(k => !laws.some(l => l.na
2653
2651
  // knows it only by its facts, which may also bound the params (a recurrence's induction machines take f(x) as a param
2654
2652
  // fx), so params are drawn only where every fact holds: a fact about the params alone exactly, one about every key at
2655
2653
  // each key (or tuple of keys) up to twice the bound. A rule whose function breaks its own facts there gets no run.
2656
- const refuteBudget = { trials: 60, depth: 6, bound: 3, ms: 150 };
2654
+ // The budget is counted, in the runs and requests tried (as core/infer.ts counts its runs), never timed, so a run within
2655
+ // it is found on any machine. (A stop at 150 ms of wall time left a false law to the kernel whenever the first run alone
2656
+ // took that long, a pause on a loaded container: core/pairs.test.ts's two groups, whose 944-hypothesis step goal then ran
2657
+ // out its 944 s, in 7 of 130 runs of the suite's pairs job on Modal.)
2658
+ const refuteBudget = { trials: 60, depth: 6, bound: 3 };
2657
2659
  // A request as a run's trace shows it: each map it carries as an object of its cells.
2658
2660
  const shownRequest = (input) => Object.fromEntries(Object.entries(input).map(([n, x]) => [n, typeof x === 'number' ? x : Object.fromEntries(x)]));
2659
2661
  // The search's own runs, before it looks for what the laws need: deeper and wider, from another seed.
2660
- const deeperBudget = { trials: 600, depth: 24, bound: 8, ms: 1500, seed: 29 };
2662
+ const deeperBudget = { trials: 600, depth: 24, bound: 8, seed: 29 };
2661
2663
  function refuteByRuns(r, laws, stepLaws = [], budget = refuteBudget) {
2662
2664
  const m = r.machine;
2663
- const run = interpret(m), rand = seeded(budget.seed ?? 13), until = performance.now() + budget.ms, bound = budget.bound, shown = shownRequest;
2665
+ const run = interpret(m), rand = seeded(budget.seed ?? 13), bound = budget.bound, shown = shownRequest;
2664
2666
  // (Division by a constant is a function too, its facts Euclid's, which its JavaScript meets: not checked.)
2665
2667
  const facts = (m.facts ?? []).filter(f => !isArithmetic(f.name.slice(0, f.name.indexOf(':'))));
2666
2668
  const holds = (f, params) => {
@@ -2680,7 +2682,7 @@ function refuteByRuns(r, laws, stepLaws = [], budget = refuteBudget) {
2680
2682
  const factsHold = (params) => (alone ??= facts.filter(f => !readsParams(f)).every(f => holds(f, params)))
2681
2683
  && facts.filter(readsParams).every(f => holds(f, params));
2682
2684
  try {
2683
- for (let trial = 0; trial < budget.trials && performance.now() < until; trial++) {
2685
+ for (let trial = 0; trial < budget.trials; trial++) {
2684
2686
  const params = r.randomParams(rand, bound);
2685
2687
  if (m.pre && !evalC(m.pre, params, { scalars: {}, maps: {} }, m) || !factsHold(params))
2686
2688
  continue;
@@ -2712,7 +2714,7 @@ function refuteByRuns(r, laws, stepLaws = [], budget = refuteBudget) {
2712
2714
  // variable of a kind is drawn as its kind draws (33 yes/nos drawn from 0..7 almost never make a lawful state).
2713
2715
  const steps1 = stepLaws.filter(sl => (sl.steps ?? 1) === 1), given = withKinds(r, laws);
2714
2716
  const wide = Object.keys(m.state).length + m.inputs.length >= 32, lawsHere = wide ? given : [], kinded = wide ? r.kindsOfState() : [];
2715
- for (let trial = 0; !m.history && (steps1.length || lawsHere.length) && trial < budget.trials * 4 && performance.now() < until; trial++) {
2717
+ for (let trial = 0; !m.history && (steps1.length || lawsHere.length) && trial < budget.trials * 4; trial++) {
2716
2718
  const params = r.randomParams(rand, bound);
2717
2719
  if (m.pre && !evalC(m.pre, params, { scalars: {}, maps: {} }, m) || !factsHold(params))
2718
2720
  continue;
@@ -2739,6 +2741,8 @@ function refuteByRuns(r, laws, stepLaws = [], budget = refuteBudget) {
2739
2741
  }
2740
2742
  return undefined;
2741
2743
  }
2744
+ // The kernel's report as a verdict: its first goal left unproven, with its counterexample and why.
2745
+ export const verdictOf = (out) => ({ proven: out.proven, checked: out.checked, ...(out.failed ? { goal: out.failed.goal, stuck: out.failed.stuck, ...(out.failed.witness ? { witness: out.failed.witness } : {}), ...(out.failed.why ? { why: out.failed.why } : {}) } : {}) });
2742
2746
  const refutedVerdict = (out) => ({ proven: false, checked: false, goal: out.goal, stuck: 'sat', witness: out.witness, ...(out.run ? { run: out.run } : {}) });
2743
2747
  // The divisors some laws read (modBy, divBy), noted on the rule so its machine declares them: a law may come from
2744
2748
  // another instance of the same rule (a factory called twice).
@@ -2753,7 +2757,7 @@ export function proveRule(r, laws, opts = {}) {
2753
2757
  if (refuted)
2754
2758
  return refuted.run ? refutedVerdict(refuted) : searched(r, laws, [], refutedVerdict(refuted), opts);
2755
2759
  const out = proveLaws(r.machine, withKinds(r, laws));
2756
- const v = { proven: out.proven, checked: out.checked, ...(out.failed ? { goal: out.failed.goal, stuck: out.failed.stuck, ...(out.failed.witness ? { witness: out.failed.witness } : {}), ...(out.failed.why ? { why: out.failed.why } : {}) } : {}), ...(out.witnesses && out.proven ? { witnesses: out.witnesses } : {}) };
2760
+ const v = { ...verdictOf(out), ...(out.witnesses && out.proven ? { witnesses: out.witnesses } : {}) };
2757
2761
  return searched(r, laws, [], v, opts);
2758
2762
  }
2759
2763
  export function proveSteps(r, laws, stepLaws, opts = {}) {
@@ -2762,7 +2766,7 @@ export function proveSteps(r, laws, stepLaws, opts = {}) {
2762
2766
  if (refuted)
2763
2767
  return refutedVerdict(refuted);
2764
2768
  const out = proveStepLaws(r.machine, withKinds(r, laws), stepLaws);
2765
- const v = { proven: out.proven, checked: out.checked, ...(out.failed ? { goal: out.failed.goal, stuck: out.failed.stuck, ...(out.failed.witness ? { witness: out.failed.witness } : {}), ...(out.failed.why ? { why: out.failed.why } : {}) } : {}) };
2769
+ const v = verdictOf(out);
2766
2770
  return searched(r, laws, stepLaws, v, opts);
2767
2771
  }
2768
2772
  // The search, where the prover alone didn't prove the laws and nothing refuted them: the lemmas first where the rule has
@@ -2774,12 +2778,12 @@ function searched(r, laws, stepLaws, v, opts) {
2774
2778
  const deeper = refuteByRuns(r, laws, stepLaws, deeperBudget);
2775
2779
  if (deeper?.run)
2776
2780
  return refutedVerdict(deeper);
2777
- const until = performance.now() + (typeof opts.search === 'object' && opts.search.ms !== undefined ? opts.search.ms : 10_000);
2781
+ const until = clock() + (typeof opts.search === 'object' && opts.search.ms !== undefined ? opts.search.ms : 10_000);
2778
2782
  // Bounded runs (core/bmc.ts): a law broken k steps from the start, a model of the kernel's k-step goal, the run taken
2779
2783
  // by the interpreter. The shallow depths first, within a fortieth of the search's budget (at most 250 ms, counted and
2780
2784
  // in wall time); the deeper ones only where the invariant search finds nothing, within the tenth (at most a second)
2781
2785
  // kept from it, so a law the search proves costs no more than the shallow depths.
2782
- const total = until - performance.now(), tail = Math.min(1000, total / 10);
2786
+ const total = until - clock(), tail = Math.min(1000, total / 10);
2783
2787
  let reached = 0;
2784
2788
  const bounded = (ms, from) => findBoundedRun(r.machine, laws, { ms, wall: performance.now() + ms, from, progress: k => { reached = k; } });
2785
2789
  const refutedBy = (b) => refutedVerdict({ goal: `${b.law} @step (a run of ${b.depth} steps from the start)`, witness: b.witness, run: { params: b.params, trace: b.trace.map(shownRequest) } });
@@ -2805,17 +2809,17 @@ function searched(r, laws, stepLaws, v, opts) {
2805
2809
  }
2806
2810
  // Functions known by their facts alone (not a recurrence): lemmas about them, fitted to their values and proven from
2807
2811
  // the facts as cyclic claims, the laws proven with them as facts.
2808
- if ((typeof opts.search !== 'object' || opts.search.cycles !== false) && fns.some(([, d]) => !recurOf(d)) && rule.machine.facts?.length && until - performance.now() > 500) {
2809
- const c = withDeadline(until, () => cycleLemmas(rule.machine, withKinds(rule, laws), stepLaws, { ms: (until - performance.now()) / 2 }));
2812
+ if ((typeof opts.search !== 'object' || opts.search.cycles !== false) && fns.some(([, d]) => !recurOf(d)) && rule.machine.facts?.length && until - clock() > 500) {
2813
+ const c = withDeadline(until, () => cycleLemmas(rule.machine, withKinds(rule, laws), stepLaws, { ms: (until - clock()) / 2 }));
2810
2814
  if (c.proven && c.checked)
2811
2815
  return { proven: true, checked: true, found: { ...(lemmas ? { lemmas } : {}), facts: c.found.map(f => f.text) } };
2812
2816
  }
2813
- const ms = until - performance.now() - tail;
2817
+ const ms = until - clock() - tail;
2814
2818
  if (ms < 500)
2815
2819
  return v;
2816
2820
  const inf = inferLaws(rule, laws, stepLaws, { ms, ...(rule === r ? { first: v } : {}) });
2817
2821
  if (!(inf.proven && inf.checked)) {
2818
- const deep = bounded(Math.max(0, until - performance.now()), Math.max(1, reached));
2822
+ const deep = bounded(Math.max(0, until - clock()), Math.max(1, reached));
2819
2823
  if (deep)
2820
2824
  return refutedBy(deep);
2821
2825
  return { ...v, why: [v.why, `the search found nothing that proves it in ${Math.round(inf.stats.ms)} ms`].filter(Boolean).join('; ') };
@@ -2834,7 +2838,7 @@ export function proveLeadsTo(r, laws, l, opts = {}) {
2834
2838
  ...(f.found ? { found: { rank: f.found.rank, ...(f.laws?.length ? { laws: f.laws.map((law, i) => ({ law, text: f.found.laws[i] ?? law.name })) } : {}) } } : {}) };
2835
2839
  }
2836
2840
  const out = proveLiveness(r.machine, withKinds(r, laws), l);
2837
- return { proven: out.proven, checked: out.checked, ...(out.failed ? { goal: out.failed.goal, stuck: out.failed.stuck, ...(out.failed.witness ? { witness: out.failed.witness } : {}), ...(out.failed.why ? { why: out.failed.why } : {}) } : {}) };
2841
+ return verdictOf(out);
2838
2842
  }
2839
2843
  // `ms`: the budget (the prover's own per goal, 20 s or a second a hypothesis, where none is given), on the clock the
2840
2844
  // prover reads (the counted one inside a counted search): past it the verdict is unknown.
@@ -2842,7 +2846,6 @@ export const proveDecision = (d, opts = {}) => {
2842
2846
  const go = () => (d.steps ? proveSteps(d.steps.rule, [], [d.steps.law], { search: false }) : goalsVerdict([d.goal]));
2843
2847
  return opts.ms === undefined ? go() : withDeadline(clock() + opts.ms, go);
2844
2848
  };
2845
- const seeded = (seed) => { let x = seed; return k => { x = (x * 1103515245 + 12345) % 2 ** 31; return Math.floor(x / 2 ** 31 * k); }; };
2846
2849
  // A decision's callbacks against its condition, on random params and requests: `given` and `then` each run with every
2847
2850
  // value known, against what the interpreter evaluates of the decision built from them.
2848
2851
  export function crossCheckDecision(d, opts = {}) {
@@ -14,10 +14,9 @@
14
14
  // value before, shifts of it, the request's values and the state before; each is chosen to satisfy P at every
15
15
  // counterexample so far, per case of the step (the conditions its updates split on: the request's clause, say).
16
16
  // A law under a `forall` key takes witness terms only (a ghost per key would be a map).
17
- import { evalC, evalE } from "./machine.js";
18
- import { proveLaw, proveLaws, withinDeadline } from "../kernel/prove.js";
19
- const k = (value) => ({ op: 'const', value });
20
- const v = (name) => ({ op: 'var', name });
17
+ import { evalC, evalE, n as k, walk, x as v } from "./machine.js";
18
+ import { clock, proveLaw, proveLaws, withinDeadline } from "../kernel/prove.js";
19
+ import { env } from "./solver.js";
21
20
  const add = (a, b) => (a.op === 'const' && a.value === 0 ? b : b.op === 'const' && b.value === 0 ? a : { op: 'add', a, b });
22
21
  const sum = (es) => es.reduce((acc, e) => add(acc, e), k(0));
23
22
  const sub = (a, b) => (b.op === 'const' && b.value === 0 ? a : { op: 'sub', a, b });
@@ -286,18 +285,12 @@ const caseAt = (cases, env, st, m) => {
286
285
  };
287
286
  function constantsOf(m) {
288
287
  const out = new Set([1, 2]);
289
- const walk = (t) => {
290
- if (!t || typeof t !== 'object')
291
- return;
292
- const o = t;
288
+ walk(m.step, o => {
293
289
  if (o.op === 'const' && typeof o.value === 'number' && o.value > 0 && o.value <= 64)
294
290
  out.add(o.value);
295
291
  if (o.op === 'mul' && typeof o.k === 'number' && o.k > 1 && o.k <= 64)
296
292
  out.add(o.k);
297
- for (const x of Object.values(o))
298
- (Array.isArray(x) ? x : [x]).forEach(walk);
299
- };
300
- walk(m.step);
293
+ });
301
294
  return [...out].sort((a, b) => a - b).slice(0, 6);
302
295
  }
303
296
  const dedupe = (cs) => [...new Map(cs.map(c => [key(c), c])).values()];
@@ -470,7 +463,7 @@ export function proveSome(m, laws, opts = {}) {
470
463
  return { machine: b.machine, laws: out, ghosts: b.ghosts };
471
464
  };
472
465
  const rounds = opts.rounds ?? 24;
473
- const log = globalThis.process?.env?.GDP_EXISTS_LOG === '1';
466
+ const log = env.GDP_EXISTS_LOG === '1';
474
467
  // Each law's witness until its goals are proven with every law assumed (choose); then the whole set, and where a
475
468
  // later choice broke a law proven before (a witness term is a hypothesis of every law), that law's again.
476
469
  const choose = (i, p, pass, first) => {
@@ -484,7 +477,7 @@ export function proveSome(m, laws, opts = {}) {
484
477
  // A witness given: the kernel proves the law with it, or refuses it here, with its counterexample.
485
478
  if (p.given)
486
479
  return { proven: false, nodes: 0, leaves: 0, checked: false, failed: { goal: r.goal, stuck: r.stuck, ...(r.witness ? { witness: r.witness } : {}), why: `the witness given for "${p.law.name}" does not prove it` } };
487
- if (withinDeadline(Infinity) <= performance.now())
480
+ if (withinDeadline(Infinity) <= clock())
488
481
  return fail(`the deadline passed choosing a witness for "${p.law.name}" (${r.stuck})`);
489
482
  if (round >= rounds)
490
483
  return fail(`no witness found for "${p.law.name}" in ${rounds} rounds (${r.stuck}): name one (exists(kind, f, witness))`);
@@ -33,7 +33,7 @@ export type Evidence = {
33
33
  ms: number;
34
34
  mismatch?: string;
35
35
  };
36
- export declare function instrument(code: string, file: string, tail?: string): {
36
+ export declare function instrument(code: string, file: string, tail?: string, extra?: [number, string][]): {
37
37
  js: string;
38
38
  arms: Arm[];
39
39
  };
@@ -50,13 +50,14 @@ export type Sandbox = {
50
50
  setNow: (n: number) => void;
51
51
  get: (name: string) => unknown;
52
52
  };
53
- export declare function sandbox(code: string, file: string, expose: string[], modules?: Record<string, unknown>, init?: string, files?: Record<string, string>): Sandbox & {
53
+ export declare function sandbox(code: string, file: string, expose: string[], modules?: Record<string, unknown>, init?: string, files?: Record<string, string>, extra?: [number, string][]): Sandbox & {
54
54
  arms: Arm[];
55
55
  };
56
56
  type Cells = Record<string, Record<string, Raw>>;
57
57
  export type Snap = {
58
58
  leaves: Record<string, Raw>;
59
59
  maps: Record<string, Cells>;
60
+ lists?: Record<string, Raw[]>;
60
61
  };
61
62
  export declare const kindOfVar: (v: Var, sorts: Sorts, at?: string) => Kind<unknown>;
62
63
  export type CheckOptions = {