gdp-wired 0.16.0 → 0.18.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 +10 -2
- package/dist/core/cycles.d.ts +73 -0
- package/dist/core/cycles.js +899 -0
- package/dist/core/cyclic.d.ts +67 -0
- package/dist/core/cyclic.js +740 -0
- package/dist/core/data.d.ts +258 -0
- package/dist/core/data.js +1858 -0
- package/dist/core/discover.js +7 -2
- package/dist/core/dsl.d.ts +7 -1
- package/dist/core/dsl.js +39 -6
- package/dist/core/infer.js +5 -1
- package/dist/kernel/cyclic.d.ts +45 -0
- package/dist/kernel/cyclic.js +54 -0
- package/dist/kernel/prove.d.ts +15 -0
- package/dist/kernel/prove.js +485 -5
- package/dist/lean-kernel/emit.d.ts +73 -0
- package/dist/lean-kernel/emit.js +250 -26
- package/dist/lean-kernel/library.js +3 -0
- package/package.json +14 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { C, E, Law, Machine } from './machine.js';
|
|
2
|
+
import type { Fold, Goal, Instances } from '../kernel/kernel.js';
|
|
3
|
+
import { type CNode, type Cyclic, type Fact, type Use } from '../kernel/cyclic.js';
|
|
4
|
+
export type NodeSpec = Omit<CNode, 'uses' | 'main'> & {
|
|
5
|
+
uses: Omit<Use, 'premises' | 'descent'>[];
|
|
6
|
+
opaque?: E[];
|
|
7
|
+
variants?: NodeSpec[];
|
|
8
|
+
weak?: boolean;
|
|
9
|
+
slice?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type CyclicVerdict = {
|
|
12
|
+
proven: true;
|
|
13
|
+
checked: boolean;
|
|
14
|
+
proof: Cyclic;
|
|
15
|
+
why?: string;
|
|
16
|
+
} | {
|
|
17
|
+
proven: false;
|
|
18
|
+
checked: false;
|
|
19
|
+
node: string;
|
|
20
|
+
goal: string;
|
|
21
|
+
stuck: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const pair: (u: E, key: E) => E;
|
|
24
|
+
export declare const cyclicProf: Record<string, {
|
|
25
|
+
ms: number;
|
|
26
|
+
n: number;
|
|
27
|
+
hyps: number;
|
|
28
|
+
solveMs: number;
|
|
29
|
+
rowsMs: number;
|
|
30
|
+
}>;
|
|
31
|
+
export declare function reached(g: Goal, whole: (i: number) => boolean): Set<number>;
|
|
32
|
+
export declare function slice(g: Goal, whole: (i: number) => boolean): (Goal & {
|
|
33
|
+
from: number[][];
|
|
34
|
+
}) | undefined;
|
|
35
|
+
export declare function slice(g: Goal, whole: (i: number) => boolean, hypsOnly: true): Set<number>;
|
|
36
|
+
export declare function proveCyclic(facts: Fact[], specs: NodeSpec[], order?: number[]): CyclicVerdict;
|
|
37
|
+
export type RecurCase = {
|
|
38
|
+
name: string;
|
|
39
|
+
args: string[];
|
|
40
|
+
zero: E;
|
|
41
|
+
next: E;
|
|
42
|
+
lemmas: {
|
|
43
|
+
name: string;
|
|
44
|
+
holds: C;
|
|
45
|
+
}[];
|
|
46
|
+
between: {
|
|
47
|
+
name: string;
|
|
48
|
+
holds: C;
|
|
49
|
+
}[];
|
|
50
|
+
facts: Law[];
|
|
51
|
+
};
|
|
52
|
+
export declare function recurNodes(r: RecurCase): {
|
|
53
|
+
facts: Fact[];
|
|
54
|
+
specs: NodeSpec[];
|
|
55
|
+
};
|
|
56
|
+
export declare const cyclicMachine: (m: Machine, laws?: Law[]) => boolean;
|
|
57
|
+
export declare function machineNodes(m: Machine, laws: Law[], instances: Record<string, Instances>): {
|
|
58
|
+
facts: Fact[];
|
|
59
|
+
specs: NodeSpec[];
|
|
60
|
+
};
|
|
61
|
+
export declare function foldNodes(f: Fold, laws: Law[]): {
|
|
62
|
+
facts: Fact[];
|
|
63
|
+
specs: NodeSpec[];
|
|
64
|
+
};
|
|
65
|
+
export declare const cyclicOn: () => boolean;
|
|
66
|
+
export declare const quietly: <T>(f: () => T) => T;
|
|
67
|
+
export declare function crossCyclic(kind: string, name: string, usual: boolean, run: () => CyclicVerdict, usualMs?: number): void;
|