gdp-wired 0.21.0 → 0.23.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/README.md +16 -1
- package/dist/core/bmc.d.ts +38 -0
- package/dist/core/bmc.js +137 -0
- package/dist/core/check.d.ts +1 -1
- package/dist/core/check.js +19 -6
- package/dist/core/cycles.d.ts +15 -0
- package/dist/core/cycles.js +446 -8
- package/dist/core/cyclic.d.ts +6 -1
- package/dist/core/cyclic.js +13 -1
- package/dist/core/data.d.ts +17 -1
- package/dist/core/data.js +637 -97
- package/dist/core/dsl.d.ts +10 -1
- package/dist/core/dsl.js +47 -12
- package/dist/core/infer.js +518 -5
- package/dist/core/nonterm.d.ts +34 -0
- package/dist/core/nonterm.js +610 -0
- package/dist/core/q.d.ts +17 -0
- package/dist/core/q.js +52 -0
- package/dist/core/rationals.d.ts +112 -0
- package/dist/core/rationals.js +281 -0
- package/dist/core/relation.d.ts +28 -0
- package/dist/core/relation.js +480 -0
- package/dist/core/solver.d.ts +5 -2
- package/dist/core/solver.js +65 -20
- package/dist/core/transfer.d.ts +3 -3
- package/dist/core/transfer.js +77 -42
- package/dist/kernel/cdcl.d.ts +43 -0
- package/dist/kernel/cdcl.js +564 -0
- package/dist/kernel/kernel.d.ts +91 -0
- package/dist/kernel/kernel.js +310 -0
- package/dist/kernel/prove.d.ts +20 -1
- package/dist/kernel/prove.js +119 -44
- package/dist/kernel/qprove.d.ts +18 -0
- package/dist/kernel/qprove.js +157 -0
- package/dist/kernel/reader.d.ts +79 -0
- package/dist/kernel/reader.js +539 -0
- package/dist/kernel/simplex.d.ts +36 -0
- package/dist/kernel/simplex.js +259 -0
- package/dist/lean-kernel/emit.d.ts +19 -1
- package/dist/lean-kernel/emit.js +71 -3
- package/dist/lean-kernel/library.js +2 -0
- package/dist/lean-kernel/qlean.d.ts +26 -0
- package/dist/lean-kernel/qlean.js +105 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -103,12 +103,27 @@ All of these are proven automatically, and each proof is also a Lean theorem:
|
|
|
103
103
|
goal reads), and the lemma a stuck one needs (g(x, 0) = 2x through g(x, a) = a + 2x; a bound on another function);
|
|
104
104
|
`proveLoop` with no rank finds it (two phases' (x, y)) and the invariants it needs; the kernel checks the cyclic
|
|
105
105
|
proof (`examples/cycles.ts`).
|
|
106
|
+
- **Runs that never end**: `proveNeverEnds(loop)` proves some run of a loop goes on forever (pagination that accepts an
|
|
107
|
+
empty page, a retry with no cap): a closed recurrent set with the turn from each of its states given, a start and a
|
|
108
|
+
stem into it, checked by the kernel and again in Lean (`NonTerm.lean`'s `never_ends_of`; `examples/nonterm.ts`).
|
|
109
|
+
- **Rules over the rationals** (`gdp-wired/rationals`): `ratRule` with `rat` and `nonneg` params, inputs and state,
|
|
110
|
+
each value an exact rational (0.1 is 1/10, a third is 1/3: nothing scaled to cents or encoded as naturals), terms
|
|
111
|
+
linear (+, −, × and ÷ by a constant, min, max, when). Linear arithmetic over ℚ is decidable: a law is proven by
|
|
112
|
+
trees whose leaves are Farkas certificates with strict rows, or refuted by an exact run from the start. A fee split,
|
|
113
|
+
a rate limiter with fractional tokens and a ledger in decimals, and 12 laws true over one of ℕ and ℚ and false over
|
|
114
|
+
the other, each decided both ways (`examples/rationals.ts`); the proofs again in Lean (`Rationals.lean`'s
|
|
115
|
+
`Q.machine_sound`). Products of unknowns and transcendental functions stay outside.
|
|
106
116
|
- **Recursive datatypes as values** (`gdp-wired/data`): lists, trees, rose trees and their forests, declared by their
|
|
107
117
|
constructors; functions over them by structural recursion, or by any recursion whose termination is proven first (a
|
|
108
118
|
merge of two lists, a quicksort: the measure found, (size xs, size ys) or a sum of sizes, and each call's decrease
|
|
109
119
|
proven by the kernel before the function's equation is used; one that doesn't terminate is refused with the reason);
|
|
110
120
|
`proveData` finds the induction (structural, mutual, or the function's own call graph ranked by its measure) and the
|
|
111
121
|
lemmas, each proof checked in Lean against the `inductive` and the functions as declared (`examples/data.ts`).
|
|
122
|
+
An abstract sort (`opaque('Elem')`: values compared by equality alone, any other read refused) makes a law hold at
|
|
123
|
+
every element type, not only the naturals; `unknownFn('f', [Elem], List)` is any function between sorts (a law about
|
|
124
|
+
every f, every default, every callback); `closures(...)` is a datatype of functions with its `apply`, for fields that
|
|
125
|
+
hold functions (`examples/abstract.ts`; Lean's twin doesn't yet close two shapes of its export there: a datatype of
|
|
126
|
+
two constructors with fields, and two constructor values compared inside a disjunction).
|
|
112
127
|
- **Records and variants**: inputs, state, results, map cells and list items made of named fields, or one of several
|
|
113
128
|
cases each with fields of its own (a payment by card or in cash, a seat free, held or sold), every case covered
|
|
114
129
|
(`examples/datatypes.ts`).
|
|
@@ -142,7 +157,7 @@ sound.
|
|
|
142
157
|
| --- | --- | --- |
|
|
143
158
|
| `kernel/kernel.ts`, `core/check.ts` | **Yes** | Turns a rule and its laws into goals, and checks a proof tree for each: case splits on linear facts, then a linear refutation at each leaf |
|
|
144
159
|
| `kernel/cyclic.ts` | **Yes** | Cyclic proofs: builds each node's goals (its own, and for each node it uses, that node's hypotheses and that the rank drops) and checks each tree with kernel.ts's check. Its twin is `lean-kernel/Cyclic.lean` (`cyclic_sound`), and `lean-kernel/Bridge.lean` carries a cyclic proof of a machine's law, a recurrence's lemmas or a fold's law back to the rule itself |
|
|
145
|
-
| `kernel/prove.ts` | No |
|
|
160
|
+
| `kernel/prove.ts`, `kernel/cdcl.ts` | No | Find the proof trees: case splits, and CDCL over a goal's atoms whose refutation is unfolded into a tree. If they're wrong, the kernel rejects the tree |
|
|
146
161
|
| `lean-kernel/` | Optional | The kernel's twin in Lean 4.34.0, every rule proven sound there with the standard axioms only. The exporter sends the kernel's real trees; tampered ones compute to false |
|
|
147
162
|
| `research/search/`, `research/synth/`, `research/hw/` | No | The GPU searches for breaking runs, and invariant and rank synthesis. Every hit is replayed or proven before it counts |
|
|
148
163
|
| `core/dsl.ts`, `core/compose.ts`, the runtimes | No | The builders and combinators compile to the kernel's plain values; the runtimes are held to a reference evaluator |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type C, type Law, type Machine, type Request } from './machine.js';
|
|
2
|
+
export type BoundedRun = {
|
|
3
|
+
law: string;
|
|
4
|
+
depth: number;
|
|
5
|
+
witness: Record<string, number>;
|
|
6
|
+
params: Record<string, number>;
|
|
7
|
+
trace: Request[];
|
|
8
|
+
};
|
|
9
|
+
export type BmcOptions = {
|
|
10
|
+
ms: number;
|
|
11
|
+
wall?: number;
|
|
12
|
+
from?: number;
|
|
13
|
+
depth?: number;
|
|
14
|
+
progress?: (depth: number, outcome: 'refuted' | 'sat' | 'unknown', ms: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function bmcFits(m: Machine, laws: Law[]): boolean;
|
|
17
|
+
export declare const bmcRate = 200;
|
|
18
|
+
export declare function bmcGoal(m: Machine, laws: Law[], k: number): {
|
|
19
|
+
name: string;
|
|
20
|
+
hyps: C[];
|
|
21
|
+
};
|
|
22
|
+
export declare function fixed(hyps: C[]): {
|
|
23
|
+
hyps: C[];
|
|
24
|
+
fixed: Record<string, number>;
|
|
25
|
+
} | undefined;
|
|
26
|
+
export declare function runOf(m: Machine, w: Record<string, number>, k: number): {
|
|
27
|
+
params: Record<string, number>;
|
|
28
|
+
trace: Request[];
|
|
29
|
+
};
|
|
30
|
+
export declare function replay(m: Machine, laws: Law[], run: {
|
|
31
|
+
params: Record<string, number>;
|
|
32
|
+
trace: Request[];
|
|
33
|
+
}): {
|
|
34
|
+
law: string;
|
|
35
|
+
steps: number;
|
|
36
|
+
witness: Record<string, number>;
|
|
37
|
+
} | undefined;
|
|
38
|
+
export declare function findBoundedRun(m: Machine, laws: Law[], opts: BmcOptions): BoundedRun | undefined;
|
package/dist/core/bmc.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Bounded runs: a law broken by a run of k steps from the start, found by the prover's model search. Nothing here is
|
|
2
|
+
// trusted. The goal of depth k is the kernel's own k-step goal (kernel.ts's stepLawObligations, `steps: k`): its first
|
|
3
|
+
// `when` is the start (each state variable its start value over the params), its `then` the laws after the last step
|
|
4
|
+
// (primed names), refuted. Its constants are put in (`fixed`), and a model of it is asked of kernel/cdcl.ts's search
|
|
5
|
+
// over its atoms with the incremental simplex (`model`: a refutation isn't unfolded into a tree, and each decision's
|
|
6
|
+
// phase is the simplex's point's). The model names the params and each step's request; the run is then taken by the
|
|
7
|
+
// interpreter, each request checked against the rule's assumption, and kept only where it breaks a law. A goal refuted
|
|
8
|
+
// at depth k says no run of k steps breaks the laws; the depths grow until the budget, or 64 (the kernel's bound on k),
|
|
9
|
+
// runs out.
|
|
10
|
+
//
|
|
11
|
+
// The budget is read off prove.ts's clock inside `counted` (the kernel's work, bmcRate units a millisecond), so the
|
|
12
|
+
// search is the same on any machine; a wall-clock stop beside it (`wall`) is for callers under a wall-clock limit.
|
|
13
|
+
import { evalC, interpret, isArithmetic, numbersOf } from "./machine.js";
|
|
14
|
+
import { stepLawObligations, substC } from "../kernel/kernel.js";
|
|
15
|
+
import { clock, counted } from "../kernel/prove.js";
|
|
16
|
+
import { REFUTED, growCdcl } from "../kernel/cdcl.js";
|
|
17
|
+
import { allowed } from "./watch.js";
|
|
18
|
+
import { simpC } from "./nonterm.js";
|
|
19
|
+
// Machines whose runs the goals describe as they are: scalars only (no maps, history or carried maps), no quantified
|
|
20
|
+
// flag, no function but division by a constant (whose facts fix its value); laws plain (no key, no "there exists").
|
|
21
|
+
export function bmcFits(m, laws) {
|
|
22
|
+
if (Object.keys(m.maps ?? {}).length || m.history || m.inputMaps?.length)
|
|
23
|
+
return false;
|
|
24
|
+
if (Object.values(m.step.flags ?? {}).some(f => f.op === 'all'))
|
|
25
|
+
return false;
|
|
26
|
+
if (Object.keys(m.fns ?? {}).some(f => !isArithmetic(f)))
|
|
27
|
+
return false;
|
|
28
|
+
if (JSON.stringify([m.state, m.step, m.assume ?? null, laws.map(l => l.holds)]).includes('"op":"prod"'))
|
|
29
|
+
return false;
|
|
30
|
+
return laws.every(l => !l.forall && !l.some?.length);
|
|
31
|
+
}
|
|
32
|
+
// The counted clock's rate here, units of the kernel's work a millisecond: the median of what Modal's 2-vCPU containers
|
|
33
|
+
// did on the k-step goals of CHC-COMP's unsat LIA-Lin tasks (runs/unsat/bmc-only1: 1,462 depths past 200 ms, from 0 to
|
|
34
|
+
// 340 units a ms at the 90th percentile, 190 at the median). The CDCL search counts its rows, which a goal of many atoms
|
|
35
|
+
// and few rows a node keeps low, so a caller under a wall-clock limit gives a wall stop too.
|
|
36
|
+
export const bmcRate = 200;
|
|
37
|
+
// The goal of depth k: a run of k steps from the start whose last state breaks a law.
|
|
38
|
+
export function bmcGoal(m, laws, k) {
|
|
39
|
+
const start = { op: 'and', xs: Object.entries(m.state).map(([n, e]) => ({ op: '=', a: { op: 'var', name: n }, b: e })) };
|
|
40
|
+
const after = { vars: Object.fromEntries(Object.keys(m.state).map(n => [n, { op: 'var', name: `${n}'` }])), maps: {}, flags: {} };
|
|
41
|
+
const then = substC({ op: 'and', xs: laws.map(l => l.holds) }, after);
|
|
42
|
+
// Renamed: prove.ts keeps CDCL off goals named `@k steps` (for the size of their proofs); a model is all wanted here.
|
|
43
|
+
const g = stepLawObligations(m, [], {}, { name: 'a bounded run', when: start, then, steps: k })[0];
|
|
44
|
+
return { name: `a bounded run of ${k}`, hyps: g.hyps };
|
|
45
|
+
}
|
|
46
|
+
// The goal with its constants put in: each name a hypothesis fixes (n = c, at the top) replaced by its value and the
|
|
47
|
+
// terms folded (core/nonterm.ts's simpC), until none is left; the names fixed, with their values (a model's part), or
|
|
48
|
+
// undefined where a hypothesis folds to false (no model).
|
|
49
|
+
export function fixed(hyps) {
|
|
50
|
+
const top = (c) => (c.op === 'and' ? c.xs.flatMap(top) : [c]);
|
|
51
|
+
const isFalse = (c) => (c.op === '<' || c.op === '<=') && c.a.op === 'const' && c.b.op === 'const' && (c.op === '<' ? c.a.value >= c.b.value : c.a.value > c.b.value);
|
|
52
|
+
const isTrue = (c) => c.op === '<=' && c.a.op === 'const' && c.b.op === 'const' && c.a.value <= c.b.value;
|
|
53
|
+
const values = {};
|
|
54
|
+
let cs = hyps.flatMap(top);
|
|
55
|
+
for (;;) {
|
|
56
|
+
const now = {};
|
|
57
|
+
for (const c of cs)
|
|
58
|
+
if (c.op === '=') {
|
|
59
|
+
const [v, k] = c.a.op === 'var' && c.b.op === 'const' ? [c.a.name, c.b.value] : c.b.op === 'var' && c.a.op === 'const' ? [c.b.name, c.a.value] : [];
|
|
60
|
+
if (v !== undefined && !(v in now)) {
|
|
61
|
+
now[v] = { op: 'const', value: k };
|
|
62
|
+
values[v] = k;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (!Object.keys(now).length)
|
|
66
|
+
return { hyps: cs, fixed: values };
|
|
67
|
+
cs = cs.map(c => simpC(substC(c, { vars: now, maps: {}, flags: {} }))).flatMap(top);
|
|
68
|
+
if (cs.some(isFalse))
|
|
69
|
+
return undefined;
|
|
70
|
+
cs = cs.filter(c => !isTrue(c));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// The run a model names: the params, the first request by plain names, the j-th (j >= 2) as input@j.
|
|
74
|
+
export function runOf(m, w, k) {
|
|
75
|
+
const at = (n) => Math.max(0, Math.round(w[n] ?? 0));
|
|
76
|
+
const params = Object.fromEntries(m.params.map(p => [p, at(p)]));
|
|
77
|
+
const trace = Array.from({ length: k }, (_, j) => Object.fromEntries(m.inputs.map(n => [n, at(j ? `${n}@${j + 1}` : n)])));
|
|
78
|
+
return { params, trace };
|
|
79
|
+
}
|
|
80
|
+
// The run taken by the interpreter, up to the first step that breaks a law: the law, the steps, and the witness (the
|
|
81
|
+
// params, the state the last step starts from and its request), or undefined (a request refused, or no law broken).
|
|
82
|
+
export function replay(m, laws, run) {
|
|
83
|
+
const it = interpret(m);
|
|
84
|
+
if (m.pre && !evalC(m.pre, run.params, { scalars: {}, maps: {} }, m))
|
|
85
|
+
return undefined;
|
|
86
|
+
try {
|
|
87
|
+
let st = it.init(run.params);
|
|
88
|
+
for (const [j, input] of run.trace.entries()) {
|
|
89
|
+
if (!allowed(m, it, run.params, st, input))
|
|
90
|
+
return undefined;
|
|
91
|
+
const before = st;
|
|
92
|
+
st = it.step(run.params, st, input);
|
|
93
|
+
const law = laws.find(l => !evalC(l.holds, { ...run.params }, st, m))?.name;
|
|
94
|
+
if (law !== undefined)
|
|
95
|
+
return { law, steps: j + 1, witness: { ...run.params, ...before.scalars, ...numbersOf(input) } };
|
|
96
|
+
}
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
if (e instanceof RangeError)
|
|
101
|
+
return undefined;
|
|
102
|
+
throw e;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export function findBoundedRun(m, laws, opts) {
|
|
106
|
+
if (!laws.length || !bmcFits(m, laws))
|
|
107
|
+
return undefined;
|
|
108
|
+
const last = Math.min(64, opts.depth ?? 64);
|
|
109
|
+
return counted(bmcRate, () => {
|
|
110
|
+
const until = clock() + opts.ms;
|
|
111
|
+
for (let k = opts.from ?? 1; k <= last && clock() < until && !(opts.wall !== undefined && performance.now() > opts.wall); k++) {
|
|
112
|
+
const t0 = clock();
|
|
113
|
+
let goal;
|
|
114
|
+
try {
|
|
115
|
+
goal = bmcGoal(m, laws, k);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
const f = fixed(goal.hyps);
|
|
121
|
+
if (!f) {
|
|
122
|
+
opts.progress?.(k, 'refuted', Math.round(clock() - t0));
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
const out = growCdcl({ name: goal.name, hyps: f.hyps }, new Map(), { nodes: 0, until }, { model: true, ...(opts.wall !== undefined ? { wall: opts.wall } : {}) });
|
|
126
|
+
const refuted = !('tree' in out) && out.why === REFUTED;
|
|
127
|
+
opts.progress?.(k, refuted ? 'refuted' : 'tree' in out ? 'refuted' : out.stuck, Math.round(clock() - t0));
|
|
128
|
+
if (refuted || 'tree' in out)
|
|
129
|
+
continue;
|
|
130
|
+
if (out.stuck !== 'sat' || !out.witness)
|
|
131
|
+
return undefined;
|
|
132
|
+
const run = runOf(m, { ...out.witness, ...f.fixed }, k), broken = replay(m, laws, run);
|
|
133
|
+
return broken ? { law: broken.law, witness: broken.witness, depth: broken.steps, params: run.params, trace: run.trace.slice(0, broken.steps) } : undefined;
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
});
|
|
137
|
+
}
|
package/dist/core/check.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Constraint, Step } from './solver.js';
|
|
2
|
-
export declare function checkRefutation(constraints: Constraint[], steps: Step[]): boolean;
|
|
2
|
+
export declare function checkRefutation(constraints: Constraint[], steps: Step[], integral?: boolean): boolean;
|
|
3
3
|
export declare function checkWitness(constraints: Constraint[], witness: Record<string, number>): boolean;
|
package/dist/core/check.js
CHANGED
|
@@ -1,30 +1,43 @@
|
|
|
1
1
|
const vars = (lin) => Object.keys(lin).filter(key => key !== '1');
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
const exact = (lin) => Object.values(lin).every(c => Number.isSafeInteger(c));
|
|
3
|
+
export function checkRefutation(constraints, steps, integral = true) {
|
|
4
|
+
const rows = [], strict = [];
|
|
4
5
|
for (const [i, s] of steps.entries()) {
|
|
5
6
|
if (s.kind === 'input') {
|
|
6
|
-
if (!(s.index >= 0 && s.index < constraints.length))
|
|
7
|
+
if (!(Number.isInteger(s.index) && s.index >= 0 && s.index < constraints.length))
|
|
7
8
|
return false;
|
|
8
|
-
|
|
9
|
+
const c = constraints[s.index];
|
|
10
|
+
if (!integral && !exact(c.lin))
|
|
11
|
+
return false;
|
|
12
|
+
rows.push(c.lin);
|
|
13
|
+
strict.push(!integral && c.strict === true);
|
|
9
14
|
}
|
|
10
15
|
else if (s.kind === 'combine') {
|
|
11
16
|
if (!(s.a < i && s.b < i && Number.isInteger(s.ma) && Number.isInteger(s.mb) && s.ma > 0 && s.mb > 0))
|
|
12
17
|
return false;
|
|
18
|
+
if (!integral && !(Number.isInteger(s.a) && Number.isInteger(s.b) && s.a >= 0 && s.b >= 0))
|
|
19
|
+
return false;
|
|
13
20
|
const out = {};
|
|
14
21
|
for (const [lin, m] of [[rows[s.a], s.ma], [rows[s.b], s.mb]])
|
|
15
22
|
for (const [key, c] of Object.entries(lin))
|
|
16
23
|
out[key] = (out[key] ?? 0) + m * c;
|
|
24
|
+
if (!integral && !exact(out))
|
|
25
|
+
return false;
|
|
17
26
|
rows.push(out);
|
|
27
|
+
strict.push(strict[s.a] || strict[s.b]);
|
|
18
28
|
}
|
|
19
29
|
else {
|
|
30
|
+
if (!integral)
|
|
31
|
+
return false;
|
|
20
32
|
const row = rows[s.of];
|
|
21
33
|
if (!(row !== undefined && s.of < i && Number.isInteger(s.g) && s.g > 0 && vars(row).every(key => row[key] % s.g === 0)))
|
|
22
34
|
return false;
|
|
23
35
|
rows.push({ ...Object.fromEntries(vars(row).map(key => [key, row[key] / s.g])), 1: Math.ceil((row['1'] ?? 0) / s.g) });
|
|
36
|
+
strict.push(false);
|
|
24
37
|
}
|
|
25
38
|
}
|
|
26
|
-
const last = rows.at(-1);
|
|
27
|
-
return last !== undefined && vars(last).every(key => last[key] === 0) && (
|
|
39
|
+
const last = rows.at(-1), constant = last?.['1'] ?? 0;
|
|
40
|
+
return last !== undefined && vars(last).every(key => last[key] === 0) && (constant > 0 || (strict.at(-1) && constant >= 0));
|
|
28
41
|
}
|
|
29
42
|
export function checkWitness(constraints, witness) {
|
|
30
43
|
return constraints.every(c => Object.entries(c.lin).reduce((sum, [key, a]) => sum + a * (key === '1' ? 1 : (witness[key] ?? NaN)), 0) <= 0);
|
package/dist/core/cycles.d.ts
CHANGED
|
@@ -50,6 +50,21 @@ export declare function ranksOfRuns(vars: string[], points: Env[], edges: {
|
|
|
50
50
|
};
|
|
51
51
|
export declare function claimInstances(facts: Fact[], claim: Claim, depth?: number): NodeSpec['insts'];
|
|
52
52
|
export declare function findCycles(facts: Fact[], claims: Claim[], opts?: CycleOptions): CycleVerdict;
|
|
53
|
+
export declare function rankOfRelation(l: Loop, laws: Law[], until: number): {
|
|
54
|
+
rank: E[];
|
|
55
|
+
text: string;
|
|
56
|
+
blocks: number[];
|
|
57
|
+
} | {
|
|
58
|
+
why: string;
|
|
59
|
+
};
|
|
60
|
+
export declare function rankWithInvariants(l: Loop, laws: Law[], until: number): {
|
|
61
|
+
rank: E[];
|
|
62
|
+
text: string;
|
|
63
|
+
laws: Law[];
|
|
64
|
+
texts: string[];
|
|
65
|
+
} | {
|
|
66
|
+
why: string;
|
|
67
|
+
};
|
|
53
68
|
export type RankVerdict = {
|
|
54
69
|
proven: boolean;
|
|
55
70
|
checked: boolean;
|