gdp-wired 0.47.0 → 0.48.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.
Files changed (170) hide show
  1. package/README.md +15 -4
  2. package/dist/core/carry.d.ts +15 -0
  3. package/dist/core/carry.js +651 -0
  4. package/dist/core/cli.d.ts +3 -1
  5. package/dist/core/cli.js +28 -8
  6. package/dist/core/count-cases.d.ts +24 -0
  7. package/dist/core/count-cases.js +320 -0
  8. package/dist/core/count-cert-grow.d.ts +4 -0
  9. package/dist/core/count-cert-grow.js +37 -0
  10. package/dist/core/count-cert-transport.d.ts +3 -0
  11. package/dist/core/count-cert-transport.js +58 -0
  12. package/dist/core/count-completion.d.ts +9 -0
  13. package/dist/core/count-completion.js +27 -0
  14. package/dist/core/count-cubes.d.ts +8 -0
  15. package/dist/core/count-cubes.js +69 -0
  16. package/dist/core/count-demand.d.ts +37 -0
  17. package/dist/core/count-demand.js +361 -0
  18. package/dist/core/count-facts.d.ts +52 -0
  19. package/dist/core/count-facts.js +247 -0
  20. package/dist/core/count-focus-proof.d.ts +8 -0
  21. package/dist/core/count-focus-proof.js +140 -0
  22. package/dist/core/count-focused.d.ts +22 -0
  23. package/dist/core/count-focused.js +676 -0
  24. package/dist/core/count-ranges.d.ts +5 -0
  25. package/dist/core/count-ranges.js +65 -0
  26. package/dist/core/count-recovery/action-guard.d.ts +5 -0
  27. package/dist/core/count-recovery/action-guard.js +51 -0
  28. package/dist/core/count-recovery/boolean-core.d.ts +16 -0
  29. package/dist/core/count-recovery/boolean-core.js +258 -0
  30. package/dist/core/count-recovery/carried-case.d.ts +2 -0
  31. package/dist/core/count-recovery/carried-case.js +24 -0
  32. package/dist/core/count-recovery/conditional-check-cache.d.ts +23 -0
  33. package/dist/core/count-recovery/conditional-check-cache.js +130 -0
  34. package/dist/core/count-recovery/conditional-cuts.d.ts +6 -0
  35. package/dist/core/count-recovery/conditional-cuts.js +318 -0
  36. package/dist/core/count-recovery/conditional-proof.d.ts +19 -0
  37. package/dist/core/count-recovery/conditional-proof.js +306 -0
  38. package/dist/core/count-recovery/derivability-closure.d.ts +14 -0
  39. package/dist/core/count-recovery/derivability-closure.js +533 -0
  40. package/dist/core/count-recovery/empty-count-source.d.ts +2 -0
  41. package/dist/core/count-recovery/empty-count-source.js +40 -0
  42. package/dist/core/count-recovery/field-bound-lemmas.d.ts +23 -0
  43. package/dist/core/count-recovery/field-bound-lemmas.js +640 -0
  44. package/dist/core/count-recovery/field-case.d.ts +5 -0
  45. package/dist/core/count-recovery/field-case.js +89 -0
  46. package/dist/core/count-recovery/field-demand.d.ts +46 -0
  47. package/dist/core/count-recovery/field-demand.js +47 -0
  48. package/dist/core/count-recovery/field-only.d.ts +3 -0
  49. package/dist/core/count-recovery/field-only.js +18 -0
  50. package/dist/core/count-recovery/fold-path.d.ts +6 -0
  51. package/dist/core/count-recovery/fold-path.js +35 -0
  52. package/dist/core/count-recovery/frame-lemmas.d.ts +9 -0
  53. package/dist/core/count-recovery/frame-lemmas.js +120 -0
  54. package/dist/core/count-recovery/guard-cases.d.ts +12 -0
  55. package/dist/core/count-recovery/guard-cases.js +138 -0
  56. package/dist/core/count-recovery/key-closure.d.ts +14 -0
  57. package/dist/core/count-recovery/key-closure.js +62 -0
  58. package/dist/core/count-recovery/leaf-allowance.d.ts +4 -0
  59. package/dist/core/count-recovery/leaf-allowance.js +7 -0
  60. package/dist/core/count-recovery/lift-count-proxies.d.ts +6 -0
  61. package/dist/core/count-recovery/lift-count-proxies.js +175 -0
  62. package/dist/core/count-recovery/live-dependencies.d.ts +6 -0
  63. package/dist/core/count-recovery/live-dependencies.js +76 -0
  64. package/dist/core/count-recovery/member-inclusions.d.ts +11 -0
  65. package/dist/core/count-recovery/member-inclusions.js +168 -0
  66. package/dist/core/count-recovery/member-premises.d.ts +29 -0
  67. package/dist/core/count-recovery/member-premises.js +114 -0
  68. package/dist/core/count-recovery/natural-cases.d.ts +6 -0
  69. package/dist/core/count-recovery/natural-cases.js +59 -0
  70. package/dist/core/count-recovery/ops.d.ts +6 -0
  71. package/dist/core/count-recovery/ops.js +8 -0
  72. package/dist/core/count-recovery/pre-state-source.d.ts +8 -0
  73. package/dist/core/count-recovery/pre-state-source.js +18 -0
  74. package/dist/core/count-recovery/rebase-path.d.ts +9 -0
  75. package/dist/core/count-recovery/rebase-path.js +70 -0
  76. package/dist/core/count-recovery/rename-proof.d.ts +2 -0
  77. package/dist/core/count-recovery/rename-proof.js +102 -0
  78. package/dist/core/count-recovery/row-cases.d.ts +16 -0
  79. package/dist/core/count-recovery/row-cases.js +291 -0
  80. package/dist/core/count-recovery/scalar-guards.d.ts +7 -0
  81. package/dist/core/count-recovery/scalar-guards.js +291 -0
  82. package/dist/core/count-recovery/source-memo.d.ts +12 -0
  83. package/dist/core/count-recovery/source-memo.js +67 -0
  84. package/dist/core/count-select.d.ts +16 -0
  85. package/dist/core/count-select.js +24 -0
  86. package/dist/core/count-support.d.ts +598 -0
  87. package/dist/core/count-support.js +2080 -0
  88. package/dist/core/count-unions.d.ts +2 -0
  89. package/dist/core/count-unions.js +139 -0
  90. package/dist/core/count-witness-flags.d.ts +9 -0
  91. package/dist/core/count-witness-flags.js +37 -0
  92. package/dist/core/count-write-frames.d.ts +12 -0
  93. package/dist/core/count-write-frames.js +206 -0
  94. package/dist/core/counts.d.ts +20 -2
  95. package/dist/core/counts.js +807 -156
  96. package/dist/core/dsl.d.ts +50 -6
  97. package/dist/core/dsl.js +307 -65
  98. package/dist/core/effect.js +8 -1
  99. package/dist/core/exists.d.ts +1 -1
  100. package/dist/core/exists.js +80 -15
  101. package/dist/core/extract-check.d.ts +7 -1
  102. package/dist/core/extract-check.js +130 -13
  103. package/dist/core/extract-read.d.ts +22 -8
  104. package/dist/core/extract-read.js +29 -11
  105. package/dist/core/extract-shapes.js +122 -41
  106. package/dist/core/extract-standalone.js +53 -9
  107. package/dist/core/extract.js +9 -3
  108. package/dist/core/field-laws.d.ts +2 -0
  109. package/dist/core/field-laws.js +100 -0
  110. package/dist/core/finite-frontiers.d.ts +5 -0
  111. package/dist/core/finite-frontiers.js +116 -0
  112. package/dist/core/finite-houdini.d.ts +52 -0
  113. package/dist/core/finite-houdini.js +460 -0
  114. package/dist/core/finite-model.d.ts +13 -0
  115. package/dist/core/finite-model.js +68 -0
  116. package/dist/core/finite-tiny.d.ts +72 -0
  117. package/dist/core/finite-tiny.js +1052 -0
  118. package/dist/core/infer.d.ts +1 -1
  119. package/dist/core/infer.js +32 -9
  120. package/dist/core/laws.d.ts +2 -1
  121. package/dist/core/laws.js +47 -14
  122. package/dist/core/lemma-cuts.d.ts +38 -0
  123. package/dist/core/lemma-cuts.js +365 -0
  124. package/dist/core/machine.d.ts +39 -2
  125. package/dist/core/machine.js +240 -35
  126. package/dist/core/mutate.d.ts +55 -0
  127. package/dist/core/mutate.js +210 -0
  128. package/dist/core/native-domain.d.ts +6 -0
  129. package/dist/core/native-domain.js +114 -0
  130. package/dist/core/native-law.d.ts +3 -0
  131. package/dist/core/native-law.js +174 -0
  132. package/dist/core/quorum-laws.d.ts +5 -0
  133. package/dist/core/quorum-laws.js +239 -0
  134. package/dist/core/relational.js +10 -2
  135. package/dist/core/relevance.d.ts +4 -0
  136. package/dist/core/relevance.js +79 -0
  137. package/dist/core/runtime-wall.d.ts +3 -0
  138. package/dist/core/runtime-wall.js +4 -0
  139. package/dist/core/sample-step.d.ts +16 -0
  140. package/dist/core/sample-step.js +28 -0
  141. package/dist/core/source-check.d.ts +44 -0
  142. package/dist/core/source-check.js +126 -0
  143. package/dist/core/source-diagnostic.d.ts +1 -0
  144. package/dist/core/source-diagnostic.js +34 -0
  145. package/dist/core/support-budget.d.ts +2 -0
  146. package/dist/core/support-budget.js +6 -0
  147. package/dist/core/system.js +2 -0
  148. package/dist/core/wall.d.ts +6 -0
  149. package/dist/core/wall.js +23 -0
  150. package/dist/core/watch.js +4 -0
  151. package/dist/kernel/cdcl.d.ts +4 -0
  152. package/dist/kernel/cdcl.js +20 -5
  153. package/dist/kernel/kernel.d.ts +10 -0
  154. package/dist/kernel/kernel.js +56 -3
  155. package/dist/kernel/model-sequence.d.ts +2 -2
  156. package/dist/kernel/model-sequence.js +4 -3
  157. package/dist/kernel/model-values.d.ts +2 -0
  158. package/dist/kernel/model-values.js +60 -0
  159. package/dist/kernel/prove.d.ts +10 -0
  160. package/dist/kernel/prove.js +56 -8
  161. package/dist/kernel/prover-rows.d.ts +29 -0
  162. package/dist/kernel/prover-rows.js +114 -0
  163. package/dist/lean-kernel/emit.d.ts +39 -2
  164. package/dist/lean-kernel/emit.js +136 -24
  165. package/dist/lean-kernel/lean-terms.d.ts +1 -0
  166. package/dist/lean-kernel/lean-terms.js +13 -5
  167. package/dist/lean-kernel/library.js +4 -0
  168. package/dist/lean-kernel/qalpha.d.ts +7 -0
  169. package/dist/lean-kernel/qalpha.js +40 -0
  170. package/package.json +5 -1
