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,155 @@
|
|
|
1
|
+
import { familyStepProposal, finalCountStepDeferralEnabled } from "./count-final-step.js";
|
|
2
|
+
import { strategyLeafUnits } from "./count-strategy.js";
|
|
3
|
+
import { discoverRowAgreement } from "./row-agreement-shape.js";
|
|
4
|
+
import { discoverLiftedCountGuard } from "./count-lifted-shape.js";
|
|
5
|
+
import { discoverLiftedCountPrerequisites } from "./count-lifted-prerequisite.js";
|
|
6
|
+
import { proveLiftedCountComposition } from "./count-lifted-strategy.js";
|
|
7
|
+
import { completeWorkProfile } from "./work-profile.js";
|
|
8
|
+
import { workLedger } from "./work-admission.js";
|
|
9
|
+
import { prepareGuardCountContext } from "./count-guard-context.js";
|
|
10
|
+
import { proveCountRowComposition } from "./count-row-composition.js";
|
|
11
|
+
import { proveCountGuardComposition } from "./count-guard-composition.js";
|
|
12
|
+
import { clock, fullRate, fullWork, late, withDeadline } from "../kernel/prove.js";
|
|
13
|
+
import { env } from "./solver.js";
|
|
14
|
+
// Omitting the optional argument keeps legacy callers legal. Supplying an exact
|
|
15
|
+
// argument (including undefined/null at runtime) must never select that path.
|
|
16
|
+
export function assertLiftedWorkLease(plan) {
|
|
17
|
+
if (!plan || typeof plan !== 'object' || Array.isArray(plan) || !plan.lease || !completeWorkProfile.enabled || !workLedger.inBudget())
|
|
18
|
+
throw new Error('exact lifted dispatch requires a live FULL lease plan');
|
|
19
|
+
}
|
|
20
|
+
// Install only conservative count definitions, once before the family's attempts.
|
|
21
|
+
// Candidate generation is already finished: no extra law or trusted fact is added.
|
|
22
|
+
export function prepareCountStrategyMachine(m, family, until, observe) {
|
|
23
|
+
return withDeadline(until, () => {
|
|
24
|
+
let machine = m;
|
|
25
|
+
for (const law of family) {
|
|
26
|
+
if (late(until))
|
|
27
|
+
break;
|
|
28
|
+
const context = prepareGuardCountContext(machine, law, family);
|
|
29
|
+
if (context)
|
|
30
|
+
machine = context.machine;
|
|
31
|
+
}
|
|
32
|
+
const added = Object.keys(machine.counts ?? {}).filter(name => !m.counts?.[name]).length;
|
|
33
|
+
observe?.({ added });
|
|
34
|
+
return machine;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const liftedSelected = (m, family, law) => env.GDP_COUNT_LIFTED === '1' && family.includes(law) && discoverLiftedCountGuard(m, law, family) && (env.GDP_COUNT_LIFTED_PREREQUISITES !== '1' || discoverLiftedCountPrerequisites(m, law, family).length > 0);
|
|
38
|
+
// Shape discovery is scheduling only; it does not authorize a proof or a premise.
|
|
39
|
+
export function countStrategyKind(m, family, law) {
|
|
40
|
+
if (discoverRowAgreement(m, law))
|
|
41
|
+
return 'row';
|
|
42
|
+
if (liftedSelected(m, family, law))
|
|
43
|
+
return 'lifted';
|
|
44
|
+
if (prepareGuardCountContext(m, law, family))
|
|
45
|
+
return 'guard';
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
// Structural dispatch only; this admits no proof or premise.
|
|
49
|
+
export function selectedCountStrategies(m, family) {
|
|
50
|
+
return family.filter(law => !!countStrategyKind(m, family, law));
|
|
51
|
+
}
|
|
52
|
+
// The caller owns allocation (for example the tier budget); every law and case
|
|
53
|
+
// consumes this one absolute end. Unused pool time is never reserved here.
|
|
54
|
+
export function proveCountStrategyPool(m, family, until, request, observe, workAllowance = Math.max(0, until - clock())) {
|
|
55
|
+
return withDeadline(until, () => {
|
|
56
|
+
const proofs = new Map(), declined = [];
|
|
57
|
+
if (late(until))
|
|
58
|
+
return { proofs, declined };
|
|
59
|
+
const selected = family.map(law => ({ law, kind: countStrategyKind(m, family, law) })).filter(row => row.kind);
|
|
60
|
+
selected.sort((a, b) => Number(a.kind === 'row') - Number(b.kind === 'row'));
|
|
61
|
+
if (env.GDP_COUNT_LIFTED_PREREQUISITES === '1') {
|
|
62
|
+
const ranked = selected.filter(row => row.kind === 'lifted').map(row => ({ ...row, size: discoverLiftedCountPrerequisites(m, row.law, family)[0]?.bodyNodes ?? 0 })).sort((a, b) => b.size - a.size);
|
|
63
|
+
let next = 0;
|
|
64
|
+
for (let i = 0; i < selected.length; i++)
|
|
65
|
+
if (selected[i].kind === 'lifted')
|
|
66
|
+
selected[i] = ranked[next++];
|
|
67
|
+
}
|
|
68
|
+
for (const { law } of selected) {
|
|
69
|
+
if (late(until))
|
|
70
|
+
break;
|
|
71
|
+
const start = fullWork();
|
|
72
|
+
const proof = proveCountStrategies(m, family, law, until, request, event => observe?.({ law: law.name, end: until, ...event }), workAllowance);
|
|
73
|
+
if (proof)
|
|
74
|
+
proofs.set(law.name, proof);
|
|
75
|
+
else
|
|
76
|
+
declined.push(law.name);
|
|
77
|
+
observe?.({ stage: 'pool-law', law: law.name, end: until, checked: !!proof, units: (fullWork() - start) / fullRate });
|
|
78
|
+
}
|
|
79
|
+
return { proofs, declined };
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export function proveCountStrategies(m, family, law, until, request, observe, workAllowance = Math.max(0, until - clock()), shapeFamily, liftedBudget) {
|
|
83
|
+
if (arguments.length >= 9)
|
|
84
|
+
assertLiftedWorkLease(liftedBudget);
|
|
85
|
+
return countStrategies(m, family, law, until, request, observe, workAllowance, undefined, shapeFamily, liftedBudget);
|
|
86
|
+
}
|
|
87
|
+
// Internal construction path: an explicit proposal, never a checked verdict.
|
|
88
|
+
export function proposeCountStrategiesForClosing(m, family, law, until, request, observe, workAllowance = Math.max(0, until - clock()), shapeFamily, liftedBudget) {
|
|
89
|
+
if (arguments.length >= 9)
|
|
90
|
+
assertLiftedWorkLease(liftedBudget);
|
|
91
|
+
return countStrategies(m, family, law, until, request, observe, workAllowance, finalCountStepDeferralEnabled() ? familyStepProposal : undefined, shapeFamily, liftedBudget);
|
|
92
|
+
}
|
|
93
|
+
// The recipe ID is authority to select only this non-lifted constructor. These
|
|
94
|
+
// entry points can never silently dispatch the numeric lifted legacy path.
|
|
95
|
+
export function proveCountStrategyKind(kind, m, family, law, until, request, observe, workAllowance = Math.max(0, until - clock()), shapeFamily) {
|
|
96
|
+
return countStrategies(m, family, law, until, request, observe, workAllowance, undefined, shapeFamily, undefined, kind);
|
|
97
|
+
}
|
|
98
|
+
export function proposeCountStrategyKindForClosing(kind, m, family, law, until, request, observe, workAllowance = Math.max(0, until - clock()), shapeFamily) {
|
|
99
|
+
return countStrategies(m, family, law, until, request, observe, workAllowance, finalCountStepDeferralEnabled() ? familyStepProposal : undefined, shapeFamily, undefined, kind);
|
|
100
|
+
}
|
|
101
|
+
function countStrategies(m, family, law, until, request, observe, workAllowance, familyProposal, shapeFamily, liftedBudget, requestedKind) {
|
|
102
|
+
// The segmented-owner path remains explicit/unactivated in the controller.
|
|
103
|
+
// Discovery is non-case body work; do not wrap the lifted callback (and its
|
|
104
|
+
// cases) in that body segment. Row/guard cannot enter a lifted owner plan.
|
|
105
|
+
if (liftedBudget?.lease?.owners) {
|
|
106
|
+
if (!liftedBudget.lease.owners.ownsBank(workLedger))
|
|
107
|
+
throw new Error('lifted owners require the native work ledger');
|
|
108
|
+
const selected = liftedBudget.lease.owners.body(() => {
|
|
109
|
+
assertLiftedWorkLease(liftedBudget);
|
|
110
|
+
if (countStrategyKind(m, family, law) !== 'lifted')
|
|
111
|
+
return false;
|
|
112
|
+
observe?.({ strategy: 'lifted', stage: 'selected' });
|
|
113
|
+
return true;
|
|
114
|
+
});
|
|
115
|
+
return selected ? proveLiftedCountComposition(m, family, law, Infinity, request, event => observe?.({ strategy: 'lifted', ...event }), liftedBudget) : undefined;
|
|
116
|
+
}
|
|
117
|
+
// The exact path is explicit and requires the caller's live inherited bank.
|
|
118
|
+
// A missing/invalid plan never silently re-enters the numeric legacy path.
|
|
119
|
+
if (liftedBudget) {
|
|
120
|
+
assertLiftedWorkLease(liftedBudget);
|
|
121
|
+
if (countStrategyKind(m, family, law) !== 'lifted')
|
|
122
|
+
return;
|
|
123
|
+
until = Infinity;
|
|
124
|
+
}
|
|
125
|
+
return withDeadline(until, () => {
|
|
126
|
+
if (late(until))
|
|
127
|
+
return;
|
|
128
|
+
if (requestedKind !== undefined) {
|
|
129
|
+
const actualKind = countStrategyKind(m, family, law);
|
|
130
|
+
if ((requestedKind !== 'row' && requestedKind !== 'guard') || actualKind !== requestedKind) {
|
|
131
|
+
observe?.({ strategy: requestedKind, stage: 'decline', reason: 'strategy-kind-mismatch', actualKind: actualKind ?? 'none' });
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const leafUnits = liftedBudget ? Infinity : strategyLeafUnits(workAllowance);
|
|
136
|
+
if (requestedKind === 'row' || requestedKind === undefined && discoverRowAgreement(m, law)) {
|
|
137
|
+
observe?.({ strategy: 'row', stage: 'search-budget', workAllowance, leafUnits });
|
|
138
|
+
return proveCountRowComposition(m, family, law, until, request, e => observe?.({ strategy: 'row', ...e }), { framePremisesOnly: true, leafUnits, deferRowChecks: env.GDP_COUNT_ROW_DEFER_CHECKS === '1', reindexFactsOnly: env.GDP_COUNT_REINDEX_FACTS_ONLY === '1', familyProposal, shapeFamily });
|
|
139
|
+
}
|
|
140
|
+
if (requestedKind === undefined && liftedSelected(m, family, law)) {
|
|
141
|
+
observe?.({ strategy: 'lifted', stage: 'selected' });
|
|
142
|
+
return proveLiftedCountComposition(m, family, law, until, request, event => observe?.({ strategy: 'lifted', ...event }), liftedBudget ?? workAllowance);
|
|
143
|
+
}
|
|
144
|
+
const context = prepareGuardCountContext(m, law, family);
|
|
145
|
+
if (!context)
|
|
146
|
+
return;
|
|
147
|
+
const original = m.counts ?? {}, extended = context.machine.counts ?? {};
|
|
148
|
+
if (Object.keys(original).length !== Object.keys(extended).length || Object.entries(extended).some(([name, count]) => JSON.stringify(original[name]) !== JSON.stringify(count))) {
|
|
149
|
+
observe?.({ strategy: 'guard', stage: 'decline', reason: 'unadmitted count definitions' });
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
observe?.({ strategy: 'guard', stage: 'search-budget', workAllowance, leafUnits });
|
|
153
|
+
return proveCountGuardComposition({ ...context, machine: m }, family, law, until, request, e => observe?.({ strategy: 'guard', ...e }), { caseOrder: 'cost', minimalView: true, leafUnits, reindexFactsOnly: env.GDP_COUNT_REINDEX_FACTS_ONLY === '1', familyProposal });
|
|
154
|
+
});
|
|
155
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function recordCountStrategyPremises(family, proof) {
|
|
2
|
+
if (new Set(family.map(law => law.name)).size !== family.length)
|
|
3
|
+
throw Error('ambiguous strategy premise name');
|
|
4
|
+
const premises = family.filter(law => {
|
|
5
|
+
const arity = law.forall ? 1 + (law.keys?.length ?? 0) : 0;
|
|
6
|
+
if (!Object.hasOwn(proof.instances, law.name))
|
|
7
|
+
return arity === 0;
|
|
8
|
+
const values = proof.instances[law.name];
|
|
9
|
+
if (arity ? values.length % arity !== 0 : values.length !== 0)
|
|
10
|
+
throw Error('malformed strategy premise tuple: ' + law.name);
|
|
11
|
+
return arity === 0 || values.length > 0;
|
|
12
|
+
});
|
|
13
|
+
return { ...proof, premises: Object.freeze(premises.map(law => law.name)) };
|
|
14
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Law, type Machine } from './machine.js';
|
|
2
|
+
import { type FamilyStepProposal } from './count-final-step.js';
|
|
3
|
+
import { type CountStageObserver } from './count-stage-trace.js';
|
|
4
|
+
import { type WorkAmount } from './work-amount.js';
|
|
5
|
+
import { type CountFundingOwners } from './count-disjoint-funding.js';
|
|
6
|
+
import { type LiftedWorkSliceObserver, type LiftedWorkTrace } from './count-lifted-budget.js';
|
|
7
|
+
import { type CountCert, type CountDecl, type Goal, type Instances } from '../kernel/kernel.js';
|
|
8
|
+
export type CountStrategyOptions = {
|
|
9
|
+
familyProposal?: FamilyStepProposal;
|
|
10
|
+
deferToComposition?: boolean;
|
|
11
|
+
deferIntermediateChecks?: boolean;
|
|
12
|
+
deferOwnedReplacementLemmas?: boolean;
|
|
13
|
+
batchOwnedReplacementPruning?: boolean;
|
|
14
|
+
deferOwnedReplacementReplay?: boolean;
|
|
15
|
+
slicedLemmas?: boolean;
|
|
16
|
+
deferRowChecks?: boolean;
|
|
17
|
+
minimize?: boolean;
|
|
18
|
+
reindexFactsOnly?: boolean;
|
|
19
|
+
emitterFramePool?: boolean;
|
|
20
|
+
minimalView?: boolean;
|
|
21
|
+
leafUnits?: number;
|
|
22
|
+
leafWork?: WorkAmount;
|
|
23
|
+
workSliceObserver?: LiftedWorkSliceObserver;
|
|
24
|
+
workSliceTrace?: LiftedWorkTrace;
|
|
25
|
+
workOwners?: CountFundingOwners;
|
|
26
|
+
caseKey?: string;
|
|
27
|
+
trace?: (event: Record<string, unknown>) => void;
|
|
28
|
+
tailTrace?: CountStageObserver;
|
|
29
|
+
};
|
|
30
|
+
export declare function strategyLeafUnits(workAllowance: number): number;
|
|
31
|
+
export declare const strategyLeafUntil: (until: number, options: CountStrategyOptions) => number;
|
|
32
|
+
export declare const deferIntermediateCountChecks: (options: CountStrategyOptions) => boolean;
|
|
33
|
+
export declare const deferOwnedReplacementChecks: (options: CountStrategyOptions) => boolean;
|
|
34
|
+
export type CountStrategyProof = {
|
|
35
|
+
instances: Instances;
|
|
36
|
+
certs: Record<string, CountCert>;
|
|
37
|
+
status?: 'unchecked';
|
|
38
|
+
premises?: readonly string[];
|
|
39
|
+
};
|
|
40
|
+
export type CountRequestBuilder = (goal: Goal, declarations: CountDecl[]) => Pick<CountCert, 'reads' | 'insts' | 'picks'>;
|
|
41
|
+
export declare function finishCountStrategy(m: Machine, family: Law[], law: Law, instances: Instances, zeroMap: string, stepCert: CountCert, until: number, requestFor: CountRequestBuilder, observe?: (stage: string, checked: boolean) => void, options?: CountStrategyOptions): CountStrategyProof | undefined;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { countsForReads } from "./count-facts.js";
|
|
2
|
+
import { deferFinalCountStep } from "./count-final-step.js";
|
|
3
|
+
import { countStageTrace } from "./count-stage-trace.js";
|
|
4
|
+
import { checkMC, countedObligations, mcGoal } from "../kernel/kernel.js";
|
|
5
|
+
import { clock, grow, pastWall } from "../kernel/prove.js";
|
|
6
|
+
// Calibration-independent: W is the original enclosing work allowance, not
|
|
7
|
+
// a case's remaining share. INIT and final checking do not use this cap.
|
|
8
|
+
export function strategyLeafUnits(workAllowance) {
|
|
9
|
+
if (!Number.isFinite(workAllowance) || workAllowance < 0)
|
|
10
|
+
throw new RangeError('invalid strategy work allowance');
|
|
11
|
+
return workAllowance / 120;
|
|
12
|
+
}
|
|
13
|
+
export const strategyLeafUntil = (until, options) => Math.min(until, clock() + Math.max(0, options.leafUnits ?? Infinity));
|
|
14
|
+
// UNCHECKED is construction metadata, never a receipt or public acceptance.
|
|
15
|
+
export const deferIntermediateCountChecks = (options) => options.deferToComposition === true && options.deferIntermediateChecks === true;
|
|
16
|
+
// Search-only deferral: every retained lemma remains subject to the final native checker.
|
|
17
|
+
export const deferOwnedReplacementChecks = (options) => deferIntermediateCountChecks(options) && options.deferOwnedReplacementLemmas === true;
|
|
18
|
+
export function finishCountStrategy(m, family, law, instances, zeroMap, stepCert, until, requestFor, observe, options = {}) {
|
|
19
|
+
const index = family.indexOf(law);
|
|
20
|
+
if (index < 0 || clock() >= until || pastWall())
|
|
21
|
+
return;
|
|
22
|
+
if (options.deferToComposition)
|
|
23
|
+
return { instances, certs: { [law.name + ' @step']: stepCert }, ...(deferIntermediateCountChecks(options) ? { status: 'unchecked' } : {}) };
|
|
24
|
+
const trace = countStageTrace(options.tailTrace, 'strategy-finish-total');
|
|
25
|
+
try {
|
|
26
|
+
trace.mark('final-obligation-build', 'untrusted-assembly');
|
|
27
|
+
const packets = countedObligations(m, family, { [law.name]: instances }, index), step = packets.at(-1);
|
|
28
|
+
if (!step)
|
|
29
|
+
return;
|
|
30
|
+
const deferred = deferFinalCountStep(options.familyProposal);
|
|
31
|
+
if (deferred)
|
|
32
|
+
observe?.('step-proposal', false);
|
|
33
|
+
else {
|
|
34
|
+
trace.mark('native-step-check', 'trusted-check');
|
|
35
|
+
const stepChecked = checkMC(step.goal.hyps, step.decls, stepCert);
|
|
36
|
+
observe?.('step-check', stepChecked);
|
|
37
|
+
if (!stepChecked)
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const certs = { [step.goal.name]: stepCert };
|
|
41
|
+
for (const initial of packets.slice(0, -1)) {
|
|
42
|
+
trace.mark('initial-request-build', 'untrusted-assembly');
|
|
43
|
+
if (clock() >= until || pastWall())
|
|
44
|
+
return;
|
|
45
|
+
const base = requestFor(initial.goal, initial.decls), counts = countsForReads(initial.decls, base.reads), target = base.reads.find(r => r[1].replace(/#$/, '') === zeroMap);
|
|
46
|
+
const count = counts?.find(c => c.v === target?.[0]);
|
|
47
|
+
if (!target || !count)
|
|
48
|
+
return;
|
|
49
|
+
const scope = JSON.stringify([m, family, initial.goal, base]), fresh = (n) => `countInitial$${n}`;
|
|
50
|
+
let i = 0;
|
|
51
|
+
while (scope.includes(JSON.stringify(fresh(i))))
|
|
52
|
+
i++;
|
|
53
|
+
const request = { reads: base.reads, insts: [{ wit: fresh(i), below: count.below, terms: [[1, target[0]]], unit: 0 }], picks: [] };
|
|
54
|
+
trace.mark('initial-goal-build', 'untrusted-assembly');
|
|
55
|
+
const goal = mcGoal(initial.goal.hyps, initial.decls, request);
|
|
56
|
+
trace.mark('initial-search', 'untrusted-search');
|
|
57
|
+
const result = goal && grow(goal, new Map(), { nodes: 0, until });
|
|
58
|
+
if (!result || !('tree' in result)) {
|
|
59
|
+
observe?.('initial-search', false);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const cert = { ...request, tree: result.tree };
|
|
63
|
+
trace.mark('native-init-check', 'trusted-check');
|
|
64
|
+
const initialChecked = checkMC(initial.goal.hyps, initial.decls, cert);
|
|
65
|
+
observe?.('initial-check', initialChecked);
|
|
66
|
+
if (!initialChecked)
|
|
67
|
+
return;
|
|
68
|
+
certs[initial.goal.name] = cert;
|
|
69
|
+
}
|
|
70
|
+
trace.mark('certificate-return', 'untrusted-assembly');
|
|
71
|
+
return clock() < until && !pastWall() ? { instances, certs, ...(deferred ? { status: 'unchecked' } : {}) } : undefined;
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
trace.finish();
|
|
75
|
+
}
|
|
76
|
+
}
|