gdp-wired 0.54.2 → 0.55.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/dist/core/aggregate-search.d.ts +2 -1
- package/dist/core/aggregate-search.js +14 -2
- package/dist/core/grouped-sum-search.d.ts +4 -0
- package/dist/core/grouped-sum-search.js +327 -0
- package/dist/kernel/grouped-sum.d.ts +40 -0
- package/dist/kernel/grouped-sum.js +286 -0
- package/dist/lean-kernel/emit.d.ts +7 -2
- package/dist/lean-kernel/emit.js +7 -3
- package/dist/lean-kernel/grouped-sum-export.d.ts +3 -0
- package/dist/lean-kernel/grouped-sum-export.js +82 -0
- package/dist/lean-kernel/library.js +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Law, Machine } from './machine.js';
|
|
2
2
|
import { type FiniteSumCertificate } from '../kernel/finite-sum.js';
|
|
3
3
|
import { type GhostWriteCertificate } from '../kernel/ghost-write.js';
|
|
4
|
+
import type { GroupedSumCertificate } from '../kernel/grouped-sum.js';
|
|
4
5
|
import { type AggregateKinds } from './aggregate-kinds.js';
|
|
5
|
-
export type AggregateCertificate = FiniteSumCertificate | GhostWriteCertificate;
|
|
6
|
+
export type AggregateCertificate = FiniteSumCertificate | GhostWriteCertificate | GroupedSumCertificate;
|
|
6
7
|
export declare function searchAggregate(m: Machine, law: Law, getKinds: () => Law[], ms: number): {
|
|
7
8
|
certificate: AggregateCertificate;
|
|
8
9
|
kinds?: AggregateKinds;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { searchWall } from "./wall.js";
|
|
2
2
|
import { proposeFilteredCounters } from "./filtered-sum-candidates.js";
|
|
3
3
|
import { weightedSearch } from "./aggregate-weighted/search.js";
|
|
4
|
+
import { hasGroupedSumShape, searchGroupedSum } from "./grouped-sum-search.js";
|
|
4
5
|
import { checkFiniteSum, finiteSumTheory, sumLocalGoal } from "../kernel/finite-sum.js";
|
|
5
6
|
import { checkGhostWrite } from "../kernel/ghost-write.js";
|
|
6
7
|
import { clock, grow, pastWall, withWall } from "../kernel/prove.js";
|
|
@@ -64,9 +65,20 @@ function proposeAggregate(m, law, ms) {
|
|
|
64
65
|
return undefined;
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
const canWeight = maps.some(write => 'each' in write) && maps.some(write => !('each' in write));
|
|
69
|
+
const until = clock() + ms;
|
|
70
|
+
if (hasGroupedSumShape(m, law)) {
|
|
71
|
+
const groupBudget = canWeight ? Math.min(5_000, Math.floor(ms / 3)) : Math.min(10_000, ms);
|
|
72
|
+
const grouped = searchGroupedSum(m, law, groupBudget);
|
|
73
|
+
if (grouped)
|
|
74
|
+
return grouped;
|
|
75
|
+
}
|
|
76
|
+
if (!canWeight)
|
|
77
|
+
return;
|
|
78
|
+
const remaining = until - clock();
|
|
79
|
+
if (!(remaining > 0))
|
|
68
80
|
return;
|
|
69
|
-
const p = weightedSearch(m, law,
|
|
81
|
+
const p = weightedSearch(m, law, remaining);
|
|
70
82
|
if (!p)
|
|
71
83
|
return;
|
|
72
84
|
const cert = { kind: 'ghost-write', recipe: p.recipe, projection: { omitMap: p.recipe.ghostMap }, target: p.machine, laws: p.laws, pointLaw: p.pointLaw, proof: p.proof };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Law, type Machine } from './machine.js';
|
|
2
|
+
import { type GroupedSumCertificate } from '../kernel/grouped-sum.js';
|
|
3
|
+
export declare const hasGroupedSumShape: (source: Machine, law: Law) => boolean;
|
|
4
|
+
export declare function searchGroupedSum(source: Machine, law: Law, ms: number): GroupedSumCertificate | undefined;
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
// Untrusted grouped-sum candidate synthesis and proving.
|
|
2
|
+
// Recognizes row-grouped covering laws of the shape:
|
|
3
|
+
// ∀ k. G(k) ⇒ w(k) ≤ Tot[grp(k)] (and companion scalar clauses ∀ k. G'(k) ⇒ w'(k) ≤ X)
|
|
4
|
+
// synthesizes fresh observer + parameterized sum helpers, proves the plain SMachine family,
|
|
5
|
+
// and accepts ONLY certificates verified by the trusted checker `checkGroupedSum`.
|
|
6
|
+
import { atMost, get, n, not, plus, same, x } from "./machine.js";
|
|
7
|
+
import { checkGroupedSum, groupedSumTheory } from "../kernel/grouped-sum.js";
|
|
8
|
+
import { substC, substE } from "../kernel/kernel.js";
|
|
9
|
+
import { clock, grow, pastWall, proveLaws, withDeadline } from "../kernel/prove.js";
|
|
10
|
+
import { growCdcl } from "../kernel/cdcl.js";
|
|
11
|
+
const ZERO = n(0);
|
|
12
|
+
const ONE = n(1);
|
|
13
|
+
const text = (v) => JSON.stringify(v);
|
|
14
|
+
function clauses(c, neg, most) {
|
|
15
|
+
switch (c.op) {
|
|
16
|
+
case 'not': return clauses(c.x, !neg, most);
|
|
17
|
+
case 'and':
|
|
18
|
+
case 'or': {
|
|
19
|
+
const parts = c.xs.map(y => clauses(y, neg, most));
|
|
20
|
+
if (parts.some(p => !p))
|
|
21
|
+
return undefined;
|
|
22
|
+
if ((c.op === 'and') !== neg) {
|
|
23
|
+
const out = parts.flat();
|
|
24
|
+
return out.length > most ? undefined : out;
|
|
25
|
+
}
|
|
26
|
+
let out = [[]];
|
|
27
|
+
for (const p of parts) {
|
|
28
|
+
out = out.flatMap(a => p.map(b => [...a, ...b]));
|
|
29
|
+
if (out.length > most)
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
case '<':
|
|
35
|
+
case '<=':
|
|
36
|
+
case '=': return [[{ c, neg }]];
|
|
37
|
+
case 'flag':
|
|
38
|
+
case 'all': return undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function reads(t, key, r = { vars: new Set(), maps: new Set(), keyed: true, shaped: true }) {
|
|
42
|
+
switch (t.op) {
|
|
43
|
+
case 'var':
|
|
44
|
+
r.vars.add(t.name);
|
|
45
|
+
break;
|
|
46
|
+
case 'const': break;
|
|
47
|
+
case 'get':
|
|
48
|
+
r.maps.add(t.map);
|
|
49
|
+
if (!(t.key.op === 'var' && t.key.name === key)) {
|
|
50
|
+
r.keyed = false;
|
|
51
|
+
reads(t.key, key, r);
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
case 'mul':
|
|
55
|
+
reads(t.a, key, r);
|
|
56
|
+
break;
|
|
57
|
+
case 'add':
|
|
58
|
+
case 'sub':
|
|
59
|
+
case 'min':
|
|
60
|
+
case 'max':
|
|
61
|
+
case 'prod':
|
|
62
|
+
reads(t.a, key, r);
|
|
63
|
+
reads(t.b, key, r);
|
|
64
|
+
break;
|
|
65
|
+
case 'if':
|
|
66
|
+
reads(t.c, key, r);
|
|
67
|
+
reads(t.then, key, r);
|
|
68
|
+
reads(t.else, key, r);
|
|
69
|
+
break;
|
|
70
|
+
case 'tup':
|
|
71
|
+
case 'proj':
|
|
72
|
+
r.shaped = false;
|
|
73
|
+
break;
|
|
74
|
+
case '<':
|
|
75
|
+
case '<=':
|
|
76
|
+
case '=':
|
|
77
|
+
reads(t.a, key, r);
|
|
78
|
+
reads(t.b, key, r);
|
|
79
|
+
break;
|
|
80
|
+
case 'and':
|
|
81
|
+
case 'or':
|
|
82
|
+
for (const y of t.xs)
|
|
83
|
+
reads(y, key, r);
|
|
84
|
+
break;
|
|
85
|
+
case 'not':
|
|
86
|
+
reads(t.x, key, r);
|
|
87
|
+
break;
|
|
88
|
+
case 'flag':
|
|
89
|
+
case 'all':
|
|
90
|
+
r.shaped = false;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
return r;
|
|
94
|
+
}
|
|
95
|
+
function atMostLit(l) {
|
|
96
|
+
const c = l.c;
|
|
97
|
+
if (c.op === '<=' && !l.neg)
|
|
98
|
+
return { lo: c.a, hi: c.b };
|
|
99
|
+
if (c.op === '<' && l.neg)
|
|
100
|
+
return { lo: c.b, hi: c.a };
|
|
101
|
+
if (c.op === '<' && !l.neg && c.a.op === 'const')
|
|
102
|
+
return { lo: n(c.a.value + 1), hi: c.b };
|
|
103
|
+
if (c.op === '<=' && l.neg && c.b.op === 'const')
|
|
104
|
+
return { lo: n(c.b.value + 1), hi: c.a };
|
|
105
|
+
if (c.op === '=' && l.neg) {
|
|
106
|
+
if (c.a.op === 'const' && c.a.value === 0)
|
|
107
|
+
return { lo: ONE, hi: c.b };
|
|
108
|
+
if (c.b.op === 'const' && c.b.value === 0)
|
|
109
|
+
return { lo: ONE, hi: c.a };
|
|
110
|
+
}
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const litC = (l) => (l.neg ? not(l.c) : l.c);
|
|
114
|
+
const notLit = (l) => (l.neg ? l.c : not(l.c));
|
|
115
|
+
function parseGroupedShapes(m, law) {
|
|
116
|
+
const key = law.forall;
|
|
117
|
+
if (!key || law.keys?.length || law.some?.length || law.ex || law.finite !== undefined || law.witness)
|
|
118
|
+
return;
|
|
119
|
+
if (m.history || m.primitiveFailure || Object.keys(m.counts ?? {}).length
|
|
120
|
+
|| Object.keys(m.sums ?? {}).length || Object.keys(m.leasts ?? {}).length || !m.maps)
|
|
121
|
+
return;
|
|
122
|
+
const cs = clauses(law.holds, false, 16);
|
|
123
|
+
if (!cs)
|
|
124
|
+
return;
|
|
125
|
+
const stateMap = (name) => Object.hasOwn(m.maps, name) && !(m.inputMaps ?? []).includes(name) && !Object.hasOwn(m.fns ?? {}, name);
|
|
126
|
+
const scalarVar = (name) => Object.hasOwn(m.state, name);
|
|
127
|
+
const cellTerm = (t) => {
|
|
128
|
+
const r = reads(t, key);
|
|
129
|
+
return r.shaped && r.keyed && r.maps.size > 0 && r.vars.size === 0 && [...r.maps].every(stateMap);
|
|
130
|
+
};
|
|
131
|
+
const freeTerm = (t) => {
|
|
132
|
+
const r = reads(t, key);
|
|
133
|
+
return r.shaped && !r.vars.has(key) && r.maps.size === 0;
|
|
134
|
+
};
|
|
135
|
+
const scalarTotal = (t) => freeTerm(t) && [...reads(t, key).vars].some(scalarVar);
|
|
136
|
+
const groupedTotal = (t) => t.op === 'get' && stateMap(t.map) && cellTerm(t.key) ? { totMap: t.map, group: t.key } : undefined;
|
|
137
|
+
const grouped = [];
|
|
138
|
+
const scalar = [];
|
|
139
|
+
for (const clause of cs) {
|
|
140
|
+
const guards = [], unless = [];
|
|
141
|
+
let grpMatch;
|
|
142
|
+
let weight, scalTot;
|
|
143
|
+
let ok = true;
|
|
144
|
+
for (const l of clause) {
|
|
145
|
+
if (cellTerm(l.c)) {
|
|
146
|
+
guards.push(notLit(l));
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const le = atMostLit(l);
|
|
150
|
+
if (le) {
|
|
151
|
+
const gt = groupedTotal(le.hi);
|
|
152
|
+
if (gt && !grpMatch && !scalTot && (cellTerm(le.lo) || (le.lo.op === 'const' && le.lo.value === 1))) {
|
|
153
|
+
grpMatch = gt;
|
|
154
|
+
weight = le.lo;
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (scalarTotal(le.hi) && !grpMatch && !weight && !scalTot && cellTerm(le.lo)) {
|
|
158
|
+
weight = le.lo;
|
|
159
|
+
scalTot = le.hi;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (scalarTotal(le.hi) && !grpMatch && le.lo.op === 'const' && le.lo.value === 1 && (!weight || text(weight) === text(ONE))) {
|
|
163
|
+
weight = ONE;
|
|
164
|
+
scalTot = scalTot ? plus(scalTot, le.hi) : le.hi;
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (freeTerm(l.c)) {
|
|
169
|
+
unless.push(litC(l));
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
ok = false;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
if (!ok || !weight)
|
|
176
|
+
continue;
|
|
177
|
+
if (weight.op === 'const' && !guards.length)
|
|
178
|
+
continue;
|
|
179
|
+
if (grpMatch)
|
|
180
|
+
grouped.push({ kind: 'grouped', totMap: grpMatch.totMap, group: grpMatch.group, weight, guards, unless });
|
|
181
|
+
else if (scalTot)
|
|
182
|
+
scalar.push({ kind: 'scalar', total: scalTot, weight, guards, unless });
|
|
183
|
+
}
|
|
184
|
+
if (!grouped.length)
|
|
185
|
+
return;
|
|
186
|
+
return { key, grouped, scalar };
|
|
187
|
+
}
|
|
188
|
+
const andAll = (xs) => (xs.length === 1 ? xs[0] : { op: 'and', xs });
|
|
189
|
+
function tryProveVariant(source, law, observer, group, sums, laws, until) {
|
|
190
|
+
if (clock() >= until || pastWall())
|
|
191
|
+
return;
|
|
192
|
+
const dummy = {
|
|
193
|
+
kind: 'grouped-sum',
|
|
194
|
+
observer,
|
|
195
|
+
group,
|
|
196
|
+
sums,
|
|
197
|
+
laws,
|
|
198
|
+
proof: { instances: {}, trees: {} },
|
|
199
|
+
};
|
|
200
|
+
let theory;
|
|
201
|
+
try {
|
|
202
|
+
theory = groupedSumTheory(source, law, dummy);
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (!theory)
|
|
208
|
+
return;
|
|
209
|
+
const sideTrees = Object.create(null);
|
|
210
|
+
for (const g of theory.initGoals) {
|
|
211
|
+
if (clock() >= until || pastWall())
|
|
212
|
+
return;
|
|
213
|
+
const res = grow(g, new Map(), { nodes: 0, until: Math.min(until, clock() + 500) });
|
|
214
|
+
if (!('tree' in res))
|
|
215
|
+
return;
|
|
216
|
+
sideTrees[g.name] = res.tree;
|
|
217
|
+
}
|
|
218
|
+
const out = withDeadline(until, () => proveLaws(theory.plain, laws));
|
|
219
|
+
if (!out.proven || !out.checked || !out.proof || pastWall())
|
|
220
|
+
return;
|
|
221
|
+
for (const g of theory.coverGoals) {
|
|
222
|
+
if (clock() >= until || pastWall())
|
|
223
|
+
return;
|
|
224
|
+
const quick = grow(g, new Map(), { nodes: 0, until: Math.min(until, clock() + 500) });
|
|
225
|
+
const got = 'tree' in quick ? quick : growCdcl(g, new Map(), { nodes: 0, until });
|
|
226
|
+
if (!('tree' in got))
|
|
227
|
+
return;
|
|
228
|
+
sideTrees[g.name] = got.tree;
|
|
229
|
+
}
|
|
230
|
+
const cert = {
|
|
231
|
+
kind: 'grouped-sum',
|
|
232
|
+
observer,
|
|
233
|
+
group,
|
|
234
|
+
sums,
|
|
235
|
+
laws,
|
|
236
|
+
proof: { instances: out.proof.instances, trees: { ...out.proof.trees, ...sideTrees } },
|
|
237
|
+
};
|
|
238
|
+
return checkGroupedSum(source, law, cert) ? cert : undefined;
|
|
239
|
+
}
|
|
240
|
+
export const hasGroupedSumShape = (source, law) => parseGroupedShapes(source, law) !== undefined;
|
|
241
|
+
export function searchGroupedSum(source, law, ms) {
|
|
242
|
+
if (!Number.isFinite(ms) || ms <= 0)
|
|
243
|
+
return;
|
|
244
|
+
const parsed = parseGroupedShapes(source, law);
|
|
245
|
+
if (!parsed)
|
|
246
|
+
return;
|
|
247
|
+
const { key, grouped, scalar } = parsed;
|
|
248
|
+
const until = clock() + ms;
|
|
249
|
+
// Fresh prefix avoiding every identifier already present in source or law.
|
|
250
|
+
const occupied = text([source, law]);
|
|
251
|
+
let prefix = 'gs$';
|
|
252
|
+
while (occupied.includes(prefix))
|
|
253
|
+
prefix += 'a';
|
|
254
|
+
const observer = `${prefix}obs`;
|
|
255
|
+
// Try each distinct group key expression found in the law (usually one).
|
|
256
|
+
const distinctGroups = [...new Map(grouped.map(g => [text(g.group), g.group])).values()];
|
|
257
|
+
for (const group of distinctGroups) {
|
|
258
|
+
if (clock() >= until || pastWall())
|
|
259
|
+
return;
|
|
260
|
+
const matchingGrouped = grouped.filter(g => text(g.group) === text(group));
|
|
261
|
+
const sums = Object.create(null);
|
|
262
|
+
const boundSpecs = [];
|
|
263
|
+
const zeroHelpers = [];
|
|
264
|
+
const seenSum = new Map();
|
|
265
|
+
const seenZero = new Set();
|
|
266
|
+
let sumIdx = 0;
|
|
267
|
+
const addSum = (isGrouped, guards, weight, target, unless) => {
|
|
268
|
+
const kName = `${prefix}k${sumIdx}`;
|
|
269
|
+
const subKey = { vars: { [key]: x(kName) }, maps: {}, flags: {} };
|
|
270
|
+
const gConds = [
|
|
271
|
+
...guards.map(g => substC(g, subKey)),
|
|
272
|
+
...(isGrouped ? [same(substE(group, subKey), x(observer))] : []),
|
|
273
|
+
];
|
|
274
|
+
const wAtK = substE(weight, subKey);
|
|
275
|
+
const term = gConds.length ? { op: 'if', c: andAll(gConds), then: wAtK, else: ZERO } : wAtK;
|
|
276
|
+
const params = isGrouped ? [observer] : [];
|
|
277
|
+
// Deduplicate sums modulo key-binder renaming.
|
|
278
|
+
const sig = text({ params, term: substE(term, { vars: { [kName]: x(key) }, maps: {}, flags: {} }) });
|
|
279
|
+
let sName = seenSum.get(sig);
|
|
280
|
+
if (!sName) {
|
|
281
|
+
sName = `${prefix}s${sumIdx++}`;
|
|
282
|
+
seenSum.set(sig, sName);
|
|
283
|
+
sums[sName] = { key: kName, term, params };
|
|
284
|
+
}
|
|
285
|
+
boundSpecs.push({ name: `${prefix}bound_${boundSpecs.length}`, sumVar: sName, target, unless });
|
|
286
|
+
// Canonical inactive-cell-zero companion law for weighted sums over a 0-initialized map.
|
|
287
|
+
if (weight.op === 'get' && source.maps?.[weight.map] === 0 && guards.length) {
|
|
288
|
+
const holds = { op: 'or', xs: [andAll(guards), same(weight, ZERO)] };
|
|
289
|
+
const zSig = text(holds);
|
|
290
|
+
if (!seenZero.has(zSig)) {
|
|
291
|
+
seenZero.add(zSig);
|
|
292
|
+
zeroHelpers.push({ name: `${prefix}zero_${zeroHelpers.length}`, forall: key, holds });
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
for (const sc of scalar)
|
|
297
|
+
addSum(false, sc.guards, sc.weight, sc.total, sc.unless);
|
|
298
|
+
for (const gc of matchingGrouped)
|
|
299
|
+
addSum(true, gc.guards, gc.weight, get(gc.totMap, x(observer)), gc.unless);
|
|
300
|
+
const guardTarget = {
|
|
301
|
+
name: law.name,
|
|
302
|
+
forall: key,
|
|
303
|
+
holds: { op: 'or', xs: [not(same(group, x(observer))), law.holds] },
|
|
304
|
+
};
|
|
305
|
+
const makeBounds = (op) => boundSpecs.map(b => {
|
|
306
|
+
const cmp = op === '<=' ? atMost(x(b.sumVar), b.target) : same(x(b.sumVar), b.target);
|
|
307
|
+
return { name: b.name, holds: b.unless.length ? { op: 'or', xs: [...b.unless, cmp] } : cmp };
|
|
308
|
+
});
|
|
309
|
+
// Variant 0: minimal inequality family (e.g. NATS row 7).
|
|
310
|
+
// Variant 1: inequality family + inactive-cell-zero companions (e.g. DuckDB row 16).
|
|
311
|
+
// Variant 2: exact equality family + inactive-cell-zero companions.
|
|
312
|
+
const variants = [
|
|
313
|
+
[...makeBounds('<='), guardTarget],
|
|
314
|
+
...(zeroHelpers.length ? [[...zeroHelpers, ...makeBounds('<='), guardTarget]] : []),
|
|
315
|
+
[...zeroHelpers, ...makeBounds('='), guardTarget],
|
|
316
|
+
];
|
|
317
|
+
const sliceMs = Math.max(1000, Math.floor((until - clock()) / variants.length));
|
|
318
|
+
for (const laws of variants) {
|
|
319
|
+
if (clock() >= until || pastWall())
|
|
320
|
+
return;
|
|
321
|
+
const cert = tryProveVariant(source, law, observer, group, sums, laws, Math.min(until, clock() + sliceMs));
|
|
322
|
+
if (cert)
|
|
323
|
+
return cert;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return undefined;
|
|
327
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type E, type Law, type Machine } from '../core/machine.js';
|
|
2
|
+
import { type Goal, type Instances, type Tree } from './kernel.js';
|
|
3
|
+
export type GroupedSumDecl = {
|
|
4
|
+
key: string;
|
|
5
|
+
term: E;
|
|
6
|
+
params: string[];
|
|
7
|
+
covers?: E[];
|
|
8
|
+
};
|
|
9
|
+
export type GroupedSumCertificate = {
|
|
10
|
+
kind: 'grouped-sum';
|
|
11
|
+
observer: string;
|
|
12
|
+
group: E;
|
|
13
|
+
sums: Record<string, GroupedSumDecl>;
|
|
14
|
+
laws: Law[];
|
|
15
|
+
proof: {
|
|
16
|
+
instances: Record<string, Instances>;
|
|
17
|
+
trees: Record<string, Tree>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare function defaultGroupedCovers(m: Machine, term: E): E[];
|
|
21
|
+
export type CheckedGroupedSumDecl = {
|
|
22
|
+
name: string;
|
|
23
|
+
key: string;
|
|
24
|
+
params: string[];
|
|
25
|
+
term: E;
|
|
26
|
+
covers: E[];
|
|
27
|
+
flag: string;
|
|
28
|
+
x: string;
|
|
29
|
+
read: string[];
|
|
30
|
+
};
|
|
31
|
+
export declare function groupedSumTheory(source: Machine, law: Law, cert: GroupedSumCertificate): {
|
|
32
|
+
plain: Machine;
|
|
33
|
+
observer: string;
|
|
34
|
+
group: E;
|
|
35
|
+
decls: CheckedGroupedSumDecl[];
|
|
36
|
+
initGoals: Goal[];
|
|
37
|
+
coverGoals: Goal[];
|
|
38
|
+
guardIndex: number;
|
|
39
|
+
} | undefined;
|
|
40
|
+
export declare function checkGroupedSum(source: Machine, law: Law, cert: GroupedSumCertificate): boolean;
|