@@ -0,0 +1,598 @@
1
+ import { type C, type E, type Law, type Machine } from './machine.js';
2
+ import { type CountDecl, type CountInst, type CountCert, type Goal, type MapRead, type Instances } from '../kernel/kernel.js';
3
+ import { certFor } from './counts.js';
4
+ export declare class UnsupportedCountProposal extends Error {
5
+ }
6
+ export declare function countPoolKey(goal: Goal, decls: CountDecl[]): string;
7
+ export declare function countedInstanceSources(m: Machine, laws: Law[]): Set<string>;
8
+ export declare function readTuples(value: unknown, more?: () => boolean): [string, E][];
9
+ export declare const keyId: (e: E) => string;
10
+ export declare function candidateWork(): {
11
+ state: {
12
+ work: number;
13
+ limit: number;
14
+ exhausted: boolean;
15
+ deadline: boolean;
16
+ phases: {
17
+ phase: string;
18
+ work: number;
19
+ }[];
20
+ omittedPhases: number;
21
+ };
22
+ tick: () => boolean;
23
+ mark: (phase: string) => void;
24
+ };
25
+ export declare function grammarPool(goal: Goal, decls: CountDecl[], cap?: number, budget?: {
26
+ state: {
27
+ work: number;
28
+ limit: number;
29
+ exhausted: boolean;
30
+ deadline: boolean;
31
+ phases: {
32
+ phase: string;
33
+ work: number;
34
+ }[];
35
+ omittedPhases: number;
36
+ };
37
+ tick: () => boolean;
38
+ mark: (phase: string) => void;
39
+ }, structured?: boolean, m?: Machine): {
40
+ full: {
41
+ insts: CountInst[];
42
+ wits: string[];
43
+ reads: MapRead[];
44
+ picks: [string, E[]][];
45
+ loose: boolean;
46
+ };
47
+ base: {
48
+ reads: MapRead[];
49
+ insts: CountInst[];
50
+ wits: string[];
51
+ picks: [string, E[]][];
52
+ loose: boolean;
53
+ };
54
+ added: {
55
+ instance: CountInst;
56
+ reason: string;
57
+ links?: unknown;
58
+ }[];
59
+ proposed: unknown[];
60
+ oldEntriesPreserved: boolean;
61
+ freshWitnesses: boolean;
62
+ work: {
63
+ capReached: boolean;
64
+ provenanceLimit: number;
65
+ omittedProvenance: number;
66
+ truncated: boolean;
67
+ work: number;
68
+ limit: number;
69
+ exhausted: boolean;
70
+ deadline: boolean;
71
+ phases: {
72
+ phase: string;
73
+ work: number;
74
+ }[];
75
+ omittedPhases: number;
76
+ };
77
+ };
78
+ export declare function smallSelection(goal: Goal, decls: CountDecl[], full: ReturnType<typeof certFor>, ownKeys: E[], previous: Pick<CountCert, 'reads' | 'picks'>, budget?: {
79
+ state: {
80
+ work: number;
81
+ limit: number;
82
+ exhausted: boolean;
83
+ deadline: boolean;
84
+ phases: {
85
+ phase: string;
86
+ work: number;
87
+ }[];
88
+ omittedPhases: number;
89
+ };
90
+ tick: () => boolean;
91
+ mark: (phase: string) => void;
92
+ }): {
93
+ insts: CountInst[];
94
+ picks: [string, E[]][];
95
+ reads: MapRead[];
96
+ wits: string[];
97
+ loose: boolean;
98
+ };
99
+ export declare function genuinelyKeyless(d: Pick<CountDecl, 'j' | 'lo' | 'base' | 'body' | 'below'>): boolean;
100
+ export declare function vacuousCountBinder(m: Machine, l: Law, more?: () => boolean): false;
101
+ export declare function seedVacuousCounts(m: Machine, laws: Law[], initial: Instances, cap: number, more?: () => boolean): {
102
+ at: {
103
+ [x: string]: E[];
104
+ };
105
+ added: {
106
+ law: string;
107
+ tuple: E[];
108
+ }[];
109
+ };
110
+ type Direction = 'lower' | 'upper';
111
+ export declare function postDirections(raw: C, decls: CountDecl[]): {
112
+ directions: Direction[];
113
+ map: string;
114
+ key: E;
115
+ evidence: unknown[];
116
+ }[];
117
+ export declare function polaritySelection(goal: Goal, decls: CountDecl[], pool: ReturnType<typeof grammarPool>, budget?: {
118
+ state: {
119
+ work: number;
120
+ limit: number;
121
+ exhausted: boolean;
122
+ deadline: boolean;
123
+ phases: {
124
+ phase: string;
125
+ work: number;
126
+ }[];
127
+ omittedPhases: number;
128
+ };
129
+ tick: () => boolean;
130
+ mark: (phase: string) => void;
131
+ }, sourceMaps?: ReadonlySet<string>): {
132
+ pick: {
133
+ insts: CountInst[];
134
+ wits: string[];
135
+ picks: NonNullable<CountCert["picks"]>;
136
+ reads: MapRead[];
137
+ loose: boolean;
138
+ };
139
+ record: {
140
+ directions: {
141
+ directions: Direction[];
142
+ map: string;
143
+ key: E;
144
+ evidence: unknown[];
145
+ }[];
146
+ preferred: {
147
+ instance: CountInst;
148
+ selected: boolean;
149
+ presentBeforeCap: boolean;
150
+ id: string;
151
+ source: string;
152
+ rank: number;
153
+ reasons: unknown[];
154
+ }[];
155
+ selected: string[];
156
+ selectedCount: number;
157
+ initialPriorityOnly: boolean;
158
+ activePoolCap: number;
159
+ newGrammar: boolean;
160
+ work: {
161
+ work: number;
162
+ limit: number;
163
+ exhausted: boolean;
164
+ deadline: boolean;
165
+ phases: {
166
+ phase: string;
167
+ work: number;
168
+ }[];
169
+ omittedPhases: number;
170
+ };
171
+ };
172
+ };
173
+ export declare const instId: (i: CountCert["insts"][number], rs: CountCert["reads"]) => string;
174
+ export declare const ids: (c: Pick<CountCert, "reads" | "insts" | "picks">) => string[];
175
+ export declare function reservationReadClosure(goal: Goal, decls: CountDecl[], previous: Pick<CountCert, 'reads' | 'insts' | 'picks'>, previousDecls: CountDecl[], chosen: Set<string>, globals?: Iterable<string>): {
176
+ reads: MapRead[];
177
+ scope: Set<string>;
178
+ };
179
+ type WitnessLease = {
180
+ wit: string;
181
+ identity: string;
182
+ };
183
+ export declare function reservationState(goal: Goal, rawSource: unknown, next: number): {
184
+ next: number;
185
+ inserted: Map<string, string>;
186
+ ownership: {
187
+ goal: string;
188
+ reserved: Set<string>;
189
+ leases: Map<string, WitnessLease>;
190
+ };
191
+ };
192
+ export declare function reservePool(goal: Goal, decls: CountDecl[], pool: ReturnType<typeof grammarPool>, previous: Pick<CountCert, 'reads' | 'insts' | 'picks'>, previousDecls: CountDecl[], chosen: Set<string>, state: {
193
+ next: number;
194
+ inserted: Map<string, string>;
195
+ ownership?: ReturnType<typeof reservationState>['ownership'];
196
+ }, cap?: number, reservation?: ReturnType<typeof reservationReadClosure>): {
197
+ full: {
198
+ insts: CountInst[];
199
+ wits: string[];
200
+ reads: MapRead[];
201
+ picks: [string, E[]][];
202
+ loose: boolean;
203
+ };
204
+ record: {
205
+ cap: number;
206
+ chosen: number;
207
+ renamed: {
208
+ key: string;
209
+ from: string;
210
+ to: string;
211
+ }[];
212
+ quarantined: CountInst[];
213
+ baseSize: number;
214
+ finalSize: number;
215
+ preservedReads: MapRead[];
216
+ rebindings: unknown[];
217
+ inserted: {
218
+ key: string;
219
+ instance: CountInst;
220
+ }[];
221
+ evicted: {
222
+ key: string;
223
+ instance: CountInst;
224
+ }[];
225
+ reified: number;
226
+ unselectedTailOnly: boolean;
227
+ };
228
+ };
229
+ export declare function stableState(rawSource: unknown): {
230
+ reserved: Set<string>;
231
+ bySemantic: Map<string, {
232
+ wit: string;
233
+ definition: string;
234
+ }>;
235
+ used: Set<string>;
236
+ };
237
+ export declare function stableSelected(goal: Goal, decls: CountDecl[], view: Pick<CountCert, 'reads' | 'insts' | 'picks'>, state: ReturnType<typeof stableState>, context: {
238
+ lazyRoom: boolean;
239
+ fullPoolUsed: boolean;
240
+ }): {
241
+ cert: {
242
+ reads: MapRead[];
243
+ insts: {
244
+ wit: string;
245
+ below: E;
246
+ terms: [number, string][];
247
+ unit: number;
248
+ }[];
249
+ picks: [string, E[]][];
250
+ wits: string[];
251
+ };
252
+ record: {
253
+ stable: boolean;
254
+ selectedCount: number;
255
+ updates: unknown[];
256
+ fullPoolModelUsed: boolean;
257
+ picksUsed: boolean;
258
+ sourceReadCount: number;
259
+ selectedReadCount: number;
260
+ referencedReadIds: string[];
261
+ omittedReadIds: string[];
262
+ };
263
+ };
264
+ export type Projection = {
265
+ binding: Record<string, E>;
266
+ kind: 'coordinate-projection';
267
+ unmatchedFixed: {
268
+ name: string;
269
+ coefficient: number;
270
+ }[];
271
+ sourceCoordinates: {
272
+ name: string;
273
+ coefficient: number;
274
+ }[];
275
+ boundCoordinate: {
276
+ name: string;
277
+ coefficient: number;
278
+ };
279
+ };
280
+ export declare function fixedStateCoordinates(m: Machine, key: E, binder: string): {
281
+ name: string;
282
+ coefficient: number;
283
+ }[];
284
+ export declare function projectBoundCoordinate(m: Machine, pattern: E, actual: E, binder: string): Projection | undefined;
285
+ export type RemainderMatch = {
286
+ binding: Record<string, E>;
287
+ tail: string;
288
+ remainder: E;
289
+ polynomial: string;
290
+ liveAnchors: string[];
291
+ };
292
+ export declare function matchAffineRemainder(pattern: E, actual: E, binders: string[], live: Set<string>): RemainderMatch | undefined;
293
+ type Binding = Record<string, E>;
294
+ export declare function matchRead(pattern: E, term: E, binders: string[]): Binding | undefined;
295
+ type Source = {
296
+ kind: 'own' | 'write' | 'read';
297
+ map: string;
298
+ key: E;
299
+ id: string;
300
+ };
301
+ type Partial = {
302
+ binding: Binding;
303
+ source: Source;
304
+ pattern: [string, E];
305
+ sameMap: boolean;
306
+ projection?: Projection;
307
+ remainder?: RemainderMatch;
308
+ };
309
+ export declare const projectionEligible: (m: Machine, l: Law, more?: () => boolean) => boolean;
310
+ type Choice = {
311
+ law: string;
312
+ tuple: E[];
313
+ sources: Partial[];
314
+ coherent: boolean;
315
+ conflicts: string[];
316
+ score: number;
317
+ countLaw: boolean;
318
+ };
319
+ export declare function bareRangeMap(m: Machine, l: Law, more?: () => boolean): string | undefined;
320
+ export declare function seededBoundMaps(m: Machine, laws: Law[], seeds: {
321
+ law: string;
322
+ tuple: E[];
323
+ }[]): Set<string>;
324
+ export declare function targetKeylessMeets(m: Machine, decls: CountDecl[], cert: Pick<CountCert, 'reads' | 'insts'>, rawPost: C | undefined, sourceMaps: ReadonlySet<string>, more?: () => boolean): CountInst[];
325
+ export declare function targetKindMatches(m: Machine, laws: Law[], decls: CountDecl[], cert: Pick<CountCert, 'reads' | 'insts'>, rawPost: C | undefined, sourceMaps: ReadonlySet<string>, more?: () => boolean): {
326
+ law: string;
327
+ tuple: E[];
328
+ map: string;
329
+ witness: string;
330
+ body: C;
331
+ premise: C;
332
+ }[];
333
+ export declare function rootFlagMatches(m: Machine, own: Law, more?: () => boolean): {
334
+ law: string;
335
+ tuple: E[];
336
+ map: string;
337
+ pattern: E;
338
+ actual: E;
339
+ matchingOnly: Record<string, E>;
340
+ premise: C;
341
+ }[];
342
+ export declare function targetFlagMatches(m: Machine, decls: CountDecl[], cert: Pick<CountCert, 'reads' | 'insts'>, rawPost: C | undefined, sourceMaps: ReadonlySet<string>, more?: () => boolean): {
343
+ law: string;
344
+ tuple: E[];
345
+ witness: string;
346
+ map: string;
347
+ pattern: E;
348
+ actual: E;
349
+ matchingOnly: Record<string, E>;
350
+ fixed: {
351
+ name: string;
352
+ coefficient: number;
353
+ }[];
354
+ domain: C;
355
+ premise: C;
356
+ }[];
357
+ export declare function targetReadMatches(m: Machine, laws: Law[], decls: CountDecl[], cert: Pick<CountCert, 'reads' | 'insts'>, rawPost: C | undefined, sourceMaps: ReadonlySet<string>, more?: () => boolean): {
358
+ law: string;
359
+ tuple: E[];
360
+ witness: string;
361
+ map: string;
362
+ pattern: E;
363
+ actual: E;
364
+ premise: C;
365
+ }[];
366
+ export declare function transitionReads(m: Machine, own: Law, more?: () => boolean): {
367
+ read: [string, E];
368
+ path: string[];
369
+ freeNames: string[];
370
+ }[];
371
+ export type CompleteReadMatch = {
372
+ kind: 'complete-coherent-read';
373
+ coherentReadMatch: true;
374
+ law: string;
375
+ tuple: E[];
376
+ source: {
377
+ kind: 'root' | 'selected' | 'transition';
378
+ read: [string, E];
379
+ witness?: string;
380
+ path?: string[];
381
+ freeNames?: string[];
382
+ };
383
+ pattern: E;
384
+ binding: Record<string, E>;
385
+ premise: C;
386
+ };
387
+ export declare function completeReadMatches(m: Machine, laws: Law[], own: Law, decls: CountDecl[], cert: Pick<CountCert, 'reads' | 'insts'>, more?: () => boolean, includeSelected?: boolean): CompleteReadMatch[];
388
+ export declare function ownPREMatches(m: Machine, laws: Law[], own: Law, decls: CountDecl[], cert: Pick<CountCert, 'reads' | 'insts'>, rawPost: C | undefined, sourceMaps: ReadonlySet<string>, preHyps: C[], more?: () => boolean): {
389
+ law: string;
390
+ tuple: E[];
391
+ witness: string;
392
+ countRead: [string, E];
393
+ sourceLaw: string;
394
+ sourcePremise: C;
395
+ sourceRead: [string, E];
396
+ premise: C;
397
+ }[];
398
+ export type TermProposal = {
399
+ kind: 'one-remaining-coordinate-term-proposal';
400
+ coherentReadMatch: false;
401
+ law: string;
402
+ tuple: E[];
403
+ witness?: string;
404
+ countRead?: [string, E];
405
+ rootLinked?: true;
406
+ ownWriteKeyMatch?: boolean;
407
+ anchorRead: [string, E];
408
+ anchorPattern: E;
409
+ anchor: Record<string, E>;
410
+ remaining: string;
411
+ term: E;
412
+ sourceLaw?: string;
413
+ sourcePremise?: C;
414
+ sourceKind?: 'read' | 'write';
415
+ sourceRead: [string, E];
416
+ sourcePattern: E;
417
+ projection: Projection;
418
+ ignoredCounterpartCoordinates: {
419
+ binder: string;
420
+ retained: E;
421
+ counterpart: E;
422
+ }[];
423
+ sourceKeyReconstructed: boolean;
424
+ premise: C;
425
+ };
426
+ export declare function remainingCoordinateProposals(m: Machine, laws: Law[], decls: CountDecl[], cert: Pick<CountCert, 'reads' | 'insts'>, rawPost: C | undefined, sourceMaps: ReadonlySet<string>, preHyps: C[], more?: () => boolean, own?: Law): TermProposal[];
427
+ export declare function sparseReadInstances(m: Machine, laws: Law[], own: Law, at: Instances, goal: Goal, cert: Pick<CountCert, 'reads' | 'insts'>, cap?: number, rawPost?: C, decls?: CountDecl[], sourceMaps?: ReadonlySet<string>, preHyps?: C[], budget?: {
428
+ state: {
429
+ work: number;
430
+ limit: number;
431
+ exhausted: boolean;
432
+ deadline: boolean;
433
+ phases: {
434
+ phase: string;
435
+ work: number;
436
+ }[];
437
+ omittedPhases: number;
438
+ };
439
+ tick: () => boolean;
440
+ mark: (phase: string) => void;
441
+ }, completePriority?: 'current' | 'root'): {
442
+ added: Choice[];
443
+ completeMatches: CompleteReadMatch[];
444
+ readKindMatches: {
445
+ law: string;
446
+ tuple: E[];
447
+ map: string;
448
+ premise: C;
449
+ }[];
450
+ termProposals: TermProposal[];
451
+ vacuousTermProposals: TermProposal[];
452
+ ownMatches: {
453
+ law: string;
454
+ tuple: E[];
455
+ witness: string;
456
+ countRead: [string, E];
457
+ sourceLaw: string;
458
+ sourcePremise: C;
459
+ sourceRead: [string, E];
460
+ premise: C;
461
+ }[];
462
+ priorityMatches: {
463
+ law: string;
464
+ tuple: E[];
465
+ witness: string;
466
+ map: string;
467
+ pattern: E;
468
+ actual: E;
469
+ premise: C;
470
+ }[];
471
+ rootFlags: {
472
+ law: string;
473
+ tuple: E[];
474
+ map: string;
475
+ pattern: E;
476
+ actual: E;
477
+ matchingOnly: Record<string, E>;
478
+ premise: C;
479
+ }[];
480
+ flagMatches: {
481
+ law: string;
482
+ tuple: E[];
483
+ map: string;
484
+ pattern: E;
485
+ actual: E;
486
+ matchingOnly: Record<string, E>;
487
+ premise: C;
488
+ }[];
489
+ kindMatches: {
490
+ law: string;
491
+ tuple: E[];
492
+ map: string;
493
+ witness: string;
494
+ body: C;
495
+ premise: C;
496
+ }[];
497
+ summary: {
498
+ foundationBarrier: boolean;
499
+ cap: number;
500
+ completeReadAdmissions: number;
501
+ liveReadAdmissions: number;
502
+ livePairWork: number;
503
+ livePairExhausted: boolean;
504
+ readKindAdmissions: number;
505
+ termProposalAdmissions: number;
506
+ ownPREAdmissions: number;
507
+ flagAdmissions: number;
508
+ sharedGlobalBudget: boolean;
509
+ generationWork: {
510
+ work: number;
511
+ limit: number;
512
+ exhausted: boolean;
513
+ deadline: boolean;
514
+ phases: {
515
+ phase: string;
516
+ work: number;
517
+ }[];
518
+ omittedPhases: number;
519
+ };
520
+ livePairLimit: number;
521
+ anchors: Source[];
522
+ candidates: number;
523
+ mixedAlternatives: number;
524
+ admitted: number;
525
+ perLawLimit: number;
526
+ rawFocusSupplied: boolean;
527
+ selectedWitnesses: string[];
528
+ directCountMaps: string[];
529
+ writeVariables: string[];
530
+ allTuplesGenuinePRE: boolean;
531
+ noMixedTupleAdmitted: boolean;
532
+ };
533
+ at: Instances;
534
+ proposals: unknown[];
535
+ mixed: Choice[];
536
+ };
537
+ export declare function coarseContext(m: Machine, laws: Law[], caller: Law[], support: ReadonlySet<Law>): Law[];
538
+ export declare function sourceContext(m: Machine, laws: Law[], target: Law, support: ReadonlySet<Law>): Law[];
539
+ export declare const countSignature: (c: Pick<CountCert, "reads" | "insts" | "picks">) => string;
540
+ export declare const refinementSignature: (goal: Goal, c: Pick<CountCert, "reads" | "insts" | "picks">) => string;
541
+ export declare function selectedCertificate<T extends Pick<CountCert, 'reads' | 'insts' | 'picks'>>(goal: Goal, decls: CountDecl[], view: T, state: ReturnType<typeof stableState>, lazyRoom: boolean): {
542
+ reads: MapRead[];
543
+ insts: {
544
+ wit: string;
545
+ below: E;
546
+ terms: [number, string][];
547
+ unit: number;
548
+ }[];
549
+ picks: [string, E[]][];
550
+ wits: string[];
551
+ };
552
+ export declare function sourceBoundMaps(m: Machine, laws: Law[], at: Instances, more?: () => boolean): Set<string>;
553
+ export declare function prepareSupport(m: Machine, laws: Law[], own: Law, initial: Instances, pass: 0 | 1, budget?: {
554
+ state: {
555
+ work: number;
556
+ limit: number;
557
+ exhausted: boolean;
558
+ deadline: boolean;
559
+ phases: {
560
+ phase: string;
561
+ work: number;
562
+ }[];
563
+ omittedPhases: number;
564
+ };
565
+ tick: () => boolean;
566
+ mark: (phase: string) => void;
567
+ }): {
568
+ at: Instances;
569
+ seedCount: number;
570
+ sourceMaps: Set<string>;
571
+ termAdmissions: TermProposal[];
572
+ replacements: {
573
+ law: string;
574
+ tuple: E[];
575
+ premise: C;
576
+ replacement: TermProposal;
577
+ reason: "structurally-true";
578
+ origin: "new-source" | "initial";
579
+ admissionDebit: number;
580
+ }[];
581
+ generationWork: {
582
+ work: number;
583
+ limit: number;
584
+ exhausted: boolean;
585
+ deadline: boolean;
586
+ phases: {
587
+ phase: string;
588
+ work: number;
589
+ }[];
590
+ omittedPhases: number;
591
+ };
592
+ };
593
+ export declare function chosenView<T extends Pick<CountCert, 'reads' | 'insts' | 'picks'>>(full: T, chosen: Set<string>, cap?: number): T & {
594
+ picks: [string, E[]][];
595
+ insts: CountInst[];
596
+ wits: string[];
597
+ };
598
+ export {};