gdp-wired 0.23.0 → 0.24.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 (40) hide show
  1. package/README.md +12 -2
  2. package/dist/core/bmc.d.ts +13 -2
  3. package/dist/core/bmc.js +390 -18
  4. package/dist/core/cycles.d.ts +23 -0
  5. package/dist/core/cycles.js +104 -54
  6. package/dist/core/data.d.ts +9 -0
  7. package/dist/core/data.js +352 -121
  8. package/dist/core/discover.js +8 -3
  9. package/dist/core/dsl.d.ts +7 -2
  10. package/dist/core/dsl.js +47 -9
  11. package/dist/core/extract-check.d.ts +77 -0
  12. package/dist/core/extract-check.js +785 -0
  13. package/dist/core/extract-ir.d.ts +139 -0
  14. package/dist/core/extract-ir.js +198 -0
  15. package/dist/core/extract-print.d.ts +30 -0
  16. package/dist/core/extract-print.js +426 -0
  17. package/dist/core/extract-read.d.ts +298 -0
  18. package/dist/core/extract-read.js +1298 -0
  19. package/dist/core/extract-shapes.d.ts +13 -0
  20. package/dist/core/extract-shapes.js +993 -0
  21. package/dist/core/extract-xstate.d.ts +34 -0
  22. package/dist/core/extract-xstate.js +320 -0
  23. package/dist/core/extract.d.ts +31 -0
  24. package/dist/core/extract.js +249 -0
  25. package/dist/core/kind.d.ts +30 -0
  26. package/dist/core/kind.js +81 -0
  27. package/dist/core/relation.js +7 -4
  28. package/dist/core/xstate.d.ts +6 -0
  29. package/dist/core/xstate.js +70 -12
  30. package/dist/kernel/cdcl.d.ts +10 -0
  31. package/dist/kernel/cdcl.js +291 -241
  32. package/dist/kernel/kernel.d.ts +15 -0
  33. package/dist/kernel/kernel.js +32 -0
  34. package/dist/kernel/prove.js +14 -3
  35. package/dist/kernel/reader.d.ts +14 -0
  36. package/dist/kernel/reader.js +102 -14
  37. package/dist/lean-kernel/emit.d.ts +28 -1
  38. package/dist/lean-kernel/emit.js +56 -15
  39. package/dist/lean-kernel/library.js +2 -1
  40. package/package.json +12 -3
