gdp-wired 0.17.0 → 0.19.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.
@@ -1,8 +1,15 @@
1
1
  import type { C, E, Law, Machine } from './machine.js';
2
- import type { Fold, 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'>[];
7
+ opaque?: E[];
8
+ variants?: NodeSpec[];
9
+ weak?: boolean;
10
+ slice?: boolean;
11
+ main?: Tree;
12
+ carry?: boolean;
6
13
  };
7
14
  export type CyclicVerdict = {
8
15
  proven: true;
@@ -17,7 +24,26 @@ export type CyclicVerdict = {
17
24
  stuck: string;
18
25
  };
19
26
  export declare const pair: (u: E, key: E) => E;
20
- export declare function proveCyclic(facts: Fact[], specs: NodeSpec[]): CyclicVerdict;
27
+ export declare const cyclicProf: Record<string, {
28
+ ms: number;
29
+ n: number;
30
+ hyps: number;
31
+ solveMs: number;
32
+ rowsMs: number;
33
+ }>;
34
+ export declare function timedKind<T>(kind: string, hyps: number, f: () => T): T;
35
+ export declare function reached(g: Goal, whole: (i: number) => boolean): Set<number>;
36
+ export declare function slice(g: Goal, whole: (i: number) => boolean): (Goal & {
37
+ from: number[][];
38
+ }) | undefined;
39
+ export declare function slice(g: Goal, whole: (i: number) => boolean, hypsOnly: true): Set<number>;
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;
21
47
  export type RecurCase = {
22
48
  name: string;
23
49
  args: string[];
@@ -33,19 +59,93 @@ export type RecurCase = {
33
59
  }[];
34
60
  facts: Law[];
35
61
  };
36
- export declare function recurNodes(r: RecurCase): {
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): {
37
74
  facts: Fact[];
38
75
  specs: NodeSpec[];
76
+ why?: string;
39
77
  };
40
78
  export declare const cyclicMachine: (m: Machine, laws?: Law[]) => boolean;
41
- export declare function machineNodes(m: Machine, laws: Law[], instances: Record<string, Instances>): {
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(m: Machine, laws: Law[], instances: Record<string, Instances>, usual?: {
87
+ trees: Record<string, Tree>;
88
+ steps?: UsualStep[];
89
+ lawsMade?: boolean;
90
+ }, st?: TStats): {
42
91
  facts: Fact[];
43
92
  specs: NodeSpec[];
93
+ why?: string;
44
94
  };
45
- export declare function foldNodes(f: Fold, laws: Law[]): {
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 const hasQuantified: (m: Machine) => boolean;
105
+ export declare function skMachine(m: Machine): Machine;
106
+ export declare function qflagFacts(m: Machine): Fact[];
107
+ export declare function closingInsts(m: Machine, facts: Fact[], insts: Instances[], times: E[], laws?: Law[]): NodeSpec['insts'];
108
+ export declare function qflagNodes(m: Machine, laws: Law[], instances: Record<string, Instances>): {
46
109
  facts: Fact[];
47
110
  specs: NodeSpec[];
111
+ why?: string;
112
+ };
113
+ export declare function foldNodes(f: Fold, laws: Law[], usual?: Record<string, Tree>, st?: TStats): {
114
+ facts: Fact[];
115
+ specs: NodeSpec[];
116
+ why?: string;
48
117
  };
49
118
  export declare const cyclicOn: () => boolean;
119
+ export declare const cycLog: (o: object) => void;
50
120
  export declare const quietly: <T>(f: () => T) => T;
51
- export declare function crossCyclic(kind: string, name: string, usual: boolean, run: () => CyclicVerdict, usualMs?: number): void;
121
+ export type Translated = (st: TStats) => {
122
+ verdict?: CyclicVerdict;
123
+ why?: string;
124
+ };
125
+ export declare function translatedProof(key: () => string, build: (reused: boolean) => {
126
+ facts: Fact[];
127
+ specs: NodeSpec[];
128
+ why?: string;
129
+ }, st: TStats, base?: () => string): {
130
+ verdict?: CyclicVerdict;
131
+ why?: string;
132
+ };
133
+ export declare const routeOf: () => string;
134
+ export declare function crossCyclic(kind: string, name: string, usual: boolean, run0: (() => CyclicVerdict) | undefined, usualMs?: number, translated?: Translated): void;
135
+ export declare const certOn: () => boolean;
136
+ export declare const certSearch: () => boolean;
137
+ export declare const certMs: () => number;
138
+ export declare function certCyclic(kind: string, name: string, translated: Translated | undefined, run0: (() => CyclicVerdict) | undefined, usualMs?: number): {
139
+ checked: boolean;
140
+ proof?: Cyclic;
141
+ };
142
+ export declare function searchedStepNodes(m: Machine, laws: Law[], steps: {
143
+ law: StepLaw;
144
+ instances: Instances;
145
+ }[], facts: Fact[], lawNodes: NodeSpec[]): NodeSpec[];
146
+ export declare const reqTS: (req: [string, E][]) => C;
147
+ export declare function withWitness<R>(m: Machine, request: Record<string, E>, attempt: (wit: [string, E][]) => R | undefined): {
148
+ wit: [string, E][];
149
+ out: R;
150
+ } | undefined;
151
+ export {};