gdp-wired 0.48.0 → 0.49.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 (295) hide show
  1. package/README.md +2 -2
  2. package/dist/core/bmc.js +10 -7
  3. package/dist/core/check.js +7 -2
  4. package/dist/core/count-attempt-work.d.ts +29 -0
  5. package/dist/core/count-attempt-work.js +96 -0
  6. package/dist/core/count-boolean-partition.d.ts +5 -0
  7. package/dist/core/count-boolean-partition.js +47 -0
  8. package/dist/core/count-bounded-quotient.d.ts +2 -0
  9. package/dist/core/count-bounded-quotient.js +13 -0
  10. package/dist/core/count-case-compose.d.ts +20 -0
  11. package/dist/core/count-case-compose.js +289 -0
  12. package/dist/core/count-cases.js +3 -2
  13. package/dist/core/count-cert-rename.d.ts +10 -0
  14. package/dist/core/count-cert-rename.js +69 -0
  15. package/dist/core/count-cert-transport.d.ts +10 -2
  16. package/dist/core/count-cert-transport.js +60 -9
  17. package/dist/core/count-certificate-minimize.d.ts +57 -0
  18. package/dist/core/count-certificate-minimize.js +263 -0
  19. package/dist/core/count-closed-family.d.ts +32 -0
  20. package/dist/core/count-closed-family.js +143 -0
  21. package/dist/core/count-closing-budget.d.ts +10 -0
  22. package/dist/core/count-closing-budget.js +49 -0
  23. package/dist/core/count-closing-needs.d.ts +5 -0
  24. package/dist/core/count-closing-needs.js +9 -0
  25. package/dist/core/count-component-budget.d.ts +5 -0
  26. package/dist/core/count-component-budget.js +9 -0
  27. package/dist/core/count-copy-shape.d.ts +11 -0
  28. package/dist/core/count-copy-shape.js +40 -0
  29. package/dist/core/count-disjoint-funding.d.ts +75 -0
  30. package/dist/core/count-disjoint-funding.js +284 -0
  31. package/dist/core/count-emitter-frame-pool.d.ts +23 -0
  32. package/dist/core/count-emitter-frame-pool.js +87 -0
  33. package/dist/core/count-final-step.d.ts +5 -0
  34. package/dist/core/count-final-step.js +20 -0
  35. package/dist/core/count-fixed-frame.d.ts +4 -0
  36. package/dist/core/count-fixed-frame.js +30 -0
  37. package/dist/core/count-frames.d.ts +25 -0
  38. package/dist/core/count-frames.js +118 -0
  39. package/dist/core/count-frozen-guard.d.ts +2 -0
  40. package/dist/core/count-frozen-guard.js +31 -0
  41. package/dist/core/count-generation-phase.d.ts +7 -0
  42. package/dist/core/count-generation-phase.js +33 -0
  43. package/dist/core/count-guard-composition.d.ts +12 -0
  44. package/dist/core/count-guard-composition.js +48 -0
  45. package/dist/core/count-guard-context.d.ts +11 -0
  46. package/dist/core/count-guard-context.js +50 -0
  47. package/dist/core/count-guard-facts.d.ts +50 -0
  48. package/dist/core/count-guard-facts.js +97 -0
  49. package/dist/core/count-guard-proposals.d.ts +7 -0
  50. package/dist/core/count-guard-proposals.js +106 -0
  51. package/dist/core/count-guard-shape.d.ts +18 -0
  52. package/dist/core/count-guard-shape.js +100 -0
  53. package/dist/core/count-guard-tree.d.ts +17 -0
  54. package/dist/core/count-guard-tree.js +125 -0
  55. package/dist/core/count-leader-facts.d.ts +10 -0
  56. package/dist/core/count-leader-facts.js +52 -0
  57. package/dist/core/count-leader.d.ts +10 -0
  58. package/dist/core/count-leader.js +331 -0
  59. package/dist/core/count-lemma-transport.d.ts +8 -0
  60. package/dist/core/count-lemma-transport.js +47 -0
  61. package/dist/core/count-lifted-budget.d.ts +54 -0
  62. package/dist/core/count-lifted-budget.js +97 -0
  63. package/dist/core/count-lifted-copy.d.ts +3 -0
  64. package/dist/core/count-lifted-copy.js +166 -0
  65. package/dist/core/count-lifted-increment.d.ts +3 -0
  66. package/dist/core/count-lifted-increment.js +146 -0
  67. package/dist/core/count-lifted-load.d.ts +5 -0
  68. package/dist/core/count-lifted-load.js +179 -0
  69. package/dist/core/count-lifted-prerequisite.d.ts +14 -0
  70. package/dist/core/count-lifted-prerequisite.js +53 -0
  71. package/dist/core/count-lifted-replacement.d.ts +3 -0
  72. package/dist/core/count-lifted-replacement.js +540 -0
  73. package/dist/core/count-lifted-shape.d.ts +63 -0
  74. package/dist/core/count-lifted-shape.js +115 -0
  75. package/dist/core/count-lifted-strategy.d.ts +7 -0
  76. package/dist/core/count-lifted-strategy.js +226 -0
  77. package/dist/core/count-lifted-transports.d.ts +32 -0
  78. package/dist/core/count-lifted-transports.js +293 -0
  79. package/dist/core/count-load-shape.d.ts +17 -0
  80. package/dist/core/count-load-shape.js +67 -0
  81. package/dist/core/count-minimal-view.d.ts +26 -0
  82. package/dist/core/count-minimal-view.js +46 -0
  83. package/dist/core/count-operation-observation.d.ts +9 -0
  84. package/dist/core/count-operation-observation.js +22 -0
  85. package/dist/core/count-operation-order.d.ts +5 -0
  86. package/dist/core/count-operation-order.js +4 -0
  87. package/dist/core/count-phase.d.ts +9 -0
  88. package/dist/core/count-phase.js +127 -0
  89. package/dist/core/count-premise-search.d.ts +9 -0
  90. package/dist/core/count-premise-search.js +41 -0
  91. package/dist/core/count-premise-view.d.ts +19 -0
  92. package/dist/core/count-premise-view.js +220 -0
  93. package/dist/core/count-prerequisite-components.d.ts +67 -0
  94. package/dist/core/count-prerequisite-components.js +239 -0
  95. package/dist/core/count-prerequisite-memory.d.ts +24 -0
  96. package/dist/core/count-prerequisite-memory.js +37 -0
  97. package/dist/core/count-prerequisite-plan.d.ts +12 -0
  98. package/dist/core/count-prerequisite-plan.js +88 -0
  99. package/dist/core/count-primitive-budget.d.ts +1 -0
  100. package/dist/core/count-primitive-budget.js +8 -0
  101. package/dist/core/count-project-free.d.ts +3 -0
  102. package/dist/core/count-project-free.js +24 -0
  103. package/dist/core/count-project-witness.d.ts +4 -0
  104. package/dist/core/count-project-witness.js +48 -0
  105. package/dist/core/count-proof-rescope.d.ts +14 -0
  106. package/dist/core/count-proof-rescope.js +71 -0
  107. package/dist/core/count-proof-scope.d.ts +68 -0
  108. package/dist/core/count-proof-scope.js +333 -0
  109. package/dist/core/count-prune-owned-root.d.ts +5 -0
  110. package/dist/core/count-prune-owned-root.js +27 -0
  111. package/dist/core/count-query-context.d.ts +3 -0
  112. package/dist/core/count-query-context.js +7 -0
  113. package/dist/core/count-query.d.ts +15 -0
  114. package/dist/core/count-query.js +59 -0
  115. package/dist/core/count-quorum-leaf.d.ts +9 -0
  116. package/dist/core/count-quorum-leaf.js +38 -0
  117. package/dist/core/count-reachability-budget.d.ts +1 -0
  118. package/dist/core/count-reachability-budget.js +7 -0
  119. package/dist/core/count-reachability-reconcile.d.ts +11 -0
  120. package/dist/core/count-reachability-reconcile.js +19 -0
  121. package/dist/core/count-reachability.d.ts +50 -0
  122. package/dist/core/count-reachability.js +351 -0
  123. package/dist/core/count-rebase-path.d.ts +9 -0
  124. package/dist/core/count-rebase-path.js +68 -0
  125. package/dist/core/count-recipe-context.d.ts +45 -0
  126. package/dist/core/count-recipe-context.js +71 -0
  127. package/dist/core/count-recipe-controller.d.ts +115 -0
  128. package/dist/core/count-recipe-controller.js +417 -0
  129. package/dist/core/count-recipe-graph.d.ts +36 -0
  130. package/dist/core/count-recipe-graph.js +211 -0
  131. package/dist/core/count-recovery/conditional-check-cache.js +3 -2
  132. package/dist/core/count-recovery/conditional-cuts.js +5 -4
  133. package/dist/core/count-recovery/conditional-proof.d.ts +37 -3
  134. package/dist/core/count-recovery/conditional-proof.js +72 -30
  135. package/dist/core/count-recovery/derivability-closure.js +2 -1
  136. package/dist/core/count-recovery/guard-cases.js +2 -1
  137. package/dist/core/count-recovery/reframe-tree.d.ts +2 -0
  138. package/dist/core/count-recovery/reframe-tree.js +24 -0
  139. package/dist/core/count-recovery/replay-linear-skeleton.d.ts +2 -0
  140. package/dist/core/count-recovery/replay-linear-skeleton.js +28 -0
  141. package/dist/core/count-recovery/row-cases.js +2 -1
  142. package/dist/core/count-rejection-budget.d.ts +8 -0
  143. package/dist/core/count-rejection-budget.js +15 -0
  144. package/dist/core/count-replacement.d.ts +5 -0
  145. package/dist/core/count-replacement.js +129 -0
  146. package/dist/core/count-replay-diagnostic.d.ts +21 -0
  147. package/dist/core/count-replay-diagnostic.js +49 -0
  148. package/dist/core/count-replay-skeleton.d.ts +4 -0
  149. package/dist/core/count-replay-skeleton.js +28 -0
  150. package/dist/core/count-rescope-funding.d.ts +3 -0
  151. package/dist/core/count-rescope-funding.js +17 -0
  152. package/dist/core/count-restrictions.d.ts +11 -0
  153. package/dist/core/count-restrictions.js +31 -0
  154. package/dist/core/count-retry-budget.d.ts +67 -0
  155. package/dist/core/count-retry-budget.js +114 -0
  156. package/dist/core/count-retry-round.d.ts +24 -0
  157. package/dist/core/count-retry-round.js +44 -0
  158. package/dist/core/count-row-agreement.d.ts +35 -0
  159. package/dist/core/count-row-agreement.js +270 -0
  160. package/dist/core/count-row-aliases.d.ts +3 -0
  161. package/dist/core/count-row-aliases.js +59 -0
  162. package/dist/core/count-row-composition.d.ts +6 -0
  163. package/dist/core/count-row-composition.js +55 -0
  164. package/dist/core/count-row-copy-linear.d.ts +4 -0
  165. package/dist/core/count-row-copy-linear.js +83 -0
  166. package/dist/core/count-row-copy.d.ts +4 -0
  167. package/dist/core/count-row-copy.js +94 -0
  168. package/dist/core/count-row-policy.d.ts +3 -0
  169. package/dist/core/count-row-policy.js +56 -0
  170. package/dist/core/count-row-reindex.d.ts +11 -0
  171. package/dist/core/count-row-reindex.js +126 -0
  172. package/dist/core/count-row-support.d.ts +9 -0
  173. package/dist/core/count-row-support.js +42 -0
  174. package/dist/core/count-row-symmetry.d.ts +7 -0
  175. package/dist/core/count-row-symmetry.js +100 -0
  176. package/dist/core/count-scope-hyps.d.ts +2 -0
  177. package/dist/core/count-scope-hyps.js +163 -0
  178. package/dist/core/count-scope-row-reuse.d.ts +3 -0
  179. package/dist/core/count-scope-row-reuse.js +92 -0
  180. package/dist/core/count-search-allowance.d.ts +1 -0
  181. package/dist/core/count-search-allowance.js +17 -0
  182. package/dist/core/count-stabilize-tree.d.ts +9 -0
  183. package/dist/core/count-stabilize-tree.js +35 -0
  184. package/dist/core/count-stage-trace.d.ts +8 -0
  185. package/dist/core/count-stage-trace.js +45 -0
  186. package/dist/core/count-strategies.d.ts +16 -0
  187. package/dist/core/count-strategies.js +155 -0
  188. package/dist/core/count-strategy-premises.d.ts +5 -0
  189. package/dist/core/count-strategy-premises.js +14 -0
  190. package/dist/core/count-strategy.d.ts +41 -0
  191. package/dist/core/count-strategy.js +76 -0
  192. package/dist/core/count-support.js +3 -2
  193. package/dist/core/count-tier-budget.d.ts +14 -0
  194. package/dist/core/count-tier-budget.js +64 -0
  195. package/dist/core/count-unwritten-prefix.d.ts +24 -0
  196. package/dist/core/count-unwritten-prefix.js +97 -0
  197. package/dist/core/count-write-shape.d.ts +15 -0
  198. package/dist/core/count-write-shape.js +73 -0
  199. package/dist/core/counts.d.ts +37 -13
  200. package/dist/core/counts.js +990 -127
  201. package/dist/core/cycles.js +5 -4
  202. package/dist/core/cyclic.js +11 -10
  203. package/dist/core/data.js +16 -15
  204. package/dist/core/dsl-deadline.d.ts +3 -0
  205. package/dist/core/dsl-deadline.js +27 -0
  206. package/dist/core/dsl.d.ts +9 -0
  207. package/dist/core/dsl.js +156 -51
  208. package/dist/core/evaluation-admission.d.ts +1 -0
  209. package/dist/core/evaluation-admission.js +3 -0
  210. package/dist/core/exists.d.ts +6 -1
  211. package/dist/core/exists.js +51 -9
  212. package/dist/core/field-laws.d.ts +3 -1
  213. package/dist/core/field-laws.js +140 -2
  214. package/dist/core/finite-houdini.d.ts +6 -0
  215. package/dist/core/finite-houdini.js +63 -21
  216. package/dist/core/finite-tiny.js +95 -67
  217. package/dist/core/fixtures/count-completion/paxos-decision.json +1 -0
  218. package/dist/core/fresh.js +5 -1
  219. package/dist/core/infer.js +45 -30
  220. package/dist/core/kind.js +2 -1
  221. package/dist/core/lemma-cuts.js +11 -10
  222. package/dist/core/linear-admission.d.ts +14 -0
  223. package/dist/core/linear-admission.js +151 -0
  224. package/dist/core/machine.d.ts +5 -2
  225. package/dist/core/machine.js +105 -31
  226. package/dist/core/meter.d.ts +22 -0
  227. package/dist/core/meter.js +34 -0
  228. package/dist/core/nonterm.js +4 -3
  229. package/dist/core/prover-row-budget.d.ts +3 -0
  230. package/dist/core/prover-row-budget.js +106 -0
  231. package/dist/core/quorum-laws.d.ts +21 -1
  232. package/dist/core/quorum-laws.js +27 -3
  233. package/dist/core/rationals.js +3 -2
  234. package/dist/core/rejection-discovery.d.ts +34 -0
  235. package/dist/core/rejection-discovery.js +36 -0
  236. package/dist/core/rejection-stage.d.ts +39 -0
  237. package/dist/core/rejection-stage.js +205 -0
  238. package/dist/core/request-quotient.d.ts +8 -0
  239. package/dist/core/request-quotient.js +299 -0
  240. package/dist/core/row-agreement-shape.d.ts +15 -0
  241. package/dist/core/row-agreement-shape.js +68 -0
  242. package/dist/core/runtime-wall.d.ts +2 -0
  243. package/dist/core/search-policy.d.ts +15 -0
  244. package/dist/core/search-policy.js +68 -0
  245. package/dist/core/solver.d.ts +1 -1
  246. package/dist/core/solver.js +40 -6
  247. package/dist/core/step-work.d.ts +12 -0
  248. package/dist/core/step-work.js +14 -0
  249. package/dist/core/strategy-premises.d.ts +8 -0
  250. package/dist/core/strategy-premises.js +64 -0
  251. package/dist/core/system.js +4 -3
  252. package/dist/core/table-admission.d.ts +1 -0
  253. package/dist/core/table-admission.js +3 -0
  254. package/dist/core/trace-clock.d.ts +3 -0
  255. package/dist/core/trace-clock.js +16 -0
  256. package/dist/core/transfer.js +3 -2
  257. package/dist/core/translate.js +16 -3
  258. package/dist/core/wall.d.ts +6 -1
  259. package/dist/core/wall.js +23 -9
  260. package/dist/core/watch.d.ts +1 -1
  261. package/dist/core/watch.js +13 -4
  262. package/dist/core/work-admission.d.ts +164 -0
  263. package/dist/core/work-admission.js +418 -0
  264. package/dist/core/work-amount.d.ts +21 -0
  265. package/dist/core/work-amount.js +80 -0
  266. package/dist/core/work-collections.d.ts +11 -0
  267. package/dist/core/work-collections.js +198 -0
  268. package/dist/core/work-kinds.d.ts +11 -0
  269. package/dist/core/work-kinds.js +9 -0
  270. package/dist/core/work-meter.d.ts +8 -0
  271. package/dist/core/work-meter.js +83 -0
  272. package/dist/core/work-observe.d.ts +12 -0
  273. package/dist/core/work-observe.js +39 -0
  274. package/dist/core/work-profile.d.ts +10 -0
  275. package/dist/core/work-profile.js +21 -0
  276. package/dist/core/work-refusal.d.ts +1 -0
  277. package/dist/core/work-refusal.js +6 -0
  278. package/dist/interchange/format.js +2 -0
  279. package/dist/kernel/cdcl.js +93 -40
  280. package/dist/kernel/epr.js +23 -8
  281. package/dist/kernel/kernel.d.ts +47 -1
  282. package/dist/kernel/kernel.js +417 -68
  283. package/dist/kernel/prove.d.ts +49 -3
  284. package/dist/kernel/prove.js +468 -122
  285. package/dist/kernel/prover-rows.d.ts +1 -0
  286. package/dist/kernel/prover-rows.js +12 -1
  287. package/dist/kernel/reader.d.ts +1 -1
  288. package/dist/kernel/reader.js +57 -12
  289. package/dist/kernel/simplex.js +9 -2
  290. package/dist/lean-kernel/emit.d.ts +9 -1
  291. package/dist/lean-kernel/emit.js +144 -22
  292. package/dist/lean-kernel/legacy-family-library.d.ts +1 -0
  293. package/dist/lean-kernel/legacy-family-library.js +5 -0
  294. package/dist/lean-kernel/library.js +3 -3
  295. package/package.json +1 -1