@@ -0,0 +1,30 @@
1
+ import type { Law, Machine } from './machine.js';
2
+ import { type Instances, type KInduction, type Tree } from '../kernel/kernel.js';
3
+ export type KindProof = {
4
+ laws: {
5
+ instances: Record<string, Instances>;
6
+ trees: Record<string, Tree>;
7
+ };
8
+ instances: Instances;
9
+ trees: Record<string, Tree>;
10
+ };
11
+ export type KindResult = {
12
+ proven: boolean;
13
+ checked: boolean;
14
+ k?: number;
15
+ kl?: KInduction;
16
+ proof?: KindProof;
17
+ laws?: Law[];
18
+ depths: [number, string, number][];
19
+ why?: string;
20
+ };
21
+ export type KindOptions = {
22
+ ms: number;
23
+ wall?: number;
24
+ from?: number;
25
+ to?: number;
26
+ rate?: number;
27
+ };
28
+ export declare const kindFits: (m: Machine, laws: Law[], law: Law) => boolean;
29
+ export declare const conjunction: (laws: Law[]) => Law;
30
+ export declare function proveKInduction(m: Machine, laws: Law[], law: Law, opts: KindOptions): KindResult;
@@ -0,0 +1,81 @@
1
+ import { checkKInduction, historyMachine, kInductionStart, kInductionSteps, stepLawObligations } from "../kernel/kernel.js";
2
+ import { clock, counted, grow, proveLaws } from "../kernel/prove.js";
3
+ import { REFUTED, growCdcl } from "../kernel/cdcl.js";
4
+ import { quietly } from "./cyclic.js";
5
+ // Machines whose k-step goals need no instances: no map a law or fact reads at keys, no flag that holds at every key.
6
+ export const kindFits = (m, laws, law) => {
7
+ const plain = m.history ? historyMachine(m).machine : m;
8
+ return !Object.values(plain.step.flags ?? {}).some(c => c.op === 'all') && !plain.inputMaps?.length && [...laws, law, ...(plain.facts ?? [])].every(l => !l.forall && !l.keys?.length && !l.some?.length);
9
+ };
10
+ // The laws as one: their conjunction, named by them.
11
+ export const conjunction = (laws) => (laws.length === 1 ? laws[0] : { name: laws.map(l => l.name).join(' and '), holds: { op: 'and', xs: laws.map(l => l.holds) } });
12
+ export function proveKInduction(m, laws, law, opts) {
13
+ const depths = [];
14
+ if (!kindFits(m, laws, law))
15
+ return { proven: false, checked: false, depths, why: 'a law or fact about every key, a flag at every key, or a carried map' };
16
+ return counted(opts.rate ?? 200, () => {
17
+ const until = clock() + opts.ms, over = () => clock() > until || (opts.wall !== undefined && performance.now() > opts.wall);
18
+ // A goal's tree: CDCL's, unfolded (prove.ts's grow keeps CDCL off a goal over k steps, for the size of the tree its
19
+ // cuts would make smaller; but here the plain search's cases multiply with every step), else the plain search's.
20
+ const treeOf = (g) => {
21
+ const c = growCdcl(g, new Map(), { nodes: 0, until }, opts.wall !== undefined ? { wall: opts.wall } : {});
22
+ if ('tree' in c || c.stuck === 'sat' || over())
23
+ return c;
24
+ return grow(g, new Map(), { nodes: 0, until });
25
+ };
26
+ const trees = {}, assumed = laws;
27
+ // The laws it assumes (their usual proof: no cyclic certificate is made for it here, checkKInduction reads the usual
28
+ // trees) and the start goal: once, after the first step goal refuted (a step goal is decided over them as
29
+ // hypotheses; only a certificate needs their proof).
30
+ let base;
31
+ const prepared = () => {
32
+ if (base)
33
+ return undefined;
34
+ base = quietly(() => proveLaws(m, laws));
35
+ if (!base.proven || !base.checked || !base.proof)
36
+ return 'the laws it assumes are not proven';
37
+ const start = kInductionStart(m, { law, k: 1 }, {}), s0 = treeOf(start);
38
+ if (!('tree' in s0))
39
+ return `${start.name}: ${s0.stuck}`;
40
+ trees[start.name] = s0.tree;
41
+ return undefined;
42
+ };
43
+ for (let k = Math.max(1, opts.from ?? 2); k <= Math.min(64, opts.to ?? 64) && !over(); k++) {
44
+ const t0 = clock(), kl = { law, k }, steps = kInductionSteps(m, kl), last = steps.at(-1);
45
+ const goal = stepLawObligations(m, assumed, {}, last)[0];
46
+ const decided = growCdcl(goal, new Map(), { nodes: 0, until }, { model: true, ...(opts.wall !== undefined ? { wall: opts.wall } : {}) });
47
+ if (!('tree' in decided) && decided.why !== REFUTED) {
48
+ depths.push([k, decided.stuck[0], Math.round(clock() - t0)]);
49
+ if (decided.stuck === 'sat')
50
+ continue;
51
+ return { proven: false, checked: false, depths, why: `${goal.name}: unknown` };
52
+ }
53
+ const why = prepared();
54
+ if (why) {
55
+ depths.push([k, 'r', Math.round(clock() - t0)]);
56
+ return { proven: false, checked: false, depths, why };
57
+ }
58
+ const st = treeOf(goal);
59
+ if (!('tree' in st)) {
60
+ depths.push([k, 't', Math.round(clock() - t0)]);
61
+ return { proven: false, checked: false, depths, why: `${goal.name}: refuted, but no tree within the budget` };
62
+ }
63
+ depths.push([k, 'r', Math.round(clock() - t0)]);
64
+ trees[goal.name] = st.tree;
65
+ // The base, from the start: each depth below k (grown once, whatever k).
66
+ for (const sl of steps.slice(0, -1)) {
67
+ const g = stepLawObligations(m, assumed, {}, sl)[0];
68
+ if (trees[g.name])
69
+ continue;
70
+ const b = treeOf(g);
71
+ if (!('tree' in b))
72
+ return { proven: false, checked: false, depths, why: `${g.name}: ${b.stuck === 'sat' ? 'a run from the start breaks it' : 'unknown'}` };
73
+ trees[g.name] = b.tree;
74
+ }
75
+ const proof = { laws: base.proof, instances: {}, trees };
76
+ const checked = checkKInduction(m, assumed, kl, proof);
77
+ return { proven: true, checked, k, kl, proof, laws: assumed, depths };
78
+ }
79
+ return { proven: false, checked: false, depths, why: 'no k within the budget' };
80
+ });
81
+ }
@@ -1,4 +1,5 @@
1
- import { solve } from "./solver.js";
1
+ import { clock } from "../kernel/prove.js";
2
+ import { solve, work } from "./solver.js";
2
3
  class Refused extends Error {
3
4
  }
