gdp-wired 0.47.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.
- package/README.md +17 -6
- package/dist/core/bmc.js +10 -7
- package/dist/core/carry.d.ts +15 -0
- package/dist/core/carry.js +651 -0
- package/dist/core/check.js +7 -2
- package/dist/core/cli.d.ts +3 -1
- package/dist/core/cli.js +28 -8
- package/dist/core/count-attempt-work.d.ts +29 -0
- package/dist/core/count-attempt-work.js +96 -0
- package/dist/core/count-boolean-partition.d.ts +5 -0
- package/dist/core/count-boolean-partition.js +47 -0
- package/dist/core/count-bounded-quotient.d.ts +2 -0
- package/dist/core/count-bounded-quotient.js +13 -0
- package/dist/core/count-case-compose.d.ts +20 -0
- package/dist/core/count-case-compose.js +289 -0
- package/dist/core/count-cases.d.ts +24 -0
- package/dist/core/count-cases.js +321 -0
- package/dist/core/count-cert-grow.d.ts +4 -0
- package/dist/core/count-cert-grow.js +37 -0
- package/dist/core/count-cert-rename.d.ts +10 -0
- package/dist/core/count-cert-rename.js +69 -0
- package/dist/core/count-cert-transport.d.ts +11 -0
- package/dist/core/count-cert-transport.js +109 -0
- package/dist/core/count-certificate-minimize.d.ts +57 -0
- package/dist/core/count-certificate-minimize.js +263 -0
- package/dist/core/count-closed-family.d.ts +32 -0
- package/dist/core/count-closed-family.js +143 -0
- package/dist/core/count-closing-budget.d.ts +10 -0
- package/dist/core/count-closing-budget.js +49 -0
- package/dist/core/count-closing-needs.d.ts +5 -0
- package/dist/core/count-closing-needs.js +9 -0
- package/dist/core/count-completion.d.ts +9 -0
- package/dist/core/count-completion.js +27 -0
- package/dist/core/count-component-budget.d.ts +5 -0
- package/dist/core/count-component-budget.js +9 -0
- package/dist/core/count-copy-shape.d.ts +11 -0
- package/dist/core/count-copy-shape.js +40 -0
- package/dist/core/count-cubes.d.ts +8 -0
- package/dist/core/count-cubes.js +69 -0
- package/dist/core/count-demand.d.ts +37 -0
- package/dist/core/count-demand.js +361 -0
- package/dist/core/count-disjoint-funding.d.ts +75 -0
- package/dist/core/count-disjoint-funding.js +284 -0
- package/dist/core/count-emitter-frame-pool.d.ts +23 -0
- package/dist/core/count-emitter-frame-pool.js +87 -0
- package/dist/core/count-facts.d.ts +52 -0
- package/dist/core/count-facts.js +247 -0
- package/dist/core/count-final-step.d.ts +5 -0
- package/dist/core/count-final-step.js +20 -0
- package/dist/core/count-fixed-frame.d.ts +4 -0
- package/dist/core/count-fixed-frame.js +30 -0
- package/dist/core/count-focus-proof.d.ts +8 -0
- package/dist/core/count-focus-proof.js +140 -0
- package/dist/core/count-focused.d.ts +22 -0
- package/dist/core/count-focused.js +676 -0
- package/dist/core/count-frames.d.ts +25 -0
- package/dist/core/count-frames.js +118 -0
- package/dist/core/count-frozen-guard.d.ts +2 -0
- package/dist/core/count-frozen-guard.js +31 -0
- package/dist/core/count-generation-phase.d.ts +7 -0
- package/dist/core/count-generation-phase.js +33 -0
- package/dist/core/count-guard-composition.d.ts +12 -0
- package/dist/core/count-guard-composition.js +48 -0
- package/dist/core/count-guard-context.d.ts +11 -0
- package/dist/core/count-guard-context.js +50 -0
- package/dist/core/count-guard-facts.d.ts +50 -0
- package/dist/core/count-guard-facts.js +97 -0
- package/dist/core/count-guard-proposals.d.ts +7 -0
- package/dist/core/count-guard-proposals.js +106 -0
- package/dist/core/count-guard-shape.d.ts +18 -0
- package/dist/core/count-guard-shape.js +100 -0
- package/dist/core/count-guard-tree.d.ts +17 -0
- package/dist/core/count-guard-tree.js +125 -0
- package/dist/core/count-leader-facts.d.ts +10 -0
- package/dist/core/count-leader-facts.js +52 -0
- package/dist/core/count-leader.d.ts +10 -0
- package/dist/core/count-leader.js +331 -0
- package/dist/core/count-lemma-transport.d.ts +8 -0
- package/dist/core/count-lemma-transport.js +47 -0
- package/dist/core/count-lifted-budget.d.ts +54 -0
- package/dist/core/count-lifted-budget.js +97 -0
- package/dist/core/count-lifted-copy.d.ts +3 -0
- package/dist/core/count-lifted-copy.js +166 -0
- package/dist/core/count-lifted-increment.d.ts +3 -0
- package/dist/core/count-lifted-increment.js +146 -0
- package/dist/core/count-lifted-load.d.ts +5 -0
- package/dist/core/count-lifted-load.js +179 -0
- package/dist/core/count-lifted-prerequisite.d.ts +14 -0
- package/dist/core/count-lifted-prerequisite.js +53 -0
- package/dist/core/count-lifted-replacement.d.ts +3 -0
- package/dist/core/count-lifted-replacement.js +540 -0
- package/dist/core/count-lifted-shape.d.ts +63 -0
- package/dist/core/count-lifted-shape.js +115 -0
- package/dist/core/count-lifted-strategy.d.ts +7 -0
- package/dist/core/count-lifted-strategy.js +226 -0
- package/dist/core/count-lifted-transports.d.ts +32 -0
- package/dist/core/count-lifted-transports.js +293 -0
- package/dist/core/count-load-shape.d.ts +17 -0
- package/dist/core/count-load-shape.js +67 -0
- package/dist/core/count-minimal-view.d.ts +26 -0
- package/dist/core/count-minimal-view.js +46 -0
- package/dist/core/count-operation-observation.d.ts +9 -0
- package/dist/core/count-operation-observation.js +22 -0
- package/dist/core/count-operation-order.d.ts +5 -0
- package/dist/core/count-operation-order.js +4 -0
- package/dist/core/count-phase.d.ts +9 -0
- package/dist/core/count-phase.js +127 -0
- package/dist/core/count-premise-search.d.ts +9 -0
- package/dist/core/count-premise-search.js +41 -0
- package/dist/core/count-premise-view.d.ts +19 -0
- package/dist/core/count-premise-view.js +220 -0
- package/dist/core/count-prerequisite-components.d.ts +67 -0
- package/dist/core/count-prerequisite-components.js +239 -0
- package/dist/core/count-prerequisite-memory.d.ts +24 -0
- package/dist/core/count-prerequisite-memory.js +37 -0
- package/dist/core/count-prerequisite-plan.d.ts +12 -0
- package/dist/core/count-prerequisite-plan.js +88 -0
- package/dist/core/count-primitive-budget.d.ts +1 -0
- package/dist/core/count-primitive-budget.js +8 -0
- package/dist/core/count-project-free.d.ts +3 -0
- package/dist/core/count-project-free.js +24 -0
- package/dist/core/count-project-witness.d.ts +4 -0
- package/dist/core/count-project-witness.js +48 -0
- package/dist/core/count-proof-rescope.d.ts +14 -0
- package/dist/core/count-proof-rescope.js +71 -0
- package/dist/core/count-proof-scope.d.ts +68 -0
- package/dist/core/count-proof-scope.js +333 -0
- package/dist/core/count-prune-owned-root.d.ts +5 -0
- package/dist/core/count-prune-owned-root.js +27 -0
- package/dist/core/count-query-context.d.ts +3 -0
- package/dist/core/count-query-context.js +7 -0
- package/dist/core/count-query.d.ts +15 -0
- package/dist/core/count-query.js +59 -0
- package/dist/core/count-quorum-leaf.d.ts +9 -0
- package/dist/core/count-quorum-leaf.js +38 -0
- package/dist/core/count-ranges.d.ts +5 -0
- package/dist/core/count-ranges.js +65 -0
- package/dist/core/count-reachability-budget.d.ts +1 -0
- package/dist/core/count-reachability-budget.js +7 -0
- package/dist/core/count-reachability-reconcile.d.ts +11 -0
- package/dist/core/count-reachability-reconcile.js +19 -0
- package/dist/core/count-reachability.d.ts +50 -0
- package/dist/core/count-reachability.js +351 -0
- package/dist/core/count-rebase-path.d.ts +9 -0
- package/dist/core/count-rebase-path.js +68 -0
- package/dist/core/count-recipe-context.d.ts +45 -0
- package/dist/core/count-recipe-context.js +71 -0
- package/dist/core/count-recipe-controller.d.ts +115 -0
- package/dist/core/count-recipe-controller.js +417 -0
- package/dist/core/count-recipe-graph.d.ts +36 -0
- package/dist/core/count-recipe-graph.js +211 -0
- package/dist/core/count-recovery/action-guard.d.ts +5 -0
- package/dist/core/count-recovery/action-guard.js +51 -0
- package/dist/core/count-recovery/boolean-core.d.ts +16 -0
- package/dist/core/count-recovery/boolean-core.js +258 -0
- package/dist/core/count-recovery/carried-case.d.ts +2 -0
- package/dist/core/count-recovery/carried-case.js +24 -0
- package/dist/core/count-recovery/conditional-check-cache.d.ts +23 -0
- package/dist/core/count-recovery/conditional-check-cache.js +131 -0
- package/dist/core/count-recovery/conditional-cuts.d.ts +6 -0
- package/dist/core/count-recovery/conditional-cuts.js +319 -0
- package/dist/core/count-recovery/conditional-proof.d.ts +53 -0
- package/dist/core/count-recovery/conditional-proof.js +348 -0
- package/dist/core/count-recovery/derivability-closure.d.ts +14 -0
- package/dist/core/count-recovery/derivability-closure.js +534 -0
- package/dist/core/count-recovery/empty-count-source.d.ts +2 -0
- package/dist/core/count-recovery/empty-count-source.js +40 -0
- package/dist/core/count-recovery/field-bound-lemmas.d.ts +23 -0
- package/dist/core/count-recovery/field-bound-lemmas.js +640 -0
- package/dist/core/count-recovery/field-case.d.ts +5 -0
- package/dist/core/count-recovery/field-case.js +89 -0
- package/dist/core/count-recovery/field-demand.d.ts +46 -0
- package/dist/core/count-recovery/field-demand.js +47 -0
- package/dist/core/count-recovery/field-only.d.ts +3 -0
- package/dist/core/count-recovery/field-only.js +18 -0
- package/dist/core/count-recovery/fold-path.d.ts +6 -0
- package/dist/core/count-recovery/fold-path.js +35 -0
- package/dist/core/count-recovery/frame-lemmas.d.ts +9 -0
- package/dist/core/count-recovery/frame-lemmas.js +120 -0
- package/dist/core/count-recovery/guard-cases.d.ts +12 -0
- package/dist/core/count-recovery/guard-cases.js +139 -0
- package/dist/core/count-recovery/key-closure.d.ts +14 -0
- package/dist/core/count-recovery/key-closure.js +62 -0
- package/dist/core/count-recovery/leaf-allowance.d.ts +4 -0
- package/dist/core/count-recovery/leaf-allowance.js +7 -0
- package/dist/core/count-recovery/lift-count-proxies.d.ts +6 -0
- package/dist/core/count-recovery/lift-count-proxies.js +175 -0
- package/dist/core/count-recovery/live-dependencies.d.ts +6 -0
- package/dist/core/count-recovery/live-dependencies.js +76 -0
- package/dist/core/count-recovery/member-inclusions.d.ts +11 -0
- package/dist/core/count-recovery/member-inclusions.js +168 -0
- package/dist/core/count-recovery/member-premises.d.ts +29 -0
- package/dist/core/count-recovery/member-premises.js +114 -0
- package/dist/core/count-recovery/natural-cases.d.ts +6 -0
- package/dist/core/count-recovery/natural-cases.js +59 -0
- package/dist/core/count-recovery/ops.d.ts +6 -0
- package/dist/core/count-recovery/ops.js +8 -0
- package/dist/core/count-recovery/pre-state-source.d.ts +8 -0
- package/dist/core/count-recovery/pre-state-source.js +18 -0
- package/dist/core/count-recovery/rebase-path.d.ts +9 -0
- package/dist/core/count-recovery/rebase-path.js +70 -0
- package/dist/core/count-recovery/reframe-tree.d.ts +2 -0
- package/dist/core/count-recovery/reframe-tree.js +24 -0
- package/dist/core/count-recovery/rename-proof.d.ts +2 -0
- package/dist/core/count-recovery/rename-proof.js +102 -0
- package/dist/core/count-recovery/replay-linear-skeleton.d.ts +2 -0
- package/dist/core/count-recovery/replay-linear-skeleton.js +28 -0
- package/dist/core/count-recovery/row-cases.d.ts +16 -0
- package/dist/core/count-recovery/row-cases.js +292 -0
- package/dist/core/count-recovery/scalar-guards.d.ts +7 -0
- package/dist/core/count-recovery/scalar-guards.js +291 -0
- package/dist/core/count-recovery/source-memo.d.ts +12 -0
- package/dist/core/count-recovery/source-memo.js +67 -0
- package/dist/core/count-rejection-budget.d.ts +8 -0
- package/dist/core/count-rejection-budget.js +15 -0
- package/dist/core/count-replacement.d.ts +5 -0
- package/dist/core/count-replacement.js +129 -0
- package/dist/core/count-replay-diagnostic.d.ts +21 -0
- package/dist/core/count-replay-diagnostic.js +49 -0
- package/dist/core/count-replay-skeleton.d.ts +4 -0
- package/dist/core/count-replay-skeleton.js +28 -0
- package/dist/core/count-rescope-funding.d.ts +3 -0
- package/dist/core/count-rescope-funding.js +17 -0
- package/dist/core/count-restrictions.d.ts +11 -0
- package/dist/core/count-restrictions.js +31 -0
- package/dist/core/count-retry-budget.d.ts +67 -0
- package/dist/core/count-retry-budget.js +114 -0
- package/dist/core/count-retry-round.d.ts +24 -0
- package/dist/core/count-retry-round.js +44 -0
- package/dist/core/count-row-agreement.d.ts +35 -0
- package/dist/core/count-row-agreement.js +270 -0
- package/dist/core/count-row-aliases.d.ts +3 -0
- package/dist/core/count-row-aliases.js +59 -0
- package/dist/core/count-row-composition.d.ts +6 -0
- package/dist/core/count-row-composition.js +55 -0
- package/dist/core/count-row-copy-linear.d.ts +4 -0
- package/dist/core/count-row-copy-linear.js +83 -0
- package/dist/core/count-row-copy.d.ts +4 -0
- package/dist/core/count-row-copy.js +94 -0
- package/dist/core/count-row-policy.d.ts +3 -0
- package/dist/core/count-row-policy.js +56 -0
- package/dist/core/count-row-reindex.d.ts +11 -0
- package/dist/core/count-row-reindex.js +126 -0
- package/dist/core/count-row-support.d.ts +9 -0
- package/dist/core/count-row-support.js +42 -0
- package/dist/core/count-row-symmetry.d.ts +7 -0
- package/dist/core/count-row-symmetry.js +100 -0
- package/dist/core/count-scope-hyps.d.ts +2 -0
- package/dist/core/count-scope-hyps.js +163 -0
- package/dist/core/count-scope-row-reuse.d.ts +3 -0
- package/dist/core/count-scope-row-reuse.js +92 -0
- package/dist/core/count-search-allowance.d.ts +1 -0
- package/dist/core/count-search-allowance.js +17 -0
- package/dist/core/count-select.d.ts +16 -0
- package/dist/core/count-select.js +24 -0
- package/dist/core/count-stabilize-tree.d.ts +9 -0
- package/dist/core/count-stabilize-tree.js +35 -0
- package/dist/core/count-stage-trace.d.ts +8 -0
- package/dist/core/count-stage-trace.js +45 -0
- package/dist/core/count-strategies.d.ts +16 -0
- package/dist/core/count-strategies.js +155 -0
- package/dist/core/count-strategy-premises.d.ts +5 -0
- package/dist/core/count-strategy-premises.js +14 -0
- package/dist/core/count-strategy.d.ts +41 -0
- package/dist/core/count-strategy.js +76 -0
- package/dist/core/count-support.d.ts +598 -0
- package/dist/core/count-support.js +2081 -0
- package/dist/core/count-tier-budget.d.ts +14 -0
- package/dist/core/count-tier-budget.js +64 -0
- package/dist/core/count-unions.d.ts +2 -0
- package/dist/core/count-unions.js +139 -0
- package/dist/core/count-unwritten-prefix.d.ts +24 -0
- package/dist/core/count-unwritten-prefix.js +97 -0
- package/dist/core/count-witness-flags.d.ts +9 -0
- package/dist/core/count-witness-flags.js +37 -0
- package/dist/core/count-write-frames.d.ts +12 -0
- package/dist/core/count-write-frames.js +206 -0
- package/dist/core/count-write-shape.d.ts +15 -0
- package/dist/core/count-write-shape.js +73 -0
- package/dist/core/counts.d.ts +49 -7
- package/dist/core/counts.js +1679 -165
- package/dist/core/cycles.js +5 -4
- package/dist/core/cyclic.js +11 -10
- package/dist/core/data.js +16 -15
- package/dist/core/dsl-deadline.d.ts +3 -0
- package/dist/core/dsl-deadline.js +27 -0
- package/dist/core/dsl.d.ts +59 -6
- package/dist/core/dsl.js +459 -112
- package/dist/core/effect.js +8 -1
- package/dist/core/evaluation-admission.d.ts +1 -0
- package/dist/core/evaluation-admission.js +3 -0
- package/dist/core/exists.d.ts +7 -2
- package/dist/core/exists.js +131 -24
- package/dist/core/extract-check.d.ts +7 -1
- package/dist/core/extract-check.js +130 -13
- package/dist/core/extract-read.d.ts +22 -8
- package/dist/core/extract-read.js +29 -11
- package/dist/core/extract-shapes.js +122 -41
- package/dist/core/extract-standalone.js +53 -9
- package/dist/core/extract.js +9 -3
- package/dist/core/field-laws.d.ts +4 -0
- package/dist/core/field-laws.js +238 -0
- package/dist/core/finite-frontiers.d.ts +5 -0
- package/dist/core/finite-frontiers.js +116 -0
- package/dist/core/finite-houdini.d.ts +58 -0
- package/dist/core/finite-houdini.js +502 -0
- package/dist/core/finite-model.d.ts +13 -0
- package/dist/core/finite-model.js +68 -0
- package/dist/core/finite-tiny.d.ts +72 -0
- package/dist/core/finite-tiny.js +1080 -0
- package/dist/core/fixtures/count-completion/paxos-decision.json +1 -0
- package/dist/core/fresh.js +5 -1
- package/dist/core/infer.d.ts +1 -1
- package/dist/core/infer.js +76 -38
- package/dist/core/kind.js +2 -1
- package/dist/core/laws.d.ts +2 -1
- package/dist/core/laws.js +47 -14
- package/dist/core/lemma-cuts.d.ts +38 -0
- package/dist/core/lemma-cuts.js +366 -0
- package/dist/core/linear-admission.d.ts +14 -0
- package/dist/core/linear-admission.js +151 -0
- package/dist/core/machine.d.ts +44 -4
- package/dist/core/machine.js +342 -63
- package/dist/core/meter.d.ts +22 -0
- package/dist/core/meter.js +34 -0
- package/dist/core/mutate.d.ts +55 -0
- package/dist/core/mutate.js +210 -0
- package/dist/core/native-domain.d.ts +6 -0
- package/dist/core/native-domain.js +114 -0
- package/dist/core/native-law.d.ts +3 -0
- package/dist/core/native-law.js +174 -0
- package/dist/core/nonterm.js +4 -3
- package/dist/core/prover-row-budget.d.ts +3 -0
- package/dist/core/prover-row-budget.js +106 -0
- package/dist/core/quorum-laws.d.ts +25 -0
- package/dist/core/quorum-laws.js +263 -0
- package/dist/core/rationals.js +3 -2
- package/dist/core/rejection-discovery.d.ts +34 -0
- package/dist/core/rejection-discovery.js +36 -0
- package/dist/core/rejection-stage.d.ts +39 -0
- package/dist/core/rejection-stage.js +205 -0
- package/dist/core/relational.js +10 -2
- package/dist/core/relevance.d.ts +4 -0
- package/dist/core/relevance.js +79 -0
- package/dist/core/request-quotient.d.ts +8 -0
- package/dist/core/request-quotient.js +299 -0
- package/dist/core/row-agreement-shape.d.ts +15 -0
- package/dist/core/row-agreement-shape.js +68 -0
- package/dist/core/runtime-wall.d.ts +5 -0
- package/dist/core/runtime-wall.js +4 -0
- package/dist/core/sample-step.d.ts +16 -0
- package/dist/core/sample-step.js +28 -0
- package/dist/core/search-policy.d.ts +15 -0
- package/dist/core/search-policy.js +68 -0
- package/dist/core/solver.d.ts +1 -1
- package/dist/core/solver.js +40 -6
- package/dist/core/source-check.d.ts +44 -0
- package/dist/core/source-check.js +126 -0
- package/dist/core/source-diagnostic.d.ts +1 -0
- package/dist/core/source-diagnostic.js +34 -0
- package/dist/core/step-work.d.ts +12 -0
- package/dist/core/step-work.js +14 -0
- package/dist/core/strategy-premises.d.ts +8 -0
- package/dist/core/strategy-premises.js +64 -0
- package/dist/core/support-budget.d.ts +2 -0
- package/dist/core/support-budget.js +6 -0
- package/dist/core/system.js +6 -3
- package/dist/core/table-admission.d.ts +1 -0
- package/dist/core/table-admission.js +3 -0
- package/dist/core/trace-clock.d.ts +3 -0
- package/dist/core/trace-clock.js +16 -0
- package/dist/core/transfer.js +3 -2
- package/dist/core/translate.js +16 -3
- package/dist/core/wall.d.ts +11 -0
- package/dist/core/wall.js +37 -0
- package/dist/core/watch.d.ts +1 -1
- package/dist/core/watch.js +15 -2
- package/dist/core/work-admission.d.ts +164 -0
- package/dist/core/work-admission.js +418 -0
- package/dist/core/work-amount.d.ts +21 -0
- package/dist/core/work-amount.js +80 -0
- package/dist/core/work-collections.d.ts +11 -0
- package/dist/core/work-collections.js +198 -0
- package/dist/core/work-kinds.d.ts +11 -0
- package/dist/core/work-kinds.js +9 -0
- package/dist/core/work-meter.d.ts +8 -0
- package/dist/core/work-meter.js +83 -0
- package/dist/core/work-observe.d.ts +12 -0
- package/dist/core/work-observe.js +39 -0
- package/dist/core/work-profile.d.ts +10 -0
- package/dist/core/work-profile.js +21 -0
- package/dist/core/work-refusal.d.ts +1 -0
- package/dist/core/work-refusal.js +6 -0
- package/dist/interchange/format.js +2 -0
- package/dist/kernel/cdcl.d.ts +4 -0
- package/dist/kernel/cdcl.js +109 -41
- package/dist/kernel/epr.js +23 -8
- package/dist/kernel/kernel.d.ts +56 -0
- package/dist/kernel/kernel.js +466 -64
- package/dist/kernel/model-sequence.d.ts +2 -2
- package/dist/kernel/model-sequence.js +4 -3
- package/dist/kernel/model-values.d.ts +2 -0
- package/dist/kernel/model-values.js +60 -0
- package/dist/kernel/prove.d.ts +59 -3
- package/dist/kernel/prove.js +524 -130
- package/dist/kernel/prover-rows.d.ts +30 -0
- package/dist/kernel/prover-rows.js +125 -0
- package/dist/kernel/reader.d.ts +1 -1
- package/dist/kernel/reader.js +57 -12
- package/dist/kernel/simplex.js +9 -2
- package/dist/lean-kernel/emit.d.ts +47 -2
- package/dist/lean-kernel/emit.js +270 -36
- package/dist/lean-kernel/lean-terms.d.ts +1 -0
- package/dist/lean-kernel/lean-terms.js +13 -5
- package/dist/lean-kernel/legacy-family-library.d.ts +1 -0
- package/dist/lean-kernel/legacy-family-library.js +5 -0
- package/dist/lean-kernel/library.js +4 -0
- package/dist/lean-kernel/qalpha.d.ts +7 -0
- package/dist/lean-kernel/qalpha.js +40 -0
- package/package.json +5 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
// Section46.17 NEXT-PIN API ONLY: not selected by the production controller.
|
|
2
|
+
// The interim production policy remains planCountRetry with the narrow cap fix.
|
|
3
|
+
// Callers must split their callback into explicit body/case segments; this API
|
|
4
|
+
// neither suspends ledger endpoints nor attributes work merely by its label.
|
|
5
|
+
import { BudgetExpired, workLedger } from "./work-admission.js";
|
|
6
|
+
import { compareWork, workAdd, workShare, workSub, zeroWork } from "./work-amount.js";
|
|
7
|
+
import { countAttemptStop } from "./count-retry-budget.js";
|
|
8
|
+
// Identity metadata only: this never grants work or creates a ticket.
|
|
9
|
+
export function countDisjointContext(instance, bank = workLedger) {
|
|
10
|
+
const parent = bank.currentScope();
|
|
11
|
+
if (!parent || !bank.inBudget())
|
|
12
|
+
throw Error('disjoint count context needs an existing root');
|
|
13
|
+
return Object.freeze({ instance, bank, parentId: parent.id, parentEpoch: bank.snapshot().scopeEpoch, started: instance.snapshot().started });
|
|
14
|
+
}
|
|
15
|
+
function sameContext(context, instance, bank) {
|
|
16
|
+
return context.instance === instance && context.bank === bank && context.started === instance.snapshot().started
|
|
17
|
+
&& context.parentId === bank.currentScope()?.id && context.parentEpoch === bank.snapshot().scopeEpoch;
|
|
18
|
+
}
|
|
19
|
+
const limit = 1n << 4096n;
|
|
20
|
+
const valid = (n) => n.den > 0n && n.num >= 0n && n.den <= limit && n.num <= limit;
|
|
21
|
+
export function planDisjointCountRound(caps, body0, history, tickets, stop, bank = workLedger) {
|
|
22
|
+
bank.start('ticks', 1, 'disjoint count plan header');
|
|
23
|
+
if (!bank.inBudget())
|
|
24
|
+
return { kind: 'refused', reason: 'root' };
|
|
25
|
+
if (tickets.snapshot().terminal || tickets.snapshot().remaining === 0)
|
|
26
|
+
return { kind: 'refused', reason: 'tickets' };
|
|
27
|
+
if (!caps.cases.size || caps.cases.size > 63 || history.length > 7 || !valid(caps.leaf) || caps.leaf.num === 0n || !valid(body0))
|
|
28
|
+
return { kind: 'refused', reason: 'inventory' };
|
|
29
|
+
const cases = new Map();
|
|
30
|
+
let leaf = caps.leaf, total = zeroWork, minimumBody = body0;
|
|
31
|
+
if (stop && stop.kind !== 'soft-slice')
|
|
32
|
+
return { kind: 'refused', reason: 'stop' };
|
|
33
|
+
if (stop && stop.rootEpoch !== bank.snapshot().rootEpoch)
|
|
34
|
+
return { kind: 'refused', reason: 'root' };
|
|
35
|
+
let found = !stop;
|
|
36
|
+
for (const [key, cap] of caps.cases) {
|
|
37
|
+
bank.start('ticks', 1, 'disjoint count case validation');
|
|
38
|
+
if (!key || key.length > 256 || key === 'leaf' || key === 'body' || !valid(cap) || cap.num === 0n)
|
|
39
|
+
return { kind: 'refused', reason: 'inventory' };
|
|
40
|
+
if (stop?.key === key) {
|
|
41
|
+
if (compareWork(stop.allocation, cap) !== 0)
|
|
42
|
+
return { kind: 'refused', reason: 'stop' };
|
|
43
|
+
found = true;
|
|
44
|
+
}
|
|
45
|
+
const next = stop?.key === key ? workShare(cap, 2n, 1n) : cap;
|
|
46
|
+
cases.set(key, next);
|
|
47
|
+
total = workAdd(total, next);
|
|
48
|
+
}
|
|
49
|
+
if (stop?.key === 'leaf') {
|
|
50
|
+
if (compareWork(stop.allocation, leaf) !== 0 || !stop.caseKey || !cases.has(stop.caseKey))
|
|
51
|
+
return { kind: 'refused', reason: 'parent' };
|
|
52
|
+
leaf = workShare(leaf, 2n, 1n);
|
|
53
|
+
if (compareWork(leaf, cases.get(stop.caseKey)) > 0)
|
|
54
|
+
return { kind: 'refused', reason: 'parent' };
|
|
55
|
+
found = true;
|
|
56
|
+
}
|
|
57
|
+
if (!found)
|
|
58
|
+
return { kind: 'refused', reason: 'stop' };
|
|
59
|
+
let completed = false;
|
|
60
|
+
for (const entry of history) {
|
|
61
|
+
bank.start('ticks', 1, 'disjoint count body history');
|
|
62
|
+
if (!valid(entry.used) || entry.instance !== tickets || entry.rootEpoch !== bank.snapshot().rootEpoch)
|
|
63
|
+
return { kind: 'refused', reason: 'inventory' };
|
|
64
|
+
if (entry.completed && (!completed || compareWork(entry.used, minimumBody) > 0)) {
|
|
65
|
+
minimumBody = entry.used;
|
|
66
|
+
completed = true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// Read H only after every paid preparation step. It already intersects every
|
|
70
|
+
// live ancestor and outstanding reservation; no caller-supplied H is trusted.
|
|
71
|
+
const headroom = bank.available();
|
|
72
|
+
if (headroom === null)
|
|
73
|
+
return { kind: 'refused', reason: 'root' };
|
|
74
|
+
if (compareWork(workAdd(total, minimumBody), headroom) > 0)
|
|
75
|
+
return { kind: 'refused', reason: 'headroom' };
|
|
76
|
+
return Object.freeze({ kind: 'admitted', caps: { cases, leaf }, body: workSub(headroom, total), minimumBody, need: headroom, rootEpoch: bank.snapshot().rootEpoch, context: countDisjointContext(tickets, bank) });
|
|
77
|
+
}
|
|
78
|
+
export class CountFundingOwners {
|
|
79
|
+
plan;
|
|
80
|
+
bank;
|
|
81
|
+
completion;
|
|
82
|
+
failedSlice;
|
|
83
|
+
get slices() { return this.failedSlice ? [this.failedSlice] : []; }
|
|
84
|
+
active;
|
|
85
|
+
ending = false;
|
|
86
|
+
settling = false;
|
|
87
|
+
bodyUse = zeroWork;
|
|
88
|
+
caseUse = new Map();
|
|
89
|
+
ownerUse = zeroWork;
|
|
90
|
+
finished;
|
|
91
|
+
start;
|
|
92
|
+
constructor(plan, bank = workLedger, completion = zeroWork) {
|
|
93
|
+
this.plan = plan;
|
|
94
|
+
this.bank = bank;
|
|
95
|
+
this.completion = completion;
|
|
96
|
+
this.start = bank.actual();
|
|
97
|
+
}
|
|
98
|
+
ownsBank(bank) { return this.bank === bank; }
|
|
99
|
+
body(run) { return this.segment('body', 'body', workSub(this.plan.body, this.completion), run); }
|
|
100
|
+
// The runner reserves this tail inside the SAME body cap before user work.
|
|
101
|
+
// No case credit or new allowance can pay settlement after an interruption.
|
|
102
|
+
settle(run) {
|
|
103
|
+
if (this.ending || this.active)
|
|
104
|
+
throw new BudgetExpired('duplicate disjoint settlement');
|
|
105
|
+
this.ending = true;
|
|
106
|
+
this.settling = true;
|
|
107
|
+
try {
|
|
108
|
+
return this.segment('body', 'body', this.plan.body, run);
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
this.settling = false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
checkCoverage() {
|
|
115
|
+
const now = this.bank.actual(), live = this.active ? workSub(now, this.active.start) : zeroWork;
|
|
116
|
+
if (compareWork(workAdd(this.ownerUse, live), workSub(now, this.start)) !== 0)
|
|
117
|
+
throw new BudgetExpired('unowned or overlapping count round work');
|
|
118
|
+
}
|
|
119
|
+
case(key, run) {
|
|
120
|
+
const cap = this.plan.caps.cases.get(key);
|
|
121
|
+
if (!cap)
|
|
122
|
+
throw new BudgetExpired('unknown disjoint count case');
|
|
123
|
+
return this.segment('case', key, cap, run);
|
|
124
|
+
}
|
|
125
|
+
segment(kind, key, cap, run) {
|
|
126
|
+
if (this.finished || this.ending && !this.settling)
|
|
127
|
+
throw new BudgetExpired('closed disjoint count owners');
|
|
128
|
+
if (this.active)
|
|
129
|
+
throw new BudgetExpired('overlapping disjoint count owners');
|
|
130
|
+
const used = kind === 'body' ? this.bodyUse : this.caseUse.get(key) ?? zeroWork, left = workSub(cap, used), before = this.bank.actual();
|
|
131
|
+
if (compareWork(left, zeroWork) < 0)
|
|
132
|
+
throw new BudgetExpired('spent disjoint count owner');
|
|
133
|
+
try {
|
|
134
|
+
return this.bank.withBudget(left, () => {
|
|
135
|
+
this.active = { kind, key, start: before };
|
|
136
|
+
const scope = this.bank.currentScope(), slice = { key, allocation: cap, scopeId: scope.id, rootEpoch: this.plan.rootEpoch };
|
|
137
|
+
try {
|
|
138
|
+
this.bank.start('ticks', 1, 'disjoint count owner bookkeeping');
|
|
139
|
+
return run();
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
this.retainFailure(error, slice, kind === 'case');
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
this.active = undefined;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
const amount = workSub(this.bank.actual(), before);
|
|
152
|
+
this.ownerUse = workAdd(this.ownerUse, amount);
|
|
153
|
+
if (kind === 'body')
|
|
154
|
+
this.bodyUse = workAdd(this.bodyUse, amount);
|
|
155
|
+
else
|
|
156
|
+
this.caseUse.set(key, workAdd(used, amount));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
leaf(physicalKey, run, expectedCase) {
|
|
160
|
+
const owner = this.active;
|
|
161
|
+
if (this.finished)
|
|
162
|
+
throw new BudgetExpired('closed disjoint count owners');
|
|
163
|
+
if (!owner)
|
|
164
|
+
throw new BudgetExpired('unowned count leaf');
|
|
165
|
+
if (expectedCase !== undefined && (owner.kind !== 'case' || owner.key !== expectedCase))
|
|
166
|
+
throw new BudgetExpired('mismatched count leaf owner');
|
|
167
|
+
return this.bank.withBudget(this.plan.caps.leaf, () => {
|
|
168
|
+
const scope = this.bank.currentScope(), slice = { key: 'leaf', allocation: this.plan.caps.leaf, scopeId: scope.id, rootEpoch: this.plan.rootEpoch, caseKey: owner.kind === 'case' ? owner.key : undefined, physicalKey };
|
|
169
|
+
try {
|
|
170
|
+
this.bank.start('ticks', 1, 'disjoint count leaf bookkeeping');
|
|
171
|
+
return run();
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
this.retainFailure(error, slice, owner.kind === 'case');
|
|
175
|
+
throw error;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
retainFailure(error, slice, renewable) {
|
|
180
|
+
const refusal = this.bank.capacityRefusal(error);
|
|
181
|
+
if (renewable && refusal?.limiting.length === 1 && refusal.limiting[0].id === slice.scopeId) {
|
|
182
|
+
this.failedSlice = slice;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
receipt(complete) {
|
|
186
|
+
if (this.finished)
|
|
187
|
+
return this.finished;
|
|
188
|
+
if (this.active)
|
|
189
|
+
throw new BudgetExpired('live disjoint owner at return');
|
|
190
|
+
const round = workSub(this.bank.actual(), this.start);
|
|
191
|
+
if (compareWork(this.ownerUse, round) !== 0)
|
|
192
|
+
throw new BudgetExpired('unowned or overlapping count round work');
|
|
193
|
+
// No traversal/copy is hidden at an exhausted owner boundary. The private
|
|
194
|
+
// map is exposed as a read-only final view; all subsequent segments refuse.
|
|
195
|
+
return this.finished = Object.freeze({ body: this.bodyUse, cases: this.caseUse, sum: this.ownerUse, round, complete });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
export function runDisjointCountRound(plan, tickets, run, bank = workLedger, eligible) {
|
|
199
|
+
if (plan.kind === 'refused')
|
|
200
|
+
return { result: { kind: 'not-started', reason: plan.reason } };
|
|
201
|
+
if (!bank.inBudget() || plan.rootEpoch !== bank.snapshot().rootEpoch)
|
|
202
|
+
return { result: { kind: 'not-started', reason: 'missing-root' } };
|
|
203
|
+
if (!sameContext(plan.context, tickets, bank))
|
|
204
|
+
return { result: { kind: 'not-started', reason: 'context' } };
|
|
205
|
+
if (tickets.snapshot().terminal || tickets.snapshot().active)
|
|
206
|
+
return { result: { kind: 'not-started', reason: 'tickets' } };
|
|
207
|
+
// One terminal owner-entry tick and three fixed control operations: stop/
|
|
208
|
+
// coverage classification, ticket settlement, and final receipt preparation.
|
|
209
|
+
const completion = workShare(bank.weights.ticks, 4n, 1n);
|
|
210
|
+
try {
|
|
211
|
+
bank.checkAmount(plan.need, 'disjoint count atomic admission');
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
if (error instanceof BudgetExpired)
|
|
215
|
+
return { result: { kind: 'not-started', reason: 'headroom' } };
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
218
|
+
return bank.withBudget(plan.need, () => {
|
|
219
|
+
const owners = new CountFundingOwners(plan, bank, completion);
|
|
220
|
+
let started = false, failed = false, failure, refusal, value;
|
|
221
|
+
try {
|
|
222
|
+
refusal = owners.body(() => {
|
|
223
|
+
const active = countDisjointContext(tickets, bank);
|
|
224
|
+
if (eligible && !eligible())
|
|
225
|
+
return 'ineligible';
|
|
226
|
+
if (!sameContext(active, tickets, bank) || active.started !== plan.context.started)
|
|
227
|
+
return 'context';
|
|
228
|
+
if (tickets.snapshot().terminal || tickets.snapshot().active)
|
|
229
|
+
return 'tickets';
|
|
230
|
+
bank.start('ticks', 1, 'disjoint count ticket');
|
|
231
|
+
started = tickets.start();
|
|
232
|
+
return started ? undefined : 'tickets';
|
|
233
|
+
});
|
|
234
|
+
if (!refusal)
|
|
235
|
+
value = run(owners);
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
failed = true;
|
|
239
|
+
failure = error;
|
|
240
|
+
}
|
|
241
|
+
let result = { kind: 'not-started', reason: 'precommit' };
|
|
242
|
+
try {
|
|
243
|
+
owners.settle(() => {
|
|
244
|
+
bank.start('ticks', 1, 'disjoint terminal classification');
|
|
245
|
+
try {
|
|
246
|
+
owners.checkCoverage();
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
failed = true;
|
|
250
|
+
failure = error;
|
|
251
|
+
}
|
|
252
|
+
if (failed) {
|
|
253
|
+
const stop = countAttemptStop(failure, owners.slices, bank);
|
|
254
|
+
result = !started ? { kind: 'not-started', reason: 'precommit' } : stop.kind === 'soft-slice' ? { kind: 'unfinished', stop } : { kind: 'hard-cap', stop };
|
|
255
|
+
}
|
|
256
|
+
else
|
|
257
|
+
result = refusal ? { kind: 'not-started', reason: refusal } : value;
|
|
258
|
+
bank.start('ticks', 1, 'disjoint terminal ticket');
|
|
259
|
+
if (started)
|
|
260
|
+
tickets.finish(result.kind === 'proposal' || result.kind === 'decline' ? result.kind : result.kind === 'unfinished' ? 'unfinished' : 'hard-cap');
|
|
261
|
+
bank.start('ticks', 1, 'disjoint terminal receipt');
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
// If even the reserved tail cannot run (e.g. unowned work spent its credit),
|
|
266
|
+
// do not invent a free cleanup allowance. An active ticket stays unusable.
|
|
267
|
+
if (!(error instanceof BudgetExpired))
|
|
268
|
+
throw error;
|
|
269
|
+
return { result: { kind: 'hard-cap', stop: { kind: 'hard-cap', reason: 'unclassified', error } } };
|
|
270
|
+
}
|
|
271
|
+
let receipt;
|
|
272
|
+
try {
|
|
273
|
+
receipt = owners.receipt(!failed && !refusal);
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
failed = true;
|
|
277
|
+
failure = error;
|
|
278
|
+
result = { kind: 'hard-cap', stop: { kind: 'hard-cap', reason: 'unclassified', error } };
|
|
279
|
+
}
|
|
280
|
+
if (failed && !(failure instanceof BudgetExpired))
|
|
281
|
+
throw failure;
|
|
282
|
+
return { result, receipt };
|
|
283
|
+
});
|
|
284
|
+
}
|
|
@@ -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,52 @@
|
|
|
1
|
+
import { type C, type E } from './machine.js';
|
|
2
|
+
import { type Count, type CountDecl, type CountInst, type MapRead } from '../kernel/kernel.js';
|
|
3
|
+
export type CountFactOptions = {
|
|
4
|
+
maxAtoms?: number;
|
|
5
|
+
maxCounts?: number;
|
|
6
|
+
maxFacts?: number;
|
|
7
|
+
reserved?: Iterable<string>;
|
|
8
|
+
};
|
|
9
|
+
export type CountRegions = {
|
|
10
|
+
below: E;
|
|
11
|
+
atoms: C[];
|
|
12
|
+
counts: string[];
|
|
13
|
+
rows: number[][];
|
|
14
|
+
};
|
|
15
|
+
export type CountFacts = {
|
|
16
|
+
insts: CountInst[];
|
|
17
|
+
regions: CountRegions[];
|
|
18
|
+
skipped: {
|
|
19
|
+
count: string;
|
|
20
|
+
reason: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
/** Propose Boolean identities, subset bounds and quorum intersection instances.
|
|
24
|
+
* At most 2^maxAtoms rows per same-bound group. Non-Boolean counts and over-wide
|
|
25
|
+
* groups are reported, never silently treated as sets. Atom valuations deliberately
|
|
26
|
+
* overapproximate arithmetic: the kernel, not this table, decides their feasibility.
|
|
27
|
+
*/
|
|
28
|
+
export declare function proposeCountFacts(counts: Count[], context?: unknown, options?: CountFactOptions): CountFacts;
|
|
29
|
+
export type CountPickAudit = {
|
|
30
|
+
count: string;
|
|
31
|
+
below: number;
|
|
32
|
+
abstract: number;
|
|
33
|
+
actual?: number;
|
|
34
|
+
reason?: string;
|
|
35
|
+
};
|
|
36
|
+
/** Ask for the existing distinct-key lower-bound rule at concrete member keys.
|
|
37
|
+
* The evaluator is supplied by the caller's model. It is only a heuristic: even
|
|
38
|
+
* a lying evaluator cannot bypass checkMC's pickHyp, which re-reads each body.
|
|
39
|
+
* Both scanning and certificate size are bounded; large universes are reported.
|
|
40
|
+
*/
|
|
41
|
+
export declare function proposeCountPicks(counts: Count[], valueOf: (e: E) => number, options?: {
|
|
42
|
+
maxBelow?: number;
|
|
43
|
+
maxKeys?: number;
|
|
44
|
+
}): {
|
|
45
|
+
picks: [string, E[]][];
|
|
46
|
+
audit: CountPickAudit[];
|
|
47
|
+
};
|
|
48
|
+
/** Instantiate existing machine reads, including packed two-parameter keys.
|
|
49
|
+
* Mirrors the untrusted side of toCount; mcGoal/checkMC remain the authority.
|
|
50
|
+
* Returns undefined rather than guessing a decomposition the checker won't use.
|
|
51
|
+
*/
|
|
52
|
+
export declare function countsForReads(decls: CountDecl[], reads: MapRead[]): Count[] | undefined;
|