@@ -0,0 +1,23 @@
1
+ import { type Count, type FrameCut } from '../kernel/kernel.js';
2
+ export declare class FrameFactPool {
3
+ readonly counts: Count[];
4
+ readonly frames: FrameCut[];
5
+ readonly until: number;
6
+ private offered;
7
+ private reused;
8
+ private validated;
9
+ private rejected;
10
+ private removed;
11
+ constructor(counts: Count[], frames: FrameCut[], until: number);
12
+ private pair;
13
+ offer(frame: FrameCut): boolean;
14
+ stats(): {
15
+ offered: number;
16
+ reused: number;
17
+ validated: number;
18
+ rejected: number;
19
+ removed: number;
20
+ frames: number;
21
+ guards: number;
22
+ };
23
+ }
@@ -0,0 +1,87 @@
1
+ // Research-only per-emitter frame proposer. The final native certificate gate
2
+ // remains mandatory. Cached frames belong to one immutable count environment.
3
+ import { canon, frameActive, frameOk, simpE, whenPath } from "../kernel/kernel.js";
4
+ import { late } from "../kernel/prove.js";
5
+ export class FrameFactPool {
6
+ counts;
7
+ frames;
8
+ until;
9
+ offered = 0;
10
+ reused = 0;
11
+ validated = 0;
12
+ rejected = 0;
13
+ removed = 0;
14
+ constructor(counts, frames, until) { if (frames.length)
15
+ throw Error('frame pool must start empty'); this.counts = counts; this.frames = frames; this.until = until; }
16
+ pair(f) { return JSON.stringify([f.post, f.pre].sort()); }
17
+ offer(frame) {
18
+ this.offered++;
19
+ if (late(this.until))
20
+ return false;
21
+ const pair = this.pair(frame), path = whenPath(frame);
22
+ if (this.frames.some(f => this.pair(f) === pair && frameActive(f, path))) {
23
+ this.reused++;
24
+ return true;
25
+ }
26
+ const post = this.counts.find(c => c.v === frame.post), pre = this.counts.find(c => c.v === frame.pre);
27
+ if (!post || !pre || post.key !== pre.key) {
28
+ this.rejected++;
29
+ return false;
30
+ }
31
+ const seen = new Set(), all = () => { for (const key of path.keys())
32
+ seen.add(key); };
33
+ const tracked = new Proxy(path, { get(target, key) {
34
+ if (key === 'get')
35
+ return (id) => { const value = target.get(id); if (value !== undefined)
36
+ seen.add(id); return value; };
37
+ if (key === 'has')
38
+ return (id) => { const found = target.has(id); if (found)
39
+ seen.add(id); return found; };
40
+ if (key === 'size') {
41
+ all();
42
+ return target.size;
43
+ }
44
+ if (key === 'keys' || key === 'values' || key === 'entries' || key === Symbol.iterator || key === 'forEach') {
45
+ all();
46
+ const value = Reflect.get(target, key, target);
47
+ return value.bind(target);
48
+ }
49
+ const value = Reflect.get(target, key, target);
50
+ return typeof value === 'function' ? value.bind(target) : value;
51
+ } });
52
+ const equal = (a, b) => JSON.stringify(a) === JSON.stringify(b);
53
+ const same = equal(simpE(post.below, tracked, post.key), simpE(pre.below, tracked, pre.key)) && equal(simpE(post.body, tracked, post.key), simpE(pre.body, tracked, pre.key));
54
+ const short = { ...frame, when: frame.when.filter(row => seen.has(canon(row))) };
55
+ let candidate = frame;
56
+ if (same) {
57
+ this.validated++;
58
+ if (frameOk(this.counts, short))
59
+ candidate = short;
60
+ else {
61
+ this.validated++;
62
+ if (!frameOk(this.counts, frame)) {
63
+ this.rejected++;
64
+ return false;
65
+ }
66
+ }
67
+ }
68
+ else {
69
+ this.validated++;
70
+ if (!frameOk(this.counts, frame)) {
71
+ this.rejected++;
72
+ return false;
73
+ }
74
+ }
75
+ const keys = new Set(candidate.when.map(canon));
76
+ for (let i = this.frames.length - 1; i >= 0; i--) {
77
+ const old = this.frames[i];
78
+ if (this.pair(old) === pair && [...keys].every(k => old.when.some(row => canon(row) === k))) {
79
+ this.frames.splice(i, 1);
80
+ this.removed++;
81
+ }
82
+ }
83
+ this.frames.push(candidate);
84
+ return true;
85
+ }
86
+ stats() { return { offered: this.offered, reused: this.reused, validated: this.validated, rejected: this.rejected, removed: this.removed, frames: this.frames.length, guards: this.frames.reduce((n, f) => n + f.when.length, 0) }; }
87
+ }
@@ -0,0 +1,5 @@
1
+ export declare const familyStepProposal: unique symbol;
2
+ export type FamilyStepProposal = typeof familyStepProposal;
3
+ export declare const finalCountStepDeferralEnabled: () => boolean;
4
+ export declare const deferFinalCountStep: (key?: FamilyStepProposal) => boolean;
5
+ export declare function closingCountCheck(check: () => boolean): boolean;
@@ -0,0 +1,20 @@
1
+ // Internal proposal capability, not a proof receipt or acceptance token.
2
+ // Public/standalone strategy entry points never supply it. Only the full-work
3
+ // counted dispatcher may defer STEP to its unchanged final family checker.
4
+ import { completeWorkProfile } from "./work-profile.js";
5
+ import { env } from "./solver.js";
6
+ export const familyStepProposal = Symbol('unchecked family STEP proposal');
7
+ export const finalCountStepDeferralEnabled = () => completeWorkProfile.enabled && env.GDP_COUNT_FINAL_DEFER_CHECKS === '1';
8
+ export const deferFinalCountStep = (key) => key === familyStepProposal && finalCountStepDeferralEnabled();
9
+ // No cache: every invocation calls the original checker on the current objects.
10
+ // The opt-in path turns malformed/throwing/expired checks into clean refusal.
11
+ export function closingCountCheck(check) {
12
+ if (!finalCountStepDeferralEnabled())
13
+ return check();
14
+ try {
15
+ return check();
16
+ }
17
+ catch {
18
+ return false;
19
+ }
20
+ }
@@ -0,0 +1,4 @@
1
+ import { type Law, type Machine } from './machine.js';
2
+ import { ownCountLawInstance } from './count-frames.js';
3
+ import { type CountRequestBuilder, type CountStrategyProof, type CountStrategyOptions } from './count-strategy.js';
4
+ export declare function proveFixedCountFrame(m: Machine, family: Law[], law: Law, seed: Parameters<typeof ownCountLawInstance>[1], until: number, requestFor: CountRequestBuilder, options?: CountStrategyOptions): CountStrategyProof | undefined;
@@ -0,0 +1,30 @@
1
+ import { countsForReads } from "./count-facts.js";
2
+ import { countFrameConditions, fixedCountFrameCase, ownCountLawInstance, proveCountFrameGoal } from "./count-frames.js";
3
+ import { discoverCountGuardShape } from "./count-guard-shape.js";
4
+ import { finishCountStrategy } from "./count-strategy.js";
5
+ import { countedObligations, frameOk } from "../kernel/kernel.js";
6
+ import { fullRate, fullWork, late, withDeadline } from "../kernel/prove.js";
7
+ export function proveFixedCountFrame(m, family, law, seed, until, requestFor, options = {}) {
8
+ return withDeadline(until, () => {
9
+ if (late(until) || !family.includes(law))
10
+ return;
11
+ const choice = fixedCountFrameCase(m), shape = discoverCountGuardShape(m, law, family);
12
+ if (!choice || !shape)
13
+ return;
14
+ options.trace?.({ query: 'frame-eligibility', outcome: 'start' });
15
+ const start = fullWork();
16
+ const instances = ownCountLawInstance(law, seed), step = countedObligations(m, family, { [law.name]: instances }, family.indexOf(law)).at(-1);
17
+ const request = requestFor(step.goal, step.decls), counts = countsForReads(step.decls, request.reads), targets = new Set([shape.voteMap, shape.rowMap]), when = countFrameConditions(choice);
18
+ if (!counts)
19
+ return;
20
+ const post = request.reads.filter(r => r[1].endsWith('#') && targets.has(r[1].slice(0, -1)));
21
+ if (!post.length || post.some(([name, map, key]) => {
22
+ const pre = request.reads.find(r => r[1] === map.slice(0, -1) && JSON.stringify(r[2]) === JSON.stringify(key));
23
+ return !pre || !frameOk(counts, { post: name, pre: pre[0], when });
24
+ }))
25
+ return;
26
+ options.trace?.({ query: 'frame-eligibility', outcome: 'eligible', units: (fullWork() - start) / fullRate });
27
+ const cert = proveCountFrameGoal(step.goal, step.decls, request, choice, targets, until, undefined, { deferCheck: !!options.deferToComposition, trace: options.trace, minimalView: options.minimalView, leafUnits: options.leafUnits });
28
+ return cert && finishCountStrategy(m, family, law, instances, shape.voteMap, cert, until, requestFor, undefined, options);
29
+ });
30
+ }
@@ -0,0 +1,25 @@
1
+ import { type Law, type Machine } from './machine.js';
2
+ import { type CountCert, type CountDecl, type Goal, type Instances } from '../kernel/kernel.js';
3
+ import type { Lin } from './solver.js';
4
+ export type FixedCountFrameCase = {
5
+ name: string;
6
+ value: number;
7
+ values: number[];
8
+ };
9
+ export declare function fixedCountFrameCase(m: Machine): FixedCountFrameCase | undefined;
10
+ export declare function ownCountLawInstance(law: Law, at: Instances): Instances;
11
+ export declare function countFrameConditions(choice: FixedCountFrameCase): Lin[];
12
+ export type CountCutTrace = {
13
+ kind: 'frame' | 'mono';
14
+ post: string;
15
+ pre: string;
16
+ checked: boolean;
17
+ why?: string;
18
+ };
19
+ export declare function proveCountFrameGoal(raw: Goal, decls: CountDecl[], request: Pick<CountCert, 'reads' | 'insts' | 'picks' | 'lemmas'>, choice: FixedCountFrameCase, targets: ReadonlySet<string>, until: number, trace?: (cut: CountCutTrace) => void, options?: {
20
+ deferCheck?: boolean;
21
+ minimalView?: boolean;
22
+ leafUnits?: number;
23
+ trace?: (event: Record<string, unknown>) => void;
24
+ extraWhen?: Lin[];
25
+ }): CountCert | undefined;
@@ -0,0 +1,118 @@
1
+ // Untrusted, opt-in frame-first search for an explicitly fixed finite operation.
2
+ // No protocol names or values are built in. The returned certificate is checked
3
+ // against the original obligation; no inferred frame is accepted as an axiom.
4
+ import { n, same, x } from "./machine.js";
5
+ import { canon, checkMC, frameOk, framePath, mcGoal, monoOk } from "../kernel/kernel.js";
6
+ import { clock, fullRate, fullWork, grow, pastWall } from "../kernel/prove.js";
7
+ import { growCdcl } from "../kernel/cdcl.js";
8
+ import { countPrimitiveUnits } from "./count-primitive-budget.js";
9
+ import { countsForReads } from "./count-facts.js";
10
+ import { finiteCountChoice } from "./count-cases.js";
11
+ import { countSearchView, proveCountQuery } from "./count-query.js";
12
+ export function fixedCountFrameCase(m) {
13
+ const choice = finiteCountChoice(m);
14
+ if (!choice)
15
+ return;
16
+ const [name, values] = choice, fixed = new Set();
17
+ const visit = (c) => {
18
+ if (c.op === 'and') {
19
+ c.xs.forEach(visit);
20
+ return;
21
+ }
22
+ if (c.op !== '=')
23
+ return;
24
+ const [a, b] = c.a.op === 'var' ? [c.a, c.b] : [c.b, c.a];
25
+ if (a.op === 'var' && a.name === name && b.op === 'const')
26
+ fixed.add(b.value);
27
+ };
28
+ if (m.assume)
29
+ visit(m.assume);
30
+ if (fixed.size !== 1)
31
+ return;
32
+ const value = [...fixed][0];
33
+ if (!Number.isSafeInteger(value) || value < 0 || !values.has(value))
34
+ return;
35
+ return { name, value, values: [...values].sort((a, b) => a - b) };
36
+ }
37
+ export function ownCountLawInstance(law, at) {
38
+ if (!law.forall)
39
+ return at;
40
+ const tuple = [x(`${law.forall}#`), ...(law.keys ?? []).map(x)], had = at[law.name] ?? [], key = JSON.stringify(tuple);
41
+ for (let i = 0; i < had.length; i += tuple.length)
42
+ if (JSON.stringify(had.slice(i, i + tuple.length)) === key)
43
+ return at;
44
+ return { ...at, [law.name]: [...had, ...tuple] };
45
+ }
46
+ export function countFrameConditions(choice) {
47
+ const { name, value, values } = choice;
48
+ const rows = [{ [name]: 1, '1': -value }, { [name]: -1, '1': value }, ...values.filter(v => v !== value).map(v => v < value ? { [name]: -1, '1': v + 1 } : { [name]: 1, '1': 1 - v })];
49
+ const normalized = rows.map(row => Object.fromEntries(Object.entries(row).filter(([, coefficient]) => coefficient !== 0)));
50
+ return [...new Map(normalized.map(row => [canon(row), row])).values()];
51
+ }
52
+ export function proveCountFrameGoal(raw, decls, request, choice, targets, until, trace, options = {}) {
53
+ if (clock() >= until || pastWall())
54
+ return;
55
+ const goal = mcGoal(raw.hyps, decls, request), counts = countsForReads(decls, request.reads);
56
+ if (!goal || !counts)
57
+ return;
58
+ const when = [...countFrameConditions(choice), ...(options.extraWhen ?? [])], frames = [], monos = [];
59
+ const conditions = [same(x(choice.name), n(choice.value))];
60
+ for (const [post, map, key] of request.reads) {
61
+ if (!map.endsWith('#') || !targets.has(map.slice(0, -1)))
62
+ continue;
63
+ const pre = request.reads.find(r => r[1] === map.slice(0, -1) && JSON.stringify(r[2]) === JSON.stringify(key));
64
+ if (!pre)
65
+ continue;
66
+ const f = { when, post, pre: pre[0] };
67
+ const equal = frameOk(counts, f);
68
+ trace?.({ kind: 'frame', post, pre: pre[0], checked: equal });
69
+ if (equal) {
70
+ frames.push(f);
71
+ continue;
72
+ }
73
+ const postCount = counts.find(c => c.v === post), preCount = counts.find(c => c.v === pre[0]);
74
+ if (postCount.key !== preCount.key || clock() >= until || pastWall())
75
+ continue;
76
+ const auxiliary = { name: 'per-key cut', hyps: [...conditions, { op: '<', a: x(postCount.key), b: postCount.below }, { op: '<', a: preCount.body, b: postCount.body }] };
77
+ const out = grow(auxiliary, new Map(), { nodes: 0, until: Math.min(until, clock() + countPrimitiveUnits(100, options.leafUnits)) });
78
+ const cut = 'tree' in out ? { when: conditions, post, pre: pre[0], tree: out.tree } : undefined;
79
+ const checked = !!cut && monoOk(counts, cut);
80
+ trace?.({ kind: 'mono', post, pre: pre[0], checked, ...('stuck' in out ? { why: out.stuck } : {}) });
81
+ if (cut && checked)
82
+ monos.push(cut);
83
+ }
84
+ if (!frames.length && !monos.length)
85
+ return;
86
+ const minimal = options.minimalView ? countSearchView(raw, decls, request) : undefined;
87
+ const ask = (path) => {
88
+ if (clock() >= until || pastWall())
89
+ return;
90
+ if (minimal)
91
+ return proveCountQuery(goal, framePath(frames, request.lemmas ?? [], path, monos), until, { query: 'frame-leaf', minimal, leafUnits: options.leafUnits, trace: options.trace, deferCheck: options.deferCheck });
92
+ const start = fullWork(), at = framePath(frames, request.lemmas ?? [], path, monos);
93
+ const out = growCdcl(goal, at, { nodes: 0, until: Math.min(until, clock() + (options.leafUnits ?? Infinity)) });
94
+ options.trace?.({ query: 'frame-leaf', outcome: 'tree' in out ? 'proposed' : out.stuck, units: (fullWork() - start) / fullRate, remaining: until - clock(), hyps: goal.hyps.length, path: [...at.values()], ...(!('tree' in out) ? { goal } : {}) });
95
+ return 'tree' in out ? out.tree : undefined;
96
+ };
97
+ const search = (i, path) => {
98
+ if (clock() >= until || pastWall())
99
+ return;
100
+ if (i === when.length)
101
+ return ask(path);
102
+ const row = when[i], known = path.get(canon(row))?.holds;
103
+ if (known === true)
104
+ return search(i + 1, path);
105
+ if (known === false)
106
+ return ask(path);
107
+ const yes = search(i + 1, new Map(path).set(canon(row), { lin: row, holds: true }));
108
+ if (!yes)
109
+ return;
110
+ const no = ask(new Map(path).set(canon(row), { lin: row, holds: false }));
111
+ return no ? { split: row, yes, no } : undefined;
112
+ };
113
+ const tree = search(0, new Map());
114
+ if (!tree)
115
+ return;
116
+ const cert = { ...request, tree, frames, monos };
117
+ return options.deferCheck || checkMC(raw.hyps, decls, cert) ? cert : undefined;
118
+ }
@@ -0,0 +1,2 @@
1
+ import { type C } from './machine.js';
2
+ export declare function inlineFrozenGuard(flags: Readonly<Record<string, C>>, root: string): C;
@@ -0,0 +1,31 @@
1
+ // Scalar search guards use the same quantified-flag aliases as countedObligations.
2
+ // This is preprocessing, not a proof rule or an additional hypothesis.
3
+ import { n, same, walkOnce, x } from "./machine.js";
4
+ import { substC } from "../kernel/kernel.js";
5
+ export function inlineFrozenGuard(flags, root) {
6
+ const memo = new Map(), visiting = new Set();
7
+ const expand = (name) => {
8
+ const old = memo.get(name);
9
+ if (old)
10
+ return old;
11
+ if (visiting.has(name))
12
+ throw Error('cyclic guard flag ' + name);
13
+ const raw = Object.hasOwn(flags, name) ? flags[name] : undefined;
14
+ if (!raw)
15
+ throw Error('missing guard flag ' + name);
16
+ if (raw.op === 'all') {
17
+ const value = same(x('?' + name), n(1));
18
+ memo.set(name, value);
19
+ return value;
20
+ }
21
+ visiting.add(name);
22
+ const dependencies = {};
23
+ walkOnce(raw, (node) => { if (node.op === 'flag')
24
+ dependencies[node.name] = expand(node.name); });
25
+ const value = substC(raw, { vars: {}, maps: {}, flags: dependencies });
26
+ visiting.delete(name);
27
+ memo.set(name, value);
28
+ return value;
29
+ };
30
+ return expand(root);
31
+ }
@@ -0,0 +1,7 @@
1
+ export type CountGenerationResult<T> = {
2
+ complete: true;
3
+ value: T;
4
+ } | {
5
+ complete: false;
6
+ };
7
+ export declare function countGenerationPhase<T>(until: number, run: () => T): CountGenerationResult<T>;
@@ -0,0 +1,33 @@
1
+ // Optional generation phase. Legacy callers run exactly the original body.
2
+ import { BudgetExpired, budgetEnd, checkBudget, clock, fullRate, withBudget, withDeadline, withinDeadline } from "../kernel/prove.js";
3
+ import { inProxySearch } from "./search-policy.js";
4
+ import { withSearchAllowance } from "./count-search-allowance.js";
5
+ export function countGenerationPhase(until, run) {
6
+ checkBudget('generation parent entry');
7
+ const remaining = until - clock();
8
+ if (remaining <= 0)
9
+ return { complete: false };
10
+ // A proxy allowance has no owned ledger endpoint: never catch a hard refusal.
11
+ if (inProxySearch())
12
+ return withSearchAllowance(until, () => ({ complete: true, value: run() }));
13
+ // Capture the inherited endpoint while a nonrestricting budget exposes bare
14
+ // withWork caps too. Equality is parent expiry, never a local partial result.
15
+ const parentEnd = withBudget(Number.MAX_VALUE, () => withinDeadline(budgetEnd()));
16
+ let installedEnd;
17
+ try {
18
+ return withBudget(remaining * fullRate, () => {
19
+ installedEnd = withinDeadline(budgetEnd());
20
+ return withDeadline(until, () => ({ complete: true, value: run() }));
21
+ });
22
+ }
23
+ catch (error) {
24
+ if (!(error instanceof BudgetExpired))
25
+ throw error;
26
+ // A bare withWork cap has no sticky parent budget after child unwind.
27
+ // Only an endpoint strictly inside the captured parent can expire locally.
28
+ checkBudget('generation parent completion');
29
+ if (installedEnd === undefined || installedEnd >= parentEnd)
30
+ throw error;
31
+ return { complete: false };
32
+ }
33
+ }
@@ -0,0 +1,12 @@
1
+ import { type Law } from './machine.js';
2
+ import { type GuardCountContext } from './count-guard-context.js';
3
+ import { type CountRequestBuilder, type CountStrategyProof, type CountStrategyOptions } from './count-strategy.js';
4
+ import { type FixedOperationProof } from './count-case-compose.js';
5
+ export declare function proveFixedCountOperations(context: GuardCountContext, family: Law[], law: Law, until: number, requestFor: CountRequestBuilder, observe?: (event: Record<string, unknown>) => void, options?: CountStrategyOptions & {
6
+ caseOrder?: 'original' | 'cost';
7
+ }): FixedOperationProof[] | undefined;
8
+ export declare function proveCountGuardComposition(context: GuardCountContext, family: Law[], law: Law, until: number, requestFor: CountRequestBuilder, observe?: (event: Record<string, unknown>) => void, options?: CountStrategyOptions & {
9
+ checkEachCase?: boolean;
10
+ caseOrder?: 'original' | 'cost';
11
+ reindexMode?: 'offset' | 'exact';
12
+ }): CountStrategyProof | undefined;
@@ -0,0 +1,48 @@
1
+ // Optional whole-operation strategy. The caller owns one shared allowance;
2
+ // discovery selects a proposer, never a trusted fact or a protocol name.
3
+ import { all, n, same, x } from "./machine.js";
4
+ import { finiteCountChoice } from "./count-cases.js";
5
+ import { countPrimitiveUnits } from "./count-primitive-budget.js";
6
+ import { traceNow } from "./trace-clock.js";
7
+ import { orderCountOperations } from "./count-operation-order.js";
8
+ import { discoverCountRowCopy } from "./count-copy-shape.js";
9
+ import { discoverCountThresholdWrite } from "./count-write-shape.js";
10
+ import { proveFixedCountPhase } from "./count-phase.js";
11
+ import { proveFixedCountFrame } from "./count-fixed-frame.js";
12
+ import { proveCountRowCopy } from "./count-row-copy.js";
13
+ import { proveCountRowCopyLinear } from "./count-row-copy-linear.js";
14
+ import { proveCountReplacement } from "./count-replacement.js";
15
+ import { proveCountLeader } from "./count-leader.js";
16
+ import { composeCountOperationProofs } from "./count-case-compose.js";
17
+ import { clock, fullRate, fullWork, late, withDeadline } from "../kernel/prove.js";
18
+ export function proveFixedCountOperations(context, family, law, until, requestFor, observe, options = {}) {
19
+ return withDeadline(until, () => {
20
+ const choice = finiteCountChoice(context.machine);
21
+ if (!choice || late(until))
22
+ return;
23
+ const [name, values] = choice, cases = [];
24
+ const planned = [...values].map(value => {
25
+ const branch = { name, value }, write = discoverCountThresholdWrite(context.original, context.shape, branch), copy = discoverCountRowCopy(context.original, context.shape, branch);
26
+ const kind = copy ? 'copy' : write?.increment === 1 ? 'leader' : write?.increment === 0 ? 'replacement' : 'phase';
27
+ return { value, kind };
28
+ });
29
+ for (const { value, kind } of orderCountOperations(planned, options.caseOrder)) {
30
+ if (late(until))
31
+ return;
32
+ const machine = { ...context.machine, assume: all(...(context.machine.assume ? [context.machine.assume] : []), same(x(name), n(value))) }, selected = { ...context, machine }, wallStart = traceNow();
33
+ const start = fullWork(), caseOptions = { ...options, trace: (event) => observe?.({ stage: 'query', value, kind, ...event }) };
34
+ const proof = kind === 'copy' ? proveCountRowCopyLinear(machine, family, law, {}, Math.min(until, clock() + countPrimitiveUnits(1000, Infinity)), requestFor, undefined, caseOptions) ?? proveCountRowCopy(machine, family, law, {}, until, requestFor, caseOptions) : kind === 'leader' ? proveCountLeader(selected, family, law, {}, until, requestFor, undefined, caseOptions) : kind === 'replacement' ? proveCountReplacement(selected, family, law, {}, until, requestFor, undefined, caseOptions) : proveFixedCountFrame(machine, family, law, {}, until, requestFor, caseOptions) ?? proveFixedCountPhase(machine, family, law, {}, until, requestFor, undefined, caseOptions);
35
+ observe?.({ stage: 'operation', value, kind, proposed: !!proof, checked: !!proof && !options.deferToComposition, units: (fullWork() - start) / fullRate, wallMs: traceNow() - wallStart, remaining: until - clock(), ...(proof ? { premises: Object.keys(proof.instances).filter(name => family.some(law => law.name === name)) } : {}) });
36
+ if (!proof)
37
+ return;
38
+ cases.push({ value, proof });
39
+ }
40
+ return cases;
41
+ });
42
+ }
43
+ export function proveCountGuardComposition(context, family, law, until, requestFor, observe, options = {}) {
44
+ return withDeadline(until, () => {
45
+ const cases = proveFixedCountOperations(context, family, law, until, requestFor, observe, { ...options, deferToComposition: !options.checkEachCase });
46
+ return cases && composeCountOperationProofs(context, family, law, cases, until, requestFor, (stage, value) => observe?.({ stage, value }), { reindexMode: options.reindexMode, trace: observe, minimize: options.minimize, reindexFactsOnly: options.reindexFactsOnly, familyProposal: options.familyProposal });
47
+ });
48
+ }
@@ -0,0 +1,11 @@
1
+ import { type Law, type Machine } from './machine.js';
2
+ import { type CountGuardShape } from './count-guard-shape.js';
3
+ import { type Restriction } from './count-restrictions.js';
4
+ export type GuardCountContext = {
5
+ original: Machine;
6
+ machine: Machine;
7
+ shape: CountGuardShape;
8
+ restrictions: Restriction[];
9
+ inputCounts: Record<string, string>;
10
+ };
11
+ export declare function prepareGuardCountContext(original: Machine, law: Law, family: readonly Law[]): GuardCountContext | undefined;
@@ -0,0 +1,50 @@
1
+ // One conservative definition extension, shared by every operation case.
2
+ // This prepares syntax only; no discovered relationship becomes an assumption.
3
+ import { walkOnce } from "./machine.js";
4
+ import { discoverCountGuardShape } from "./count-guard-shape.js";
5
+ import { restrictedCounts } from "./count-restrictions.js";
6
+ export function prepareGuardCountContext(original, law, family) {
7
+ const shape = discoverCountGuardShape(original, law, family);
8
+ if (!shape)
9
+ return;
10
+ const inputCounts = {}, selected = [shape.voteMap, shape.rowMap];
11
+ for (const input of original.inputMaps ?? []) {
12
+ const found = Object.entries(original.counts ?? {}).filter(([, d]) => {
13
+ if (d.base || d.body.op !== 'if' || d.body.then.op !== 'const' || d.body.then.value !== 1 || d.body.else.op !== 'const' || d.body.else.value !== 0)
14
+ return false;
15
+ const fields = new Set();
16
+ walkOnce(d.body, (node) => { if (node.op === 'get')
17
+ fields.add(node.map); });
18
+ return fields.size === 1 && fields.has(input);
19
+ });
20
+ if (found.length !== 1)
21
+ return;
22
+ inputCounts[input] = found[0][0];
23
+ selected.push(found[0][0]);
24
+ }
25
+ if (selected.length * (original.inputMaps?.length ?? 0) > 128)
26
+ return;
27
+ const reserved = new Set([...original.params, ...original.inputs, ...Object.keys(original.fns ?? {}), ...Object.keys(original.step.flags ?? {})]);
28
+ for (const base of selected)
29
+ for (const input of original.inputMaps ?? []) {
30
+ const name = `${base}$restricted$${input}`;
31
+ if (reserved.has(name) || reserved.has(name + '$not'))
32
+ return;
33
+ }
34
+ try {
35
+ // Reuse only exact definitions installed at the admission boundary. A name
36
+ // collision is never permission to replace a user count or add a premise.
37
+ const planned = new Set(selected.flatMap(base => (original.inputMaps ?? []).flatMap(input => [`${base}$restricted$${input}`, `${base}$restricted$${input}$not`])));
38
+ const source = { ...original, counts: Object.fromEntries(Object.entries(original.counts ?? {}).filter(([name]) => !planned.has(name))) };
39
+ const extended = restrictedCounts(source, selected, 128, shape.memberKey);
40
+ for (const name of planned)
41
+ if (original.counts?.[name] && JSON.stringify(original.counts[name]) !== JSON.stringify(extended.machine.counts?.[name]))
42
+ return;
43
+ const added = Object.keys(extended.machine.counts ?? {}).some(name => !original.counts?.[name]);
44
+ const machine = added ? { ...original, counts: { ...original.counts, ...extended.machine.counts } } : original;
45
+ return { original, machine, shape, restrictions: extended.entries, inputCounts };
46
+ }
47
+ catch {
48
+ return;
49
+ }
50
+ }
@@ -0,0 +1,50 @@
1
+ import { type C, type E } from './machine.js';
2
+ import { type CountCert, type CountDecl, type Goal, type LinCut, type MapRead, type Tree } from '../kernel/kernel.js';
3
+ export type GuardCountProposal = {
4
+ name: string;
5
+ kind: string;
6
+ when: C[];
7
+ terms: [number, string][];
8
+ };
9
+ export type CheckedGuardCountFact = {
10
+ proposal: GuardCountProposal;
11
+ claim: C;
12
+ goal: Goal;
13
+ cert: CountCert;
14
+ };
15
+ export type CheckedGuardLinearFact = {
16
+ proposal: GuardCountProposal;
17
+ goal: Goal;
18
+ cut: LinCut;
19
+ status?: 'unchecked';
20
+ };
21
+ export type GuardCountTrace = {
22
+ outcome: string;
23
+ encoded?: Goal;
24
+ witness?: Record<string, number>;
25
+ broken?: unknown;
26
+ searchEnd?: number;
27
+ minimal?: {
28
+ kind: string;
29
+ fallback: boolean;
30
+ units: number;
31
+ fallbackUnits: number;
32
+ };
33
+ };
34
+ export type GuardBodyProposal = {
35
+ name: string;
36
+ kind: 'excluded-body-frame';
37
+ when: C[];
38
+ pre: E;
39
+ post: E;
40
+ };
41
+ export type CheckedGuardBodyFact = {
42
+ proposal: GuardBodyProposal;
43
+ goal: Goal;
44
+ tree: Tree;
45
+ };
46
+ export declare function guardCountFact(premises: C[], decls: CountDecl[], reads: MapRead[], proposal: GuardCountProposal, wit: string, until: number, observe?: (trace: GuardCountTrace) => void): CheckedGuardCountFact | undefined;
47
+ export declare function guardLinearFact(decls: CountDecl[], reads: MapRead[], proposal: GuardCountProposal, until: number, observe?: (trace: GuardCountTrace) => void, search?: 'grow' | 'cdcl', options?: {
48
+ deferCheck?: boolean;
49
+ }): CheckedGuardLinearFact | undefined;
50
+ export declare function guardBodyFact(proposal: GuardBodyProposal, until: number): CheckedGuardBodyFact | undefined;