gdp-wired 0.49.0 → 0.50.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 +4 -0
- package/dist/core/candidate-seeds.d.ts +25 -0
- package/dist/core/candidate-seeds.js +90 -0
- package/dist/core/cli.js +3 -0
- package/dist/core/count-support.d.ts +1 -0
- package/dist/core/count-support.js +23 -2
- package/dist/core/counted-candidate-seeds.d.ts +12 -0
- package/dist/core/counted-candidate-seeds.js +31 -0
- package/dist/core/counts.js +9 -2
- package/dist/core/dsl.d.ts +23 -2
- package/dist/core/dsl.js +49 -16
- package/dist/core/exists.js +2 -1
- package/dist/core/field-laws.js +23 -5
- package/dist/core/infer.js +4 -3
- package/dist/core/lift-cli.d.ts +11 -0
- package/dist/core/lift-cli.js +113 -0
- package/dist/core/proof-output.d.ts +53 -0
- package/dist/core/proof-output.js +38 -0
- package/dist/core/quorum-laws.js +55 -16
- package/dist/kernel/function-instances.d.ts +45 -0
- package/dist/kernel/function-instances.js +460 -0
- package/dist/kernel/prove.d.ts +12 -3
- package/dist/kernel/prove.js +164 -90
- package/dist/lean-kernel/axiom-audit.d.ts +11 -0
- package/dist/lean-kernel/axiom-audit.js +50 -0
- package/dist/lean-kernel/emit.d.ts +25 -2
- package/dist/lean-kernel/emit.js +75 -10
- package/dist/lean-kernel/legacy-family-order.d.ts +1 -0
- package/dist/lean-kernel/legacy-family-order.js +26 -0
- package/dist/lean-kernel/library.js +22 -0
- package/dist/lean-kernel/lift/counted-source-data.d.ts +7 -0
- package/dist/lean-kernel/lift/counted-source-data.js +78 -0
- package/dist/lean-kernel/lift/index.d.ts +82 -0
- package/dist/lean-kernel/lift/index.js +116 -0
- package/dist/lean-kernel/lift/project.d.ts +4 -0
- package/dist/lean-kernel/lift/project.js +15 -0
- package/dist/lean-kernel/lift/proof-capture.d.ts +104 -0
- package/dist/lean-kernel/lift/proof-capture.js +216 -0
- package/dist/lean-kernel/lift/proof-codec.d.ts +28 -0
- package/dist/lean-kernel/lift/proof-codec.js +299 -0
- package/dist/lean-kernel/lift/proof-counted-source.d.ts +16 -0
- package/dist/lean-kernel/lift/proof-counted-source.js +68 -0
- package/dist/lean-kernel/lift/proof-frontier.d.ts +19 -0
- package/dist/lean-kernel/lift/proof-frontier.js +153 -0
- package/dist/lean-kernel/lift/proof-graph.d.ts +17 -0
- package/dist/lean-kernel/lift/proof-graph.js +130 -0
- package/dist/lean-kernel/lift/proof-parts.d.ts +29 -0
- package/dist/lean-kernel/lift/proof-parts.js +131 -0
- package/dist/lean-kernel/lift/proof-prelude.d.ts +2 -0
- package/dist/lean-kernel/lift/proof-prelude.js +38 -0
- package/dist/lean-kernel/lift/proof-witness.d.ts +30 -0
- package/dist/lean-kernel/lift/proof-witness.js +283 -0
- package/dist/lean-kernel/lift/shape.d.ts +5 -0
- package/dist/lean-kernel/lift/shape.js +57 -0
- package/dist/lean-kernel/lift/source-projection.d.ts +16 -0
- package/dist/lean-kernel/lift/source-projection.js +81 -0
- package/dist/lean-kernel/lift/source.d.ts +23 -0
- package/dist/lean-kernel/lift/source.js +111 -0
- package/dist/lean-kernel/lift/witness-alpha.d.ts +9 -0
- package/dist/lean-kernel/lift/witness-alpha.js +31 -0
- package/dist/lean-kernel/lift-legacy.d.ts +58 -0
- package/dist/lean-kernel/lift-legacy.js +84 -0
- package/dist/lean-kernel/lift-names.d.ts +22 -0
- package/dist/lean-kernel/lift-names.js +36 -0
- package/dist/lean-kernel/lift-simulation/index.d.ts +29 -0
- package/dist/lean-kernel/lift-simulation/index.js +352 -0
- package/dist/lean-kernel/lift-simulation/shape.d.ts +41 -0
- package/dist/lean-kernel/lift-simulation/shape.js +173 -0
- package/dist/lean-kernel/lift-special/index.d.ts +36 -0
- package/dist/lean-kernel/lift-special/index.js +241 -0
- package/dist/lean-kernel/lift-special/structural.d.ts +25 -0
- package/dist/lean-kernel/lift-special/structural.js +126 -0
- package/dist/lean-kernel/lift-typed/index.d.ts +35 -0
- package/dist/lean-kernel/lift-typed/index.js +256 -0
- package/dist/lean-kernel/lift-typed/roles.d.ts +17 -0
- package/dist/lean-kernel/lift-typed/roles.js +170 -0
- package/dist/lean-kernel/lift-typed/shape.d.ts +1 -0
- package/dist/lean-kernel/lift-typed/shape.js +12 -0
- package/dist/lean-kernel/lift.d.ts +30 -0
- package/dist/lean-kernel/lift.js +97 -0
- package/package.json +5 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type NativeBundle } from './proof-capture.js';
|
|
2
|
+
export type GenericLiftRoute = 'alpha' | 'counted' | 'witness';
|
|
3
|
+
/** Dispatch on retained family/provenance and source semantics, never identity. */
|
|
4
|
+
export declare function selectGenericLiftRoute(bundle: NativeBundle): GenericLiftRoute;
|
|
5
|
+
export declare function assertGenericBridgeShape(bundle: NativeBundle, route: GenericLiftRoute): void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { inspectProvenance } from "./proof-capture.js";
|
|
2
|
+
import { proposeWitnessAlpha } from "./witness-alpha.js";
|
|
3
|
+
import { sourceStructure } from "./source.js";
|
|
4
|
+
/** Dispatch on retained family/provenance and source semantics, never identity. */
|
|
5
|
+
export function selectGenericLiftRoute(bundle) {
|
|
6
|
+
if (bundle.verdict?.proven !== true || bundle.verdict.checked !== true)
|
|
7
|
+
throw Error('unsupported unverified capsule');
|
|
8
|
+
const source = bundle.original?.machine, laws = bundle.original?.laws;
|
|
9
|
+
if (!source || !Array.isArray(laws) || !laws.length)
|
|
10
|
+
throw Error('unsupported empty source');
|
|
11
|
+
if (source.history || Object.keys(source.sums ?? {}).length || Object.keys(source.fns ?? {}).length)
|
|
12
|
+
throw Error('unsupported source history/sums/functions: separate semantic transport required');
|
|
13
|
+
if (bundle.schema === 'bapa-family/v1' && bundle.route === 'counted-family') {
|
|
14
|
+
if (!bundle.final || bundle.final.phase !== 'closed-family' || bundle.final.checked !== true || !Object.keys(bundle.final.machine.counts ?? {}).length)
|
|
15
|
+
throw Error('unsupported counted capsule without a complete counted family');
|
|
16
|
+
if (laws.some(l => l.some !== undefined || l.ex !== undefined || l.witness !== undefined || l.stated !== undefined || l.finite !== undefined))
|
|
17
|
+
throw Error('unsupported counted existential/restated source: separate semantic transport required');
|
|
18
|
+
return 'counted';
|
|
19
|
+
}
|
|
20
|
+
if (bundle.schema !== 'bapa-proof/v1')
|
|
21
|
+
throw Error('unsupported capsule schema/route');
|
|
22
|
+
const found = inspectProvenance(bundle.proof);
|
|
23
|
+
if (found.route !== bundle.route)
|
|
24
|
+
throw Error('capsule route differs from retained shape');
|
|
25
|
+
if (found.route === 'witness' || laws.some(l => l.some !== undefined || l.ex !== undefined || l.witness !== undefined)) {
|
|
26
|
+
if (found.route !== 'witness' || found.counted.length)
|
|
27
|
+
throw Error('unsupported existential source without a retained usual witness family');
|
|
28
|
+
return 'witness';
|
|
29
|
+
}
|
|
30
|
+
if (found.counted.length || found.usual.length !== 1 || !['plain', 'inferred'].includes(found.route))
|
|
31
|
+
throw Error('unsupported mixed/ambiguous source family');
|
|
32
|
+
if (Object.keys(source.counts ?? {}).length || Object.keys(found.usual[0].machine.counts ?? {}).length || laws.some(l => l.stated !== undefined || l.finite !== undefined))
|
|
33
|
+
throw Error('unsupported source shape: separate semantic transport required');
|
|
34
|
+
return 'alpha';
|
|
35
|
+
}
|
|
36
|
+
// This syntactic preflight prevents emitting a project for unrelated machine
|
|
37
|
+
// transformations. The emitted QAlpha/RowAlpha proofs remain authoritative.
|
|
38
|
+
export function assertGenericBridgeShape(bundle, route) {
|
|
39
|
+
if (route === 'witness')
|
|
40
|
+
return; // The witness exporter checks every context and parent.
|
|
41
|
+
const source = bundle.original.machine;
|
|
42
|
+
const producer = bundle.route === 'counted-family' ? bundle.final.machine : inspectProvenance(bundle.proof).usual[0].machine;
|
|
43
|
+
const normalize = (m) => JSON.parse(sourceStructure({ ...m,
|
|
44
|
+
maps: m.maps ?? {}, step: { ...m.step, maps: m.step.maps ?? {} },
|
|
45
|
+
...(route === 'counted' ? { counts: undefined } : {}) }));
|
|
46
|
+
if (route === 'counted')
|
|
47
|
+
for (const [name, decl] of Object.entries(source.counts ?? {})) {
|
|
48
|
+
if (sourceStructure(decl) !== sourceStructure(producer.counts?.[name]))
|
|
49
|
+
throw Error('unsupported change to source count declaration: ' + name);
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
proposeWitnessAlpha(normalize(source), normalize(producer));
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw Error('unsupported source-to-family transformation; only exact/alpha rows and count augmentation are generic: ' + String(error));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Machine } from '../../core/machine.js';
|
|
2
|
+
import { type NativeBundle } from './proof-capture.js';
|
|
3
|
+
type Rename = {
|
|
4
|
+
flag: string;
|
|
5
|
+
old: string;
|
|
6
|
+
fresh: string;
|
|
7
|
+
};
|
|
8
|
+
type RowRename = {
|
|
9
|
+
map: string;
|
|
10
|
+
old: string;
|
|
11
|
+
fresh: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function alphaProposals(source: Machine, producer: Machine): Rename[];
|
|
14
|
+
export declare function rowAlphaProposals(source: Machine, producer: Machine): RowRename[];
|
|
15
|
+
export declare function emitAlphaSource(id: string, bundle: NativeBundle): string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { boundOf } from "../../kernel/kernel.js";
|
|
2
|
+
import { retainedSMachineToLean } from "../emit.js";
|
|
3
|
+
import { inspectProvenance, lawCoverage, qualifyProjection } from "./proof-capture.js";
|
|
4
|
+
export function alphaProposals(source, producer) {
|
|
5
|
+
const result = [];
|
|
6
|
+
for (const [flag, q] of Object.entries(source.step.flags ?? {})) {
|
|
7
|
+
const p = producer.step.flags?.[flag];
|
|
8
|
+
if (q.op !== 'all' || p?.op !== 'all')
|
|
9
|
+
continue;
|
|
10
|
+
const a = boundOf(q), b = boundOf(p);
|
|
11
|
+
if (a.length !== b.length)
|
|
12
|
+
throw Error(`quantified flag arity differs: ${flag}`);
|
|
13
|
+
for (let i = 0; i < a.length; i++)
|
|
14
|
+
if (a[i] !== b[i])
|
|
15
|
+
result.push({ flag, old: a[i], fresh: b[i] });
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
// Row updates have a separate local binder. Like quantified renames these are
|
|
20
|
+
// proposals only; RowAlpha checks capture avoidance and operational equivalence.
|
|
21
|
+
export function rowAlphaProposals(source, producer) {
|
|
22
|
+
const result = [];
|
|
23
|
+
for (const [map, w] of Object.entries(source.step.maps ?? {})) {
|
|
24
|
+
const p = producer.step.maps?.[map];
|
|
25
|
+
if ('each' in w && p && 'each' in p && w.each !== p.each)
|
|
26
|
+
result.push({ map, old: w.each, fresh: p.each });
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
// Caller must restore the capsule's term prelude first. This only accepts a
|
|
31
|
+
// plain family or an inferred family with an identical machine or proposed
|
|
32
|
+
// quantified-binder renames. The entire machine equality is still checked in
|
|
33
|
+
// Lean; a proposal is never source acceptance. Counted and witness routes remain separate.
|
|
34
|
+
export function emitAlphaSource(id, bundle) {
|
|
35
|
+
if (bundle.schema !== 'bapa-proof/v1' || !['plain', 'inferred'].includes(bundle.route) || !bundle.verdict.proven || !bundle.verdict.checked)
|
|
36
|
+
throw Error('alpha source projection requires a checked usual family');
|
|
37
|
+
const found = inspectProvenance(bundle.proof);
|
|
38
|
+
if (found.route !== bundle.route || found.counted.length || found.usual.length !== 1)
|
|
39
|
+
throw Error('alpha source projection requires one complete usual family');
|
|
40
|
+
const leaf = found.usual[0], source = bundle.original.machine, laws = bundle.original.laws;
|
|
41
|
+
if (source.history || source.sums && Object.keys(source.sums).length || Object.keys(source.fns ?? {}).length)
|
|
42
|
+
throw Error('source machine requires a separately qualified semantic route');
|
|
43
|
+
if (!laws.length || laws.some(l => l.stated !== undefined || l.some !== undefined || l.ex !== undefined || l.finite !== undefined || l.witness !== undefined))
|
|
44
|
+
throw Error('alpha source projection supports only nonempty ordinary public laws');
|
|
45
|
+
if (Object.keys(source.counts ?? {}).length || Object.keys(leaf.machine.counts ?? {}).length)
|
|
46
|
+
throw Error('counted source requires its own semantic bridge');
|
|
47
|
+
const indices = lawCoverage(laws, leaf.laws), rs = alphaProposals(source, leaf.machine), rows = rowAlphaProposals(source, leaf.machine);
|
|
48
|
+
if (bundle.route === 'inferred' && !rs.length && !rows.length && qualifyProjection(bundle.original, leaf.machine, leaf.laws).kind !== 'same-machine')
|
|
49
|
+
throw Error('inferred source projection requires the same source machine or proposed quantified-binder renames');
|
|
50
|
+
const free = [...new Set([...Object.values(source.step.flags ?? {}).flatMap(q => q.op === 'all' ? boundOf(q) : []), ...Object.values(source.step.maps ?? {}).flatMap(w => 'each' in w ? [w.each] : [])])];
|
|
51
|
+
return retainedSMachineToLean(id, leaf.machine, leaf.laws, leaf.proof, { free, after: (ix, mx, lit, c) => {
|
|
52
|
+
const renames = rs.map(r => `⟨${ix(`?${r.flag}`)}, ${ix(r.old)}, ${ix(r.fresh)}⟩`).join(', ');
|
|
53
|
+
const rowRenames = rows.map(r => `⟨${mx(r.map)}, ${ix(r.old)}, ${ix(r.fresh)}⟩`).join(', ');
|
|
54
|
+
const claims = laws.map((law, j) => {
|
|
55
|
+
const k = indices[j], keys = `[${(law.keys ?? []).map(ix).join(', ')}]`;
|
|
56
|
+
return `def ${id}_source_law${j} : MLaw := ⟨${c(law.holds)}, ${law.forall ? `some ${ix(law.forall)}` : 'none'}⟩
|
|
57
|
+
theorem ${id}_source_law${j}_eq : ${id}_source_law${j} = ${id}_e${k}.law := by rfl
|
|
58
|
+
theorem ${id}_source_keys${j}_eq : ${keys} = ${id}_e${k}.keys2 := by rfl
|
|
59
|
+
theorem ${id}_source_law${j}_holds (ρ M) (hr : SReach ${id}_source ρ M) : holdsOver ${id}_source_law${j} M ${keys} ρ := by
|
|
60
|
+
have hm : ${id}_e${k} ∈ ${id}_proof := by simp [${id}_proof]
|
|
61
|
+
have h := ${id}_source_laws ρ M hr ${id}_e${k} hm
|
|
62
|
+
simpa only [SEntry.Holds, ${id}_source_law${j}_eq, ${id}_source_keys${j}_eq] using h`;
|
|
63
|
+
}).join('\n');
|
|
64
|
+
return `def ${id}_source : SMachine := ${lit(source)}
|
|
65
|
+
def ${id}_source_renames : List Kern.QAlpha.Rename := [${renames}]
|
|
66
|
+
def ${id}_source_row_renames : List Kern.RowAlpha.Rename := [${rowRenames}]
|
|
67
|
+
theorem ${id}_alpha_valid : Kern.QAlpha.validAll ${id}_source ${id}_source_renames = true := by decide +kernel
|
|
68
|
+
theorem ${id}_row_valid : Kern.RowAlpha.validAll (Kern.QAlpha.renameAll ${id}_source ${id}_source_renames) ${id}_source_row_renames = true := by decide +kernel
|
|
69
|
+
theorem ${id}_alpha_result : Kern.RowAlpha.renameAll (Kern.QAlpha.renameAll ${id}_source ${id}_source_renames) ${id}_source_row_renames = ${id}_machine := by rfl
|
|
70
|
+
theorem ${id}_source_laws : ∀ ρ M, SReach ${id}_source ρ M → ∀ e ∈ ${id}_proof, e.Holds ρ M := by
|
|
71
|
+
intro ρ M hr e he
|
|
72
|
+
have eqv := Kern.QAlpha.renameAll_equiv ${id}_source ${id}_source_renames ${id}_alpha_valid
|
|
73
|
+
have hp : SReach ${id}_machine ρ M := by
|
|
74
|
+
rw [← ${id}_alpha_result]
|
|
75
|
+
have row := Kern.RowAlpha.renameAll_equiv (Kern.QAlpha.renameAll ${id}_source ${id}_source_renames) ${id}_source_row_renames ${id}_row_valid
|
|
76
|
+
exact row.symm.sreach_imp (eqv.symm.sreach_imp hr)
|
|
77
|
+
exact ${id}_laws ρ M hp e he
|
|
78
|
+
${claims}
|
|
79
|
+
#print axioms ${id}_row_valid`;
|
|
80
|
+
} });
|
|
81
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Machine, Law } from '../../core/machine.js';
|
|
2
|
+
import type { NativeBundle } from './proof-capture.js';
|
|
3
|
+
export type LiftTheoremNames = {
|
|
4
|
+
family: string;
|
|
5
|
+
source: string[];
|
|
6
|
+
};
|
|
7
|
+
export type GenericLiftSource = {
|
|
8
|
+
schema: 'gdp-lift-source/v1';
|
|
9
|
+
id: string;
|
|
10
|
+
machine: Machine;
|
|
11
|
+
laws: Law[];
|
|
12
|
+
theorems?: LiftTheoremNames;
|
|
13
|
+
};
|
|
14
|
+
export declare const sha256: (data: string | Uint8Array) => string;
|
|
15
|
+
export declare function sourceStructure(value: unknown): string;
|
|
16
|
+
export declare function readBoundedData(path: string, maxBytes: number): Uint8Array;
|
|
17
|
+
export declare function dataText(bytes: Uint8Array): string;
|
|
18
|
+
export declare function readLiftSource(path: string, maxBytes?: number): {
|
|
19
|
+
source: GenericLiftSource;
|
|
20
|
+
sourceSha256: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function assertSourceMatches(source: GenericLiftSource, bundle: NativeBundle): void;
|
|
23
|
+
export declare function sourceLeanId(id: string): string;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { lstatSync, readFileSync } from 'node:fs';
|
|
4
|
+
export const sha256 = (data) => createHash('sha256').update(data).digest('hex');
|
|
5
|
+
// JSON cannot retain functions, accessors, cycles, sparse arrays, IEEE special
|
|
6
|
+
// values or object identity. Reject those, rather than silently dropping them.
|
|
7
|
+
// Undefined OPTIONAL OBJECT members are the sole normalization: JSON has no
|
|
8
|
+
// spelling for them. All other AST and metadata keys participate in equality.
|
|
9
|
+
export function sourceStructure(value) {
|
|
10
|
+
const active = new Set();
|
|
11
|
+
let nodes = 0;
|
|
12
|
+
const visit = (v, depth) => {
|
|
13
|
+
if (++nodes > 2000000 || depth > 512)
|
|
14
|
+
throw Error('source structure limit exceeded');
|
|
15
|
+
if (v === null || typeof v === 'string' || typeof v === 'boolean')
|
|
16
|
+
return JSON.stringify(v);
|
|
17
|
+
if (typeof v === 'number') {
|
|
18
|
+
if (!Number.isFinite(v) || Object.is(v, -0))
|
|
19
|
+
throw Error('source JSON cannot represent this number exactly');
|
|
20
|
+
return JSON.stringify(v);
|
|
21
|
+
}
|
|
22
|
+
if (!v || typeof v !== 'object')
|
|
23
|
+
throw Error('source JSON cannot represent functions or non-data values');
|
|
24
|
+
if (active.has(v))
|
|
25
|
+
throw Error('source JSON cannot represent cycles');
|
|
26
|
+
const proto = Object.getPrototypeOf(v);
|
|
27
|
+
if (proto !== Object.prototype && proto !== null && proto !== Array.prototype)
|
|
28
|
+
throw Error('source JSON cannot represent this prototype');
|
|
29
|
+
active.add(v);
|
|
30
|
+
try {
|
|
31
|
+
if (Array.isArray(v)) {
|
|
32
|
+
if (Reflect.ownKeys(v).some(k => k !== 'length' && (typeof k !== 'string' || !/^\d+$/.test(k) || Number(k) >= v.length)))
|
|
33
|
+
throw Error('source array has non-JSON metadata');
|
|
34
|
+
const items = [];
|
|
35
|
+
for (let i = 0; i < v.length; i++) {
|
|
36
|
+
const d = Object.getOwnPropertyDescriptor(v, String(i));
|
|
37
|
+
if (!d || !('value' in d))
|
|
38
|
+
throw Error('source JSON cannot represent sparse/accessor arrays');
|
|
39
|
+
items.push(visit(d.value, depth + 1));
|
|
40
|
+
}
|
|
41
|
+
return '[' + items.join(',') + ']';
|
|
42
|
+
}
|
|
43
|
+
const entries = [];
|
|
44
|
+
for (const key of Reflect.ownKeys(v)) {
|
|
45
|
+
if (typeof key !== 'string')
|
|
46
|
+
throw Error('source JSON cannot represent symbol metadata');
|
|
47
|
+
const d = Object.getOwnPropertyDescriptor(v, key);
|
|
48
|
+
if (!('value' in d))
|
|
49
|
+
throw Error('source JSON cannot represent accessors');
|
|
50
|
+
if (!d.enumerable)
|
|
51
|
+
throw Error('source JSON cannot represent hidden metadata');
|
|
52
|
+
if (d.value !== undefined)
|
|
53
|
+
entries.push([key, d.value]);
|
|
54
|
+
}
|
|
55
|
+
entries.sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
56
|
+
return '{' + entries.map(([k, x]) => JSON.stringify(k) + ':' + visit(x, depth + 1)).join(',') + '}';
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
active.delete(v);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return visit(value, 0);
|
|
63
|
+
}
|
|
64
|
+
export function readBoundedData(path, maxBytes) {
|
|
65
|
+
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1)
|
|
66
|
+
throw Error('finite positive file limit required');
|
|
67
|
+
const stat = lstatSync(path);
|
|
68
|
+
if (!stat.isFile() || stat.size > maxBytes)
|
|
69
|
+
throw Error('invalid or oversized data file: ' + path);
|
|
70
|
+
const bytes = readFileSync(path);
|
|
71
|
+
if (bytes.length !== stat.size || bytes.length > maxBytes)
|
|
72
|
+
throw Error('data file changed: ' + path);
|
|
73
|
+
return bytes;
|
|
74
|
+
}
|
|
75
|
+
// Match Buffer's UTF-8 decoding, including retaining a leading BOM for JSON
|
|
76
|
+
// to reject. Only portable byte-array/string types cross this module boundary.
|
|
77
|
+
export function dataText(bytes) {
|
|
78
|
+
return new TextDecoder('utf-8', { ignoreBOM: true }).decode(bytes);
|
|
79
|
+
}
|
|
80
|
+
export function readLiftSource(path, maxBytes = 64 * 1024 * 1024) {
|
|
81
|
+
const bytes = readBoundedData(path, maxBytes), input = JSON.parse(dataText(bytes));
|
|
82
|
+
if (!input || typeof input !== 'object' || Array.isArray(input))
|
|
83
|
+
throw Error('expected gdp-lift-source/v1 JSON object');
|
|
84
|
+
const source = input;
|
|
85
|
+
if (Object.keys(source).filter(k => k !== 'theorems').sort().join(',') !== 'id,laws,machine,schema' || source.schema !== 'gdp-lift-source/v1' || typeof source.id !== 'string' || !/^[A-Za-z][A-Za-z0-9_]*$/.test(source.id) || source.id.length > 75)
|
|
86
|
+
throw Error('invalid gdp-lift-source/v1 envelope');
|
|
87
|
+
const m = source.machine;
|
|
88
|
+
if (!m || typeof m !== 'object' || Array.isArray(m) || typeof m.name !== 'string' || !Array.isArray(m.params) || !Array.isArray(m.inputs) || !m.state || typeof m.state !== 'object' || !m.step || typeof m.step !== 'object' || !Array.isArray(source.laws) || !source.laws.length)
|
|
89
|
+
throw Error('invalid source machine or nonempty laws');
|
|
90
|
+
sourceStructure({ machine: m, laws: source.laws });
|
|
91
|
+
if (source.theorems !== undefined) {
|
|
92
|
+
const names = source.theorems;
|
|
93
|
+
if (!names || typeof names !== 'object' || Array.isArray(names) || Object.keys(names).sort().join(',') !== 'family,source' || !Array.isArray(names.source) || names.source.length !== source.laws.length)
|
|
94
|
+
throw Error('invalid output theorem naming contract');
|
|
95
|
+
const all = [names.family, ...names.source];
|
|
96
|
+
if (all.some(n => typeof n !== 'string' || !/^(?:[A-Za-z_][A-Za-z0-9_']*\.)*[A-Za-z_][A-Za-z0-9_']*$/.test(n)) || new Set(all).size !== all.length)
|
|
97
|
+
throw Error('invalid or duplicate output theorem name');
|
|
98
|
+
}
|
|
99
|
+
if (Object.keys(m.fns ?? {}).length)
|
|
100
|
+
throw Error('source functions are unsupported; no function deserialization');
|
|
101
|
+
return { source, sourceSha256: sha256(bytes) };
|
|
102
|
+
}
|
|
103
|
+
export function assertSourceMatches(source, bundle) {
|
|
104
|
+
if (sourceStructure({ machine: source.machine, laws: source.laws }) !== sourceStructure(bundle.original))
|
|
105
|
+
throw Error('source machine/law AST or metadata differs from capsule original');
|
|
106
|
+
}
|
|
107
|
+
export function sourceLeanId(id) {
|
|
108
|
+
if (!/^[A-Za-z][A-Za-z0-9_]*$/.test(id) || id.length > 75)
|
|
109
|
+
throw Error('unsafe source identifier (max 75 characters, for the 80-character bapa_ name bound)');
|
|
110
|
+
return 'bapa_' + id;
|
|
111
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Machine } from '../../core/machine.js';
|
|
2
|
+
import { alphaProposals, rowAlphaProposals } from './source-projection.js';
|
|
3
|
+
export type WitnessAlpha = {
|
|
4
|
+
sourceSha256: string;
|
|
5
|
+
producerSourceSha256: string;
|
|
6
|
+
renames: ReturnType<typeof alphaProposals>;
|
|
7
|
+
rows: ReturnType<typeof rowAlphaProposals>;
|
|
8
|
+
};
|
|
9
|
+
export declare function proposeWitnessAlpha(source: Machine, producer: Machine): WitnessAlpha | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Syntactic preflight only. Equivalence is established by QAlpha/RowAlpha in
|
|
2
|
+
// emitted Lean, never by this proposal or by equality of hashes alone.
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
5
|
+
import { substC, substE } from "../../kernel/kernel.js";
|
|
6
|
+
import { alphaProposals, rowAlphaProposals } from "./source-projection.js";
|
|
7
|
+
const sha = (m) => createHash('sha256').update(JSON.stringify(m)).digest('hex');
|
|
8
|
+
export function proposeWitnessAlpha(source, producer) {
|
|
9
|
+
if (isDeepStrictEqual(source, producer) && sha(source) === sha(producer))
|
|
10
|
+
return undefined;
|
|
11
|
+
const renames = alphaProposals(source, producer), rows = rowAlphaProposals(source, producer);
|
|
12
|
+
let renamed = source;
|
|
13
|
+
const flags = Object.fromEntries(Object.keys(source.step.flags ?? {}).map(name => [name, { op: 'flag', name }]));
|
|
14
|
+
const sub = (old, fresh) => ({ vars: { [old]: { op: 'var', name: fresh } }, maps: {}, flags });
|
|
15
|
+
for (const r of renames) {
|
|
16
|
+
const q = renamed.step.flags?.[r.flag];
|
|
17
|
+
if (q?.op !== 'all')
|
|
18
|
+
throw Error('missing quantified alpha source');
|
|
19
|
+
const next = { ...q, key: q.key === r.old ? r.fresh : q.key, ...(q.keys ? { keys: q.keys.map(k => k === r.old ? r.fresh : k) } : {}), c: substC(q.c, sub(r.old, r.fresh)) };
|
|
20
|
+
renamed = { ...renamed, step: { ...renamed.step, flags: { ...renamed.step.flags, [r.flag]: next } } };
|
|
21
|
+
}
|
|
22
|
+
for (const r of rows) {
|
|
23
|
+
const w = renamed.step.maps?.[r.map];
|
|
24
|
+
if (!w || !('each' in w))
|
|
25
|
+
throw Error('missing row alpha source');
|
|
26
|
+
renamed = { ...renamed, step: { ...renamed.step, maps: { ...renamed.step.maps, [r.map]: { ...w, each: r.fresh, value: substE(w.value, sub(r.old, r.fresh)) } } } };
|
|
27
|
+
}
|
|
28
|
+
if ((!renames.length && !rows.length) || !isDeepStrictEqual(renamed, producer))
|
|
29
|
+
throw Error('witness source differs beyond bound-name alpha conversion');
|
|
30
|
+
return { sourceSha256: sha(source), producerSourceSha256: sha(producer), renames, rows };
|
|
31
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ClosedFamily, type FamilyBundle, type TermPrelude, type Verdict } from './lift/proof-capture.js';
|
|
2
|
+
import type { ProofOutputNode } from '../core/proof-output.js';
|
|
3
|
+
import { type GenericLiftSource } from './lift/source.js';
|
|
4
|
+
import { type GenericLiftOptions } from './lift/index.js';
|
|
5
|
+
export type LegacyIdentity = Readonly<Record<string, unknown> & {
|
|
6
|
+
protocol: string;
|
|
7
|
+
invocation: string;
|
|
8
|
+
sourceCommit: string;
|
|
9
|
+
sourceTree: string;
|
|
10
|
+
driverSha256: string;
|
|
11
|
+
inputSha256: string;
|
|
12
|
+
runtimeSha256: string;
|
|
13
|
+
profileSha256: string;
|
|
14
|
+
workNumerator: string;
|
|
15
|
+
workDenominator: string;
|
|
16
|
+
flags: Readonly<Record<string, string>>;
|
|
17
|
+
}>;
|
|
18
|
+
type LegacyCommon = {
|
|
19
|
+
identity: LegacyIdentity;
|
|
20
|
+
original: FamilyBundle['original'];
|
|
21
|
+
verdict: Verdict;
|
|
22
|
+
terms: TermPrelude;
|
|
23
|
+
};
|
|
24
|
+
export type LegacyBundle = LegacyCommon & ({
|
|
25
|
+
schema: 'final29-family/v1';
|
|
26
|
+
route: 'counted-family';
|
|
27
|
+
final: ClosedFamily;
|
|
28
|
+
publicLawIndices: number[] | null;
|
|
29
|
+
} | {
|
|
30
|
+
schema: 'final29-proof/v1';
|
|
31
|
+
route: 'plain' | 'inferred' | 'witness';
|
|
32
|
+
proof: ProofOutputNode;
|
|
33
|
+
});
|
|
34
|
+
export type LegacyCaptureManifest = {
|
|
35
|
+
schema: 'final29-native-certificate/v1';
|
|
36
|
+
complete: true;
|
|
37
|
+
route: LegacyBundle['route'];
|
|
38
|
+
identity: LegacyIdentity;
|
|
39
|
+
graphManifestSha256: string;
|
|
40
|
+
terms: number;
|
|
41
|
+
publicLawIndices?: number[] | null;
|
|
42
|
+
familyLaws?: number;
|
|
43
|
+
certificateKeys?: string[];
|
|
44
|
+
};
|
|
45
|
+
export type LegacyLiftInput = {
|
|
46
|
+
format: 'legacy';
|
|
47
|
+
manifest: LegacyCaptureManifest;
|
|
48
|
+
bundle: LegacyBundle;
|
|
49
|
+
metadata: [object, unknown][];
|
|
50
|
+
source: GenericLiftSource;
|
|
51
|
+
sourceSha256: string;
|
|
52
|
+
capsuleSha256: string;
|
|
53
|
+
};
|
|
54
|
+
export declare function validateLegacyManifest(value: unknown): LegacyCaptureManifest;
|
|
55
|
+
/** Does not restore terms, execute source, search, or reinterpret the schema. */
|
|
56
|
+
export declare function validateLegacyEnvelope(manifest: LegacyCaptureManifest, value: unknown): LegacyBundle;
|
|
57
|
+
export declare function readLegacyLiftInput(capsuleDirectory: string, sourceFile: string, options?: GenericLiftOptions): LegacyLiftInput;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
// Strict, data-only import of historical final29 capsules. Keep their schema and
|
|
3
|
+
// identity verbatim; only the checked structural proof data is shared with lifts.
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { readCertificateGraph } from "./lift/proof-codec.js";
|
|
6
|
+
import { inspectProvenance, retainedLawCoverage } from "./lift/proof-capture.js";
|
|
7
|
+
import { readBoundedData, dataText, readLiftSource, sha256, sourceStructure } from "./lift/source.js";
|
|
8
|
+
import { defaultReadLimits } from "./lift/index.js";
|
|
9
|
+
const object = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
10
|
+
const hash = (v) => typeof v === 'string' && /^[0-9a-f]{64}$/.test(v);
|
|
11
|
+
const same = (a, b) => sourceStructure(a) === sourceStructure(b);
|
|
12
|
+
function identity(value) {
|
|
13
|
+
if (!object(value))
|
|
14
|
+
throw Error('invalid historical capture identity');
|
|
15
|
+
for (const key of ['protocol', 'invocation'])
|
|
16
|
+
if (typeof value[key] !== 'string' || !value[key])
|
|
17
|
+
throw Error('missing historical identity ' + key);
|
|
18
|
+
for (const key of ['sourceCommit', 'sourceTree'])
|
|
19
|
+
if (typeof value[key] !== 'string' || !/^[0-9a-f]{40}$/.test(value[key]))
|
|
20
|
+
throw Error('invalid historical identity ' + key);
|
|
21
|
+
for (const key of ['driverSha256', 'inputSha256', 'runtimeSha256', 'profileSha256'])
|
|
22
|
+
if (!hash(value[key]))
|
|
23
|
+
throw Error('invalid historical identity ' + key);
|
|
24
|
+
if (typeof value.workNumerator !== 'string' || !/^(0|[1-9][0-9]*)$/.test(value.workNumerator) || typeof value.workDenominator !== 'string' || !/^[1-9][0-9]*$/.test(value.workDenominator))
|
|
25
|
+
throw Error('invalid historical work fraction');
|
|
26
|
+
if (!object(value.flags) || Object.values(value.flags).some(v => typeof v !== 'string'))
|
|
27
|
+
throw Error('invalid historical flag closure');
|
|
28
|
+
sourceStructure(value);
|
|
29
|
+
}
|
|
30
|
+
export function validateLegacyManifest(value) {
|
|
31
|
+
if (!object(value) || value.schema !== 'final29-native-certificate/v1' || value.complete !== true || !['counted-family', 'plain', 'inferred', 'witness'].includes(String(value.route)))
|
|
32
|
+
throw Error('incomplete or unsupported historical capsule');
|
|
33
|
+
identity(value.identity);
|
|
34
|
+
if (!hash(value.graphManifestSha256) || !Number.isSafeInteger(value.terms) || Number(value.terms) < 0)
|
|
35
|
+
throw Error('invalid historical graph or term binding');
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
/** Does not restore terms, execute source, search, or reinterpret the schema. */
|
|
39
|
+
export function validateLegacyEnvelope(manifest, value) {
|
|
40
|
+
if (!object(value) || value.route !== manifest.route || !same(value.identity, manifest.identity) || !object(value.verdict) || value.verdict.proven !== true || value.verdict.checked !== true)
|
|
41
|
+
throw Error('historical capture envelope mismatch');
|
|
42
|
+
if (!object(value.terms) || !Array.isArray(value.terms.terms) || !Array.isArray(value.terms.identities) || value.terms.terms.length !== manifest.terms || value.terms.identities.length !== manifest.terms)
|
|
43
|
+
throw Error('historical term table mismatch');
|
|
44
|
+
const ids = new Set();
|
|
45
|
+
for (const [i, pair] of value.terms.identities.entries()) {
|
|
46
|
+
if (!Array.isArray(pair) || pair.length !== 2 || typeof pair[0] !== 'string' || pair[1] !== i || ids.has(pair[0]))
|
|
47
|
+
throw Error('noncanonical historical term identities');
|
|
48
|
+
ids.add(pair[0]);
|
|
49
|
+
}
|
|
50
|
+
if (!object(value.original) || !object(value.original.machine) || !Array.isArray(value.original.laws) || !value.original.laws.length)
|
|
51
|
+
throw Error('missing historical public source');
|
|
52
|
+
sourceStructure(value.original);
|
|
53
|
+
if (manifest.route === 'counted-family') {
|
|
54
|
+
if (value.schema !== 'final29-family/v1' || !object(value.final) || value.final.phase !== 'closed-family' || value.final.checked !== true || !object(value.final.machine) || !Array.isArray(value.final.laws) || !value.final.laws.length || !object(value.final.proof) || !object(value.final.proof.certs) || !object(value.final.proof.instances))
|
|
55
|
+
throw Error('incomplete historical counted family');
|
|
56
|
+
const bundle = value, f = bundle.final;
|
|
57
|
+
if (f.laws.length !== manifest.familyLaws || !Array.isArray(manifest.certificateKeys) || !same(Object.keys(f.proof.certs), manifest.certificateKeys))
|
|
58
|
+
throw Error('historical family manifest mismatch');
|
|
59
|
+
if (f.laws.some(l => !l || typeof l.name !== 'string' || !l.name) || new Set(f.laws.map(l => l.name)).size !== f.laws.length)
|
|
60
|
+
throw Error('ambiguous historical law family');
|
|
61
|
+
const expected = f.laws.flatMap(l => [l.name + ' @start', l.name + ' @step']);
|
|
62
|
+
if (expected.length !== manifest.certificateKeys.length || expected.some(k => !Object.hasOwn(f.proof.certs, k)))
|
|
63
|
+
throw Error('incomplete historical primary obligations');
|
|
64
|
+
if (!Object.hasOwn(manifest, 'publicLawIndices') || !Object.hasOwn(value, 'publicLawIndices') || !same(value.publicLawIndices, manifest.publicLawIndices) || !same(retainedLawCoverage(bundle.original.laws, f.laws), manifest.publicLawIndices))
|
|
65
|
+
throw Error('historical public law coverage mismatch');
|
|
66
|
+
return bundle;
|
|
67
|
+
}
|
|
68
|
+
if (value.schema !== 'final29-proof/v1' || !object(value.proof))
|
|
69
|
+
throw Error('missing historical proof provenance');
|
|
70
|
+
const bundle = value;
|
|
71
|
+
if (inspectProvenance(bundle.proof).route !== manifest.route)
|
|
72
|
+
throw Error('historical provenance route mismatch');
|
|
73
|
+
return bundle;
|
|
74
|
+
}
|
|
75
|
+
export function readLegacyLiftInput(capsuleDirectory, sourceFile, options = {}) {
|
|
76
|
+
const bytes = readBoundedData(join(capsuleDirectory, 'CAPTURE.json'), 1024 * 1024), capsuleSha256 = sha256(bytes);
|
|
77
|
+
if (options.expectedManifestSha256 !== undefined && options.expectedManifestSha256 !== capsuleSha256)
|
|
78
|
+
throw Error('capture manifest binding mismatch');
|
|
79
|
+
const manifest = validateLegacyManifest(JSON.parse(dataText(bytes))), metadata = [];
|
|
80
|
+
const limits = { ...defaultReadLimits, ...options.limits };
|
|
81
|
+
const raw = readCertificateGraph(join(capsuleDirectory, 'graph'), manifest.graphManifestSha256, limits, (o, m) => metadata.push([o, m]));
|
|
82
|
+
const bundle = validateLegacyEnvelope(manifest, raw), { source, sourceSha256 } = readLiftSource(sourceFile, options.maxSourceBytes);
|
|
83
|
+
return { format: 'legacy', manifest, bundle, metadata, source, sourceSha256, capsuleSha256 };
|
|
84
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type LiftTheoremNames } from './lift/source.js';
|
|
2
|
+
export type LiftNamingSurface = {
|
|
3
|
+
familyTheorem: string;
|
|
4
|
+
sourceProjection: {
|
|
5
|
+
sourceTheorems: string[];
|
|
6
|
+
};
|
|
7
|
+
requiredTheorems: string[];
|
|
8
|
+
files: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
export type LiftAliases = {
|
|
11
|
+
family: {
|
|
12
|
+
name: string;
|
|
13
|
+
target: string;
|
|
14
|
+
};
|
|
15
|
+
source: {
|
|
16
|
+
name: string;
|
|
17
|
+
target: string;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
export declare function applyLiftTheoremNames<T extends LiftNamingSurface>(project: Record<string, string>, manifest: T, names?: LiftTheoremNames): T & {
|
|
21
|
+
theoremAliases?: LiftAliases;
|
|
22
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Optional output names never select a strategy or supply a proof body.
|
|
2
|
+
import { asked } from "./axiom-audit.js";
|
|
3
|
+
import { sha256 } from "./lift/source.js";
|
|
4
|
+
export function applyLiftTheoremNames(project, manifest, names) {
|
|
5
|
+
if (!names)
|
|
6
|
+
return manifest;
|
|
7
|
+
const valid = (name) => typeof name === 'string' && /^(?:[A-Za-z_][A-Za-z0-9_']*\.)*[A-Za-z_][A-Za-z0-9_']*$/.test(name);
|
|
8
|
+
const requested = [names.family, ...names.source];
|
|
9
|
+
if (names.source.length !== manifest.sourceProjection.sourceTheorems.length || requested.some(n => !valid(n)) || new Set(requested).size !== requested.length)
|
|
10
|
+
throw Error('invalid output theorem naming contract');
|
|
11
|
+
const aliases = { family: { name: names.family, target: manifest.familyTheorem }, source: names.source.map((name, i) => ({ name, target: manifest.sourceProjection.sourceTheorems[i] })) };
|
|
12
|
+
const pairs = [aliases.family, ...aliases.source], known = new Set(manifest.requiredTheorems), root = project['BapaProof.lean'];
|
|
13
|
+
if (typeof root !== 'string' || pairs.some(p => !valid(p.target)))
|
|
14
|
+
throw Error('invalid generated theorem interface');
|
|
15
|
+
const additions = [];
|
|
16
|
+
for (const { name, target } of pairs) {
|
|
17
|
+
if (name === target)
|
|
18
|
+
continue;
|
|
19
|
+
// Existing generated aliases must have definitionally equal propositions;
|
|
20
|
+
// merely finding the requested name is not evidence of source equivalence.
|
|
21
|
+
if (known.has(name))
|
|
22
|
+
additions.push(`example : @${name} = @${target} := rfl`);
|
|
23
|
+
else {
|
|
24
|
+
additions.push(`abbrev ${name} := @${target}`);
|
|
25
|
+
known.add(name);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const printed = new Set(asked(root));
|
|
29
|
+
for (const name of requested)
|
|
30
|
+
if (!printed.has(name)) {
|
|
31
|
+
additions.push('#print axioms ' + name);
|
|
32
|
+
printed.add(name);
|
|
33
|
+
}
|
|
34
|
+
project['BapaProof.lean'] = root + '\n' + additions.join('\n') + '\n';
|
|
35
|
+
return { ...manifest, familyTheorem: names.family, sourceProjection: { ...manifest.sourceProjection, sourceTheorems: [...names.source] }, requiredTheorems: [...new Set([...manifest.requiredTheorems, ...requested])], files: Object.fromEntries(Object.entries(project).map(([name, text]) => [name, sha256(text)])), theoremAliases: aliases };
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PartOptions } from '../lift/proof-parts.js';
|
|
2
|
+
import type { GenericLiftSource } from '../lift/source.js';
|
|
3
|
+
import { type RadixSimulationBundle, type RadixShapePlan } from './shape.js';
|
|
4
|
+
export { planRadixSimulation, UnsupportedRadixSimulation } from './shape.js';
|
|
5
|
+
export type { RadixSimulationBundle, RadixShapePlan } from './shape.js';
|
|
6
|
+
export type RadixSimulationInput = {
|
|
7
|
+
id: string;
|
|
8
|
+
bundle: RadixSimulationBundle;
|
|
9
|
+
providedSourceAST: GenericLiftSource;
|
|
10
|
+
options: PartOptions;
|
|
11
|
+
};
|
|
12
|
+
export type RadixSimulationOutput = {
|
|
13
|
+
project: Record<string, string>;
|
|
14
|
+
familyTheorem: string;
|
|
15
|
+
sourceTheorems: string[];
|
|
16
|
+
publicLawIndices: number[];
|
|
17
|
+
requiredTheorems: string[];
|
|
18
|
+
kind: 'radix-simulation';
|
|
19
|
+
status: 'EMITTED_NOT_CHECKED';
|
|
20
|
+
parts: {
|
|
21
|
+
familySize: number;
|
|
22
|
+
primaryObligations: number;
|
|
23
|
+
};
|
|
24
|
+
plan: RadixShapePlan;
|
|
25
|
+
};
|
|
26
|
+
/** The caller validates the complete capsule graph and restores its terms
|
|
27
|
+
* exactly once before calling. This function never reads a capsule, restores
|
|
28
|
+
* terms, invokes Lean, searches, or consumes old generated proof files. */
|
|
29
|
+
export declare function tryRadixSimulation({ id, bundle, providedSourceAST: source, options }: RadixSimulationInput): RadixSimulationOutput | null;
|