gdp-wired 0.18.0 → 0.20.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/cycles.d.ts +23 -2
- package/dist/core/cycles.js +451 -51
- package/dist/core/cyclic.d.ts +105 -7
- package/dist/core/cyclic.js +800 -103
- package/dist/core/data.d.ts +61 -5
- package/dist/core/data.js +487 -113
- package/dist/core/discover.js +54 -33
- package/dist/core/dsl.d.ts +4 -2
- package/dist/core/dsl.js +47 -12
- package/dist/core/solver.d.ts +3 -0
- package/dist/core/solver.js +5 -0
- package/dist/core/translate.d.ts +30 -0
- package/dist/core/translate.js +578 -0
- package/dist/kernel/prove.d.ts +16 -0
- package/dist/kernel/prove.js +160 -13
- package/dist/lean-kernel/emit.d.ts +36 -1
- package/dist/lean-kernel/emit.js +527 -85
- package/dist/lean-kernel/library.js +2 -1
- package/package.json +1 -1
package/dist/core/cyclic.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { C, E, Law, Machine } from './machine.js';
|
|
2
|
-
import type { Fold, Goal, Instances } from '../kernel/kernel.js';
|
|
2
|
+
import type { Fold, Goal, Instances, StepLaw, Subst, Tree } from '../kernel/kernel.js';
|
|
3
3
|
import { type CNode, type Cyclic, type Fact, type Use } from '../kernel/cyclic.js';
|
|
4
|
+
import { type TStats } from './translate.js';
|
|
4
5
|
export type NodeSpec = Omit<CNode, 'uses' | 'main'> & {
|
|
5
6
|
uses: Omit<Use, 'premises' | 'descent'>[];
|
|
6
7
|
opaque?: E[];
|
|
7
8
|
variants?: NodeSpec[];
|
|
8
9
|
weak?: boolean;
|
|
9
10
|
slice?: boolean;
|
|
11
|
+
main?: Tree;
|
|
12
|
+
carry?: boolean | 'sliced';
|
|
10
13
|
};
|
|
11
14
|
export type CyclicVerdict = {
|
|
12
15
|
proven: true;
|
|
@@ -28,12 +31,19 @@ export declare const cyclicProf: Record<string, {
|
|
|
28
31
|
solveMs: number;
|
|
29
32
|
rowsMs: number;
|
|
30
33
|
}>;
|
|
34
|
+
export declare function timedKind<T>(kind: string, hyps: number, f: () => T): T;
|
|
31
35
|
export declare function reached(g: Goal, whole: (i: number) => boolean): Set<number>;
|
|
32
|
-
export declare function slice(g: Goal, whole: (i: number) => boolean): (Goal & {
|
|
36
|
+
export declare function slice(g: Goal, whole: (i: number) => boolean, hypsOnly?: false, join?: boolean): (Goal & {
|
|
33
37
|
from: number[][];
|
|
34
38
|
}) | undefined;
|
|
35
39
|
export declare function slice(g: Goal, whole: (i: number) => boolean, hypsOnly: true): Set<number>;
|
|
36
|
-
|
|
40
|
+
type Grown = Map<string, {
|
|
41
|
+
tree: Tree;
|
|
42
|
+
insts?: number[];
|
|
43
|
+
uses?: number[];
|
|
44
|
+
}>;
|
|
45
|
+
export declare const translatedCache: Grown;
|
|
46
|
+
export declare function proveCyclic(facts: Fact[], specs: NodeSpec[], order0?: number[], grownBefore?: Grown, st?: TStats, made?: CNode[]): CyclicVerdict;
|
|
37
47
|
export type RecurCase = {
|
|
38
48
|
name: string;
|
|
39
49
|
args: string[];
|
|
@@ -49,19 +59,107 @@ export type RecurCase = {
|
|
|
49
59
|
}[];
|
|
50
60
|
facts: Law[];
|
|
51
61
|
};
|
|
52
|
-
export
|
|
62
|
+
export type UsualProof = {
|
|
63
|
+
m: Machine;
|
|
64
|
+
laws: Law[];
|
|
65
|
+
proof: {
|
|
66
|
+
instances: Record<string, Instances>;
|
|
67
|
+
trees: Record<string, Tree>;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare function recurNodes(r: RecurCase, usual?: {
|
|
71
|
+
lemmas?: UsualProof;
|
|
72
|
+
between?: UsualProof;
|
|
73
|
+
}, st?: TStats): {
|
|
53
74
|
facts: Fact[];
|
|
54
75
|
specs: NodeSpec[];
|
|
76
|
+
why?: string;
|
|
55
77
|
};
|
|
56
78
|
export declare const cyclicMachine: (m: Machine, laws?: Law[]) => boolean;
|
|
57
|
-
export declare
|
|
79
|
+
export declare const uncoveredWhy: (m: Machine, laws?: Law[]) => string | undefined;
|
|
80
|
+
export type UsualStep = {
|
|
81
|
+
sl: StepLaw;
|
|
82
|
+
inst: Instances;
|
|
83
|
+
goal: Goal;
|
|
84
|
+
tree: Tree;
|
|
85
|
+
};
|
|
86
|
+
export declare function machineNodes(given: Machine, laws: Law[], instances: Record<string, Instances>, usual?: {
|
|
87
|
+
trees: Record<string, Tree>;
|
|
88
|
+
steps?: UsualStep[];
|
|
89
|
+
lawsMade?: boolean;
|
|
90
|
+
}, st?: TStats): {
|
|
91
|
+
facts: Fact[];
|
|
92
|
+
specs: NodeSpec[];
|
|
93
|
+
why?: string;
|
|
94
|
+
};
|
|
95
|
+
export declare const tBack: (n: number) => E;
|
|
96
|
+
export declare const tSub: (n: number) => E;
|
|
97
|
+
export declare function kStepAt(m: Machine, k: number, time?: (n: number) => E): Subst;
|
|
98
|
+
export declare const kWhens: (m: Machine, sl: StepLaw) => C[];
|
|
99
|
+
export declare function stepLawNodes(m: Machine, laws: Law[], steps: {
|
|
100
|
+
law: StepLaw;
|
|
101
|
+
instances: Instances;
|
|
102
|
+
}[], facts: Fact[], lawNodes: NodeSpec[], time?: (n: number) => E): NodeSpec[];
|
|
103
|
+
export declare function allowNode(m: Machine, laws: Law[], inst: Instances, w: C, facts: Fact[], lawNodes: NodeSpec[], name: string, extra?: NodeSpec['insts']): NodeSpec;
|
|
104
|
+
export declare function allowTranslated(given: Machine, laws: Law[], inst: Instances, p: {
|
|
105
|
+
when: C;
|
|
106
|
+
request: Record<string, E>;
|
|
107
|
+
}, usual: {
|
|
108
|
+
goal: Goal;
|
|
109
|
+
tree: Tree;
|
|
110
|
+
}, facts: Fact[], lawNodes: NodeSpec[], name: string, st: TStats): {
|
|
111
|
+
specs: NodeSpec[];
|
|
112
|
+
why?: string;
|
|
113
|
+
};
|
|
114
|
+
export declare const hasQuantified: (m: Machine) => boolean;
|
|
115
|
+
export declare function skMachine(m: Machine): Machine;
|
|
116
|
+
export declare function qflagFacts(m: Machine): Fact[];
|
|
117
|
+
export declare function closingInsts(m: Machine, facts: Fact[], insts: Instances[], times: E[], laws?: Law[]): NodeSpec['insts'];
|
|
118
|
+
export declare const qflagNodes: (m: Machine, laws: Law[], instances: Record<string, Instances>) => {
|
|
58
119
|
facts: Fact[];
|
|
59
120
|
specs: NodeSpec[];
|
|
121
|
+
why?: string;
|
|
60
122
|
};
|
|
61
|
-
export declare function foldNodes(f: Fold, laws: Law[]): {
|
|
123
|
+
export declare function foldNodes(f: Fold, laws: Law[], usual?: Record<string, Tree>, st?: TStats): {
|
|
62
124
|
facts: Fact[];
|
|
63
125
|
specs: NodeSpec[];
|
|
126
|
+
why?: string;
|
|
64
127
|
};
|
|
65
128
|
export declare const cyclicOn: () => boolean;
|
|
129
|
+
export declare const cycLog: (o: object) => void;
|
|
66
130
|
export declare const quietly: <T>(f: () => T) => T;
|
|
67
|
-
export
|
|
131
|
+
export type Translated = (st: TStats) => {
|
|
132
|
+
verdict?: CyclicVerdict;
|
|
133
|
+
why?: string;
|
|
134
|
+
};
|
|
135
|
+
export declare function translatedProof(key: () => string, build: (reused: boolean) => {
|
|
136
|
+
facts: Fact[];
|
|
137
|
+
specs: NodeSpec[];
|
|
138
|
+
why?: string;
|
|
139
|
+
}, st: TStats, base?: () => string): {
|
|
140
|
+
verdict?: CyclicVerdict;
|
|
141
|
+
why?: string;
|
|
142
|
+
};
|
|
143
|
+
export declare const routeOf: () => string;
|
|
144
|
+
export declare const translateMs: (usualMs?: number) => number;
|
|
145
|
+
export declare function crossCyclic(kind: string, name: string, usual: boolean, run0: (() => CyclicVerdict) | undefined, usualMs?: number, translated?: Translated): void;
|
|
146
|
+
export declare const certMode: () => boolean;
|
|
147
|
+
export declare const certOn: () => boolean;
|
|
148
|
+
export declare const certSearch: () => boolean;
|
|
149
|
+
export declare const certMs: () => number;
|
|
150
|
+
export declare const uncovered: (kind: string, name: string, why: string) => void;
|
|
151
|
+
export declare function certCyclic(kind: string, name: string, translated: Translated | undefined, run0: (() => CyclicVerdict) | undefined, usualMs?: number): {
|
|
152
|
+
checked: boolean;
|
|
153
|
+
proof?: Cyclic;
|
|
154
|
+
why: string;
|
|
155
|
+
};
|
|
156
|
+
export declare function searchedStepNodes(m: Machine, laws: Law[], steps: {
|
|
157
|
+
law: StepLaw;
|
|
158
|
+
instances: Instances;
|
|
159
|
+
}[], facts: Fact[], lawNodes: NodeSpec[]): NodeSpec[];
|
|
160
|
+
export declare const reqTS: (req: [string, E][]) => C;
|
|
161
|
+
export declare function withWitness<R>(m: Machine, request: Record<string, E>, attempt: (wit: [string, E][]) => R | undefined): {
|
|
162
|
+
wit: [string, E][];
|
|
163
|
+
out: R;
|
|
164
|
+
} | undefined;
|
|
165
|
+
export {};
|