4
5
  const id = (t) => JSON.stringify(t);
@@ -377,7 +378,9 @@ export function generators(rows, names, nats = [], cap = 600, until = Infinity)
377
378
  const pos = rays.filter((_, i) => val[i] > 0n), neg = rays.filter((_, i) => val[i] < 0n), zero = rays.filter((_, i) => val[i] === 0n);
378
379
  const next = [...zero.map(r => ({ v: r.v, zero: new Set([...r.zero, hi]) })), ...neg];
379
380
  const vp = new Map(pos.map(r => [r, dot(h, r.v)])), vn = new Map(neg.map(r => [r, dot(h, r.v)]));
380
- if (performance.now() > until)
381
+ // (counted as work: a counted search's clock runs while the generators are made)
382
+ work.n += 1 + ((rays.length + pos.length * neg.length) * (n + 1) >> 4);
383
+ if (clock() > until)
381
384
  return undefined;
382
385
  for (const p of pos)
383
386
  for (const q of neg) {
@@ -427,7 +430,7 @@ export function houdini(rel, cands, locOf, until) {
427
430
  for (let round = 0, changed = true; changed && round < 50; round++) {
428
431
  changed = false;
429
432
  for (const [i, p] of rel.paths.entries()) {
430
- if (performance.now() > until)
433
+ if (clock() > until)
431
434
  return undefined;
432
435
  const [a, b] = locOf(i);
433
436
  if (!H[b].length)
@@ -441,7 +444,7 @@ export function houdini(rel, cands, locOf, until) {
441
444
  const nat = rel.nats.filter(x => ns.includes(x)).map((x) => ({ [x]: -1 }));
442
445
  const through = (c) => { let o = {}; for (const [y, k] of Object.entries(c))
443
446
  o = plus(o, y !== '1' && p.post[y] ? times(p.post[y], k) : { [y]: k }); return o; };
444
- const keep = H[b].filter(c => performance.now() < until && solve([...rows, ...nat, plus(konst(1), through(c), -1)].map(lin => ({ lin, label: '' })), 4000).kind === 'refuted');
447
+ const keep = H[b].filter(c => clock() < until && solve([...rows, ...nat, plus(konst(1), through(c), -1)].map(lin => ({ lin, label: '' })), 4000).kind === 'refuted');
445
448
  if (keep.length < H[b].length) {
446
449
  H[b] = keep;
447
450
  changed = true;
@@ -8,9 +8,11 @@ type XAction = string | {
8
8
  type XTransition = string | {
9
9
  target?: string | string[];
10
10
  guard?: unknown;
11
+ cond?: unknown;
11
12
  actions?: XAction | XAction[];
12
13
  reenter?: boolean;
13
14
  description?: string;
15
+ [k: string]: unknown;
14
16
  };
15
17
  export type XNode = {
16
18
  id?: string;
@@ -41,6 +43,10 @@ export type Bridge = {
41
43
  guards?: Record<string, Guard>;
42
44
  actions?: Record<string, Action>;
43
45
  events?: string[];
46
+ inline?: {
47
+ guards?: ReadonlyMap<unknown, Guard>;
48
+ actions?: ReadonlyMap<unknown, Action>;
49
+ };
44
50
  };
45
51
  export type MachineLike = object;
46
52
  export declare function fromXState(machine: MachineLike, opts?: Bridge): Chart<Obj, Obj, Obj>;
@@ -18,22 +18,57 @@
18
18
  // root, eventless (`always`) and delayed (`after`) transitions, invoked actors and done events, wildcard events, several
19
19
  // targets at once, inline guards and actions, entry and exit actions that write the context, two regions writing the
20
20
  // context on one event (XState runs their actions one after another; a chart's regions write in one step), and a
21
- // shallow history over nested states.
21
+ // shallow history over nested states. So is every key it doesn't read, rather than dropped: a node or transition key
22
+ // outside the lists below (KEYS), an initial transition with actions, an event XState raises itself (done, error, init).
23
+ // An XState v4 machine reads the same, its `cond` the guard v5 calls `guard` (a name, or {type, ...params}); v4's
24
+ // `in`, `strict`, `activities` and eventless `''` are refused with the rest. Each XState ignores the other's guard key,
25
+ // so a v5 machine with `cond` or a v4 one with `guard` is refused (a plain config is read by the key it uses).
22
26
  import { Choice, bool, int } from "./dsl.js";
23
27
  import { chart } from "./chart.js";
28
+ // The keys read, and those that change nothing a run shows (descriptions, metadata, types, a final state's output, v4's
29
+ // action-order flags, which order no write to the context: those a transition makes run in order either way; v5's
30
+ // `reenter` and v4's `internal`, which change only which entry and exit actions run, and those write no context here).
31
+ // Any other is refused, by name, rather than dropped; some with the reason.
32
+ const KEYS = {
33
+ node: new Set(['id', 'type', 'history', 'initial', 'target', 'states', 'on', 'entry', 'exit', 'description', 'meta', 'tags', 'output', 'data']),
34
+ root: new Set(['context', 'version', 'types', 'schemas', 'schema', 'tsTypes', 'predictableActionArguments', 'preserveActionOrder']),
35
+ transition: new Set(['target', 'guard', 'cond', 'actions', 'reenter', 'internal', 'description', 'meta']),
36
+ };
37
+ const WHY = {
38
+ always: '`always` has no chart counterpart', after: '`after` has no chart counterpart', invoke: '`invoke` has no chart counterpart', onDone: '`onDone` has no chart counterpart',
39
+ onError: '`onError` has no chart counterpart', activities: "v4's `activities` have no chart counterpart", strict: "v4's `strict` (an event no state takes throws) has no chart counterpart",
40
+ delimiter: 'a state path delimiter other than "."', onEntry: "v4's `onEntry`: write it as `entry`", onExit: "v4's `onExit`: write it as `exit`",
41
+ in: "v4's `in` guard: write it as a named guard reading env.in(...)",
42
+ };
43
+ const keyCheck = (o, allowed, refuse, also) => {
44
+ for (const k of Object.keys(o))
45
+ if (!allowed.has(k) && !also?.has(k) && o[k] !== undefined)
46
+ refuse(WHY[k] ?? `\`${k}\`, a key fromXState doesn't read (it would be dropped)`);
47
+ };
48
+ // Events XState raises itself (a done state or actor, an error, the start): a chart's events are only those sent.
49
+ const raised = (e) => e === '' || /^(xstate\.|done\.(state|invoke)\.|error\.(platform|execution|communication))/.test(e);
24
50
  const list = (x) => (x === undefined ? [] : Array.isArray(x) ? x : [x]);
25
51
  const configOf = (machine) => ('config' in machine && machine.config && typeof machine.config === 'object' ? machine.config : machine);
52
+ // The XState a machine is of: v5's machines have getInitialSnapshot, v4's withConfig; a plain config says neither.
53
+ const versionOf = (machine) => {
54
+ const m = machine;
55
+ return typeof m.getInitialSnapshot === 'function' ? 5 : typeof m.withConfig === 'function' ? 4 : undefined;
56
+ };
26
57
  export function fromXState(machine, opts = {}) {
27
- const root = configOf(machine), name = root.id ?? 'machine', parallel = root.type === 'parallel';
58
+ const root = configOf(machine), name = root.id ?? 'machine', parallel = root.type === 'parallel', version = versionOf(machine);
28
59
  const refuse = (where, what) => { throw new Error(`${name}: ${where || 'the machine'}: ${what}`); };
29
60
  const infos = [], ids = new Map();
30
61
  const walk = (node, segs, parent) => {
31
62
  const info = { node, segs, parent }, where = segs.join('.');
32
63
  infos.push(info);
33
64
  ids.set(node.id ?? (segs.length ? `${name}.${where}` : name), info);
34
- for (const k of ['always', 'after', 'invoke', 'onDone'])
35
- if (node[k] !== undefined)
36
- refuse(where, `\`${k}\` has no chart counterpart`);
65
+ keyCheck(node, KEYS.node, what => refuse(where, what), segs.length ? undefined : KEYS.root);
66
+ if (node.type !== undefined && !['atomic', 'compound', 'parallel', 'final', 'history'].includes(node.type))
67
+ refuse(where, `the state type ${JSON.stringify(node.type)}`);
68
+ if (node.initial !== undefined && typeof node.initial !== 'string')
69
+ refuse(where, 'an initial transition given as an object (its actions have no chart counterpart): name the initial state');
70
+ if (node.type !== 'history' && (node.history !== undefined || node.target !== undefined))
71
+ refuse(where, '`history` or `target` on a state that is not a history node');
37
72
  if (node.type === 'parallel' && segs.length)
38
73
  refuse(where, 'a parallel state below the root (a chart runs regions only at the top)');
39
74
  for (const [k, kid] of Object.entries(node.states ?? {}))
@@ -75,16 +110,25 @@ export function fromXState(machine, opts = {}) {
75
110
  return at.node.type === 'history' ? { to: at.parent, viaHistory: true } : { to: at, viaHistory: false };
76
111
  };
77
112
  // Guards and actions, named and given again.
78
- const guardOf = (where, g) => {
113
+ // v5's guard: a name or {type, params}; v4's cond: a name or {type, ...params}, its params the object's other keys.
114
+ const guardOf = (where, g, v4 = false) => {
79
115
  if (g === undefined)
80
116
  return undefined;
81
- const [n, params] = typeof g === 'string' ? [g, undefined] : typeof g === 'object' && g && typeof g.type === 'string' ? [g.type, g.params] : [undefined, undefined];
117
+ const given = opts.inline?.guards?.get(g);
118
+ if (given)
119
+ return env => given(env);
120
+ const v4params = (o) => { const { type: _t, ...rest } = o; void _t; return Object.keys(rest).length ? rest : undefined; };
121
+ const [n, params] = typeof g === 'string' ? [g, undefined] : typeof g === 'object' && g && typeof g.type === 'string' ? [g.type, v4 ? v4params(g) : g.params] : [undefined, undefined];
82
122
  if (n === undefined)
83
123
  return refuse(where, `an inline guard${typeof g === 'function' && g.type ? ` (${g.type})` : ''}: name it in setup({guards}) and give its condition in guards`);
84
124
  const f = opts.guards?.[n] ?? refuse(where, `the guard ${n}: give its condition in guards`);
85
125
  return env => f(env, params);
86
126
  };
87
127
  const actionsOf = (where, as) => as.flatMap(a => {
128
+ if (opts.inline?.actions?.has(a)) {
129
+ const f = opts.inline.actions.get(a);
130
+ return f ? [(env) => f(env)] : [];
131
+ }
88
132
  const [n, params] = typeof a === 'string' ? [a, undefined] : typeof a === 'object' && a && typeof a.type === 'string' ? [a.type, a.params] : [undefined, undefined];
89
133
  if (n === undefined)
90
134
  return refuse(where, `an inline action${typeof a === 'function' && a.type ? ` (${a.type})` : ''}: name it in setup({actions}) and give the context it writes in actions`);
@@ -124,7 +168,7 @@ export function fromXState(machine, opts = {}) {
124
168
  c = c.regions(Object.fromEntries(top.map(r => [r.segs[0], nodeOf(r)])));
125
169
  }
126
170
  else
127
- c = c.states(nodeOf(infos[0]).states ?? refuse('', 'no states'), root.initial ? { initial: root.initial } : {});
171
+ c = c.states(nodeOf(infos[0]).states ?? { [STATELESS]: {} }, root.initial ? { initial: root.initial } : {});
128
172
  if (opts.events)
129
173
  c = c.events(...opts.events);
130
174
  // The transitions, in document order (the chart takes the most specific source first, then the first declared, as
@@ -132,20 +176,32 @@ export function fromXState(machine, opts = {}) {
132
176
  const writers = new Map();
133
177
  for (const i of infos)
134
178
  for (const [event, spec] of Object.entries(i.node.on ?? {})) {
135
- const where = `${pathOf(i) || 'the root'} on ${event}`;
179
+ const where = `${pathOf(i) || 'the root'} on ${event || '""'}`;
136
180
  if (event.includes('*'))
137
181
  refuse(where, 'a wildcard event');
182
+ if (raised(event))
183
+ refuse(where, event ? 'an event XState raises itself (a done, error or init event)' : "v4's eventless transition (`''`)");
138
184
  if (spec === undefined)
139
185
  refuse(where, 'a forbidden event (an undefined transition)');
140
186
  for (const t of list(spec)) {
187
+ if (t === null || (typeof t !== 'string' && typeof t !== 'object'))
188
+ refuse(where, `a transition given as ${typeof t === 'function' ? 'a function' : JSON.stringify(t)}`);
141
189
  const o = typeof t === 'string' ? { target: t } : t, targets = list(o.target);
190
+ keyCheck(o, KEYS.transition, what => refuse(where, what));
191
+ if (o.guard !== undefined && o.cond !== undefined)
192
+ refuse(where, 'both `guard` and v4\'s `cond`');
193
+ // (each XState reads its own and takes a transition with the other's unguarded: refused, not taken so)
194
+ if (o.cond !== undefined && version === 5)
195
+ refuse(where, 'v4\'s `cond` in an XState v5 machine, which doesn\'t read it (it takes this transition unguarded): name the guard in `guard`');
196
+ if (o.guard !== undefined && version === 4)
197
+ refuse(where, 'v5\'s `guard` in an XState v4 machine, which doesn\'t read it (it takes this transition unguarded): name the guard in `cond`');
142
198
  if (targets.length > 1)
143
199
  refuse(where, 'several targets at once');
144
200
  const to = targets[0] === undefined ? undefined : resolve(i, targets[0]);
145
- const set = composed(actionsOf(where, list(o.actions))), when = guardOf(where, o.guard);
201
+ const set = composed(actionsOf(where, list(o.actions))), when = o.cond !== undefined ? guardOf(where, o.cond, true) : guardOf(where, o.guard);
146
202
  // Where it applies: its state; for the root, every top state but a final one (XState stops there), or in a
147
203
  // parallel machine the region its target is in (the first region, for one with no target).
148
- const from = i.segs.length ? pathOf(i) : parallel ? (to ? to.to.segs[0] : top[0].segs[0]) : top.filter(x => x.node.type !== 'final' && x.node.type !== 'history').map(pathOf);
204
+ const from = i.segs.length ? pathOf(i) : parallel ? (to ? to.to.segs[0] : top[0].segs[0]) : top.length ? top.filter(x => x.node.type !== 'final' && x.node.type !== 'history').map(pathOf) : STATELESS;
149
205
  if (set) {
150
206
  const region = parallel ? String(list(from)[0]).split('.')[0] : 'state';
151
207
  writers.set(event, (writers.get(event) ?? new Set()).add(region));
@@ -158,6 +214,8 @@ export function fromXState(machine, opts = {}) {
158
214
  refuse(`on ${event}`, `regions ${[...regions].join(' and ')} both write the context (XState runs their actions one after another)`);
159
215
  return c;
160
216
  }
217
+ // A machine with no states (its root's transitions only): one state of the chart's, XState's value {} there.
218
+ const STATELESS = '(machine)';
161
219
  function contextOf(root, given, refuse) {
162
220
  const out = {};
163
221
  if (root.context !== undefined && typeof root.context !== 'object') {
@@ -192,7 +250,7 @@ export function conforms(c, machine, createActor, opts = {}) {
192
250
  const nest = (path) => path.split('.').reduceRight((acc, seg) => (acc === undefined ? seg : { [seg]: acc }), undefined);
193
251
  if (root.type === 'parallel')
194
252
  return Object.fromEntries(Object.keys(root.states ?? {}).filter(k => root.states[k].type !== 'history').map(k => [k, nest(String(d[k]))]));
195
- return nest(String(d.state));
253
+ return d.state === STATELESS ? {} : nest(String(d.state));
196
254
  };
197
255
  const contextKeys = Object.keys((root.context && typeof root.context === 'object' ? root.context : {}));
198
256
  let checked = 0;
@@ -1,3 +1,4 @@
1
+ import { type Lin } from '../core/solver.js';
1
2
  import { type Goal, type Path } from './kernel.js';
2
3
  import { type Outcome } from './prove.js';
3
4
  export declare const cdclStats: {
@@ -41,3 +42,12 @@ export declare function growCdcl(goal: Goal, root: Path, budget: {
41
42
  model?: boolean;
42
43
  wall?: number;
43
44
  }): Outcome;
45
+ export declare function cdclSession(goal: Goal, root: Path, opts?: {
46
+ maxLeaves?: number;
47
+ model?: boolean;
48
+ }): {
49
+ run: (b: {
50
+ nodes: number;
51
+ until?: number;
52
+ }, w?: number, assume?: Lin) => Outcome;
53
+ };