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,238 @@
|
|
|
1
|
+
// Untrusted candidates for maps of numeric fields. Boolean cubes lose comparisons
|
|
2
|
+
// between fields (and between two records), even when the transition reads them.
|
|
3
|
+
// Propose their shapes, not facts: counts.ts filters on reachable samples, and the
|
|
4
|
+
// ordinary counted induction/checker must prove every surviving candidate.
|
|
5
|
+
import { all, any, atMost, get, less, n, not, same, times, plus, tuple, walk, x } from "./machine.js";
|
|
6
|
+
// A guarded form and the stronger candidate it weakens; the guarded one is admitted only when the stronger is not.
|
|
7
|
+
export const weakensField = new WeakMap();
|
|
8
|
+
const loadFieldFamily = new WeakMap();
|
|
9
|
+
// Prefer the unguarded load, otherwise the first admitted singleton guard.
|
|
10
|
+
// Older field families retain their order and admission behavior.
|
|
11
|
+
export function selectFieldLaws(laws, admit) {
|
|
12
|
+
const kept = new Set(), selectedLoads = new Set();
|
|
13
|
+
return laws.filter(law => {
|
|
14
|
+
const stronger = weakensField.get(law), load = loadFieldFamily.get(law);
|
|
15
|
+
if ((stronger && kept.has(stronger)) || (load && selectedLoads.has(load)) || !admit(law))
|
|
16
|
+
return false;
|
|
17
|
+
kept.add(law);
|
|
18
|
+
if (load)
|
|
19
|
+
selectedLoads.add(load);
|
|
20
|
+
return true;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function fieldLaws(m, composed = true, loaded = true) {
|
|
24
|
+
const fields = new Set(), roles = new Map(), bounds = new Map();
|
|
25
|
+
const maps = m.maps ?? {}, source = [m.assume, m.step.flags];
|
|
26
|
+
const direct = (e) => e.op === 'get' && e.key.op === 'var' && e.map in maps;
|
|
27
|
+
const cells = (e) => {
|
|
28
|
+
const out = new Set();
|
|
29
|
+
walk(e, o => { const t = o; if (direct(t))
|
|
30
|
+
out.add(t.map); });
|
|
31
|
+
return [...out];
|
|
32
|
+
};
|
|
33
|
+
walk(source, o => {
|
|
34
|
+
if (o.op !== '=' && o.op !== '<' && o.op !== '<=')
|
|
35
|
+
return;
|
|
36
|
+
const c = o, a = cells(c.a), b = cells(c.b);
|
|
37
|
+
if (a.length && b.length)
|
|
38
|
+
for (const name of [...a, ...b])
|
|
39
|
+
fields.add(name);
|
|
40
|
+
if (c.op === '=' && direct(c.a) && c.a.key.op === 'var' && m.inputs.includes(c.a.key.name) && c.b.op === 'const')
|
|
41
|
+
roles.set(`${c.a.map}:${c.b.value}`, { map: c.a.map, value: c.b.value });
|
|
42
|
+
if (c.op === '<' && c.a.op === 'var' && m.inputs.includes(c.a.name) && c.b.op === 'var' && m.params.includes(c.b.name))
|
|
43
|
+
bounds.set(JSON.stringify(c.b), c.b);
|
|
44
|
+
});
|
|
45
|
+
// Different key domains need a sort analysis. Do not guess a shared domain.
|
|
46
|
+
if (fields.size < 2 || bounds.size !== 1)
|
|
47
|
+
return [];
|
|
48
|
+
const bound = [...bounds.values()][0], fs = [...fields].sort(), rs = [...roles.values()].filter(r => !fields.has(r.map));
|
|
49
|
+
const names = new Set([...m.params, ...m.inputs, ...Object.keys(m.state)]);
|
|
50
|
+
walk(m, o => { if (o.op === 'var')
|
|
51
|
+
names.add(o.name); });
|
|
52
|
+
const fresh = (base) => { let s = base; while (names.has(s))
|
|
53
|
+
s += '$'; names.add(s); return s; };
|
|
54
|
+
const ka = fresh('a$field'), kb = fresh('b$field'), kc = fresh('c$field'), a = x(ka), b = x(kb), c = x(kc), da = less(a, bound), db = less(b, bound);
|
|
55
|
+
const out = [], seen = new Set();
|
|
56
|
+
const propose = (name, guards, holds, pair = false) => {
|
|
57
|
+
const body = any(not(all(da, ...(pair ? [db] : []), ...guards)), holds), id = JSON.stringify(body);
|
|
58
|
+
if (seen.has(id))
|
|
59
|
+
return;
|
|
60
|
+
seen.add(id);
|
|
61
|
+
out.push({ name: `fields: ${name}`, forall: ka, ...(pair ? { keys: [kb] } : {}), holds: body });
|
|
62
|
+
};
|
|
63
|
+
const guards = [{ name: '', c: [] }, ...rs.map(r => ({ name: `${r.map}[a]=${r.value} -> `, c: [same(get(r.map, a), n(r.value))] }))];
|
|
64
|
+
for (const f of fs)
|
|
65
|
+
for (const g of fs) {
|
|
66
|
+
if (f === g)
|
|
67
|
+
continue;
|
|
68
|
+
for (const h of guards) {
|
|
69
|
+
if (f < g)
|
|
70
|
+
propose(`${h.name}${f}[a]=${g}[a]`, h.c, same(get(f, a), get(g, a)));
|
|
71
|
+
propose(`${h.name}${f}[a]<=${g}[a]`, h.c, atMost(get(f, a), get(g, a)));
|
|
72
|
+
}
|
|
73
|
+
// Equality of a record's first field can constrain the order of its second
|
|
74
|
+
// field across records. A role applies to the first record, not both.
|
|
75
|
+
for (const h of guards) {
|
|
76
|
+
const eq = same(get(f, a), get(f, b));
|
|
77
|
+
propose(`${h.name}${f}[a]=${f}[b] -> ${g}[b]<=${g}[a]`, [...h.c, eq], atMost(get(g, b), get(g, a)), true);
|
|
78
|
+
propose(`${h.name}${f}[a]=${f}[b] -> ${g}[a]=${g}[b]`, [...h.c, eq], same(get(g, a), get(g, b)), true);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Versioned rows: two equal numeric fields identify the contents of a row.
|
|
82
|
+
// Quantify the member independently; no finite row is baked into the claim.
|
|
83
|
+
for (const [map, sorts] of Object.entries(m.relations ?? {})) {
|
|
84
|
+
if (sorts.length !== 2 || sorts[0] !== sorts[1])
|
|
85
|
+
continue;
|
|
86
|
+
for (let i = 0; i < fs.length; i++)
|
|
87
|
+
for (let j = i + 1; j < fs.length; j++) {
|
|
88
|
+
const f = fs[i], g = fs[j];
|
|
89
|
+
const guard = all(da, db, less(c, bound), same(get(f, a), get(f, b)), same(get(g, a), get(g, b)));
|
|
90
|
+
const holds = any(not(guard), same(get(map, tuple([a, c])), get(map, tuple([b, c]))));
|
|
91
|
+
out.push({ name: `fields: ${f}[a]=${f}[b] and ${g}[a]=${g}[b] -> ${map} rows agree`, forall: ka, keys: [kb, kc], holds });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// The numeric encoding base*row + member is a relation too. Discover it
|
|
95
|
+
// from reads, not map names; explicit tuple metadata keeps its old encoding.
|
|
96
|
+
if (composed) {
|
|
97
|
+
const rows = new Map();
|
|
98
|
+
walk([m.assume, m.step, m.counts], o => {
|
|
99
|
+
if (o.op !== 'get' || !(o.map in maps) || m.relations?.[o.map])
|
|
100
|
+
return;
|
|
101
|
+
const key = o.key;
|
|
102
|
+
if (key.op !== 'add' || key.a.op !== 'mul' || key.a.k <= 1 || key.a.a.op !== 'var' || key.b.op !== 'var' || key.a.a.name === key.b.name || !m.inputs.includes(key.a.a.name))
|
|
103
|
+
return;
|
|
104
|
+
const old = rows.get(o.map);
|
|
105
|
+
rows.set(o.map, old === undefined || old === key.a.k ? key.a.k : 0);
|
|
106
|
+
});
|
|
107
|
+
const agrees = [];
|
|
108
|
+
for (const [map, base] of rows)
|
|
109
|
+
if (base)
|
|
110
|
+
for (let i = 0; i < fs.length; i++)
|
|
111
|
+
for (let j = i + 1; j < fs.length; j++) {
|
|
112
|
+
const f = fs[i], g = fs[j], cell = (row) => get(map, plus(times(base, row), c));
|
|
113
|
+
const guard = all(da, db, less(c, bound), same(get(f, a), get(f, b)), same(get(g, a), get(g, b)));
|
|
114
|
+
const law = { name: `fields: ${f}[a]=${f}[b] and ${g}[a]=${g}[b] -> ${map} rows agree`, forall: ka, keys: [kb, kc], holds: any(not(guard), same(cell(a), cell(b))) };
|
|
115
|
+
out.push(law);
|
|
116
|
+
agrees.push({ map, f, g, law });
|
|
117
|
+
}
|
|
118
|
+
if (!loaded)
|
|
119
|
+
return out;
|
|
120
|
+
const node = (t) => !!t && typeof t === 'object' && !Array.isArray(t);
|
|
121
|
+
const atoms = (t) => !t ? [] : t.op === 'and' ? t.xs.flatMap(atoms) : [t];
|
|
122
|
+
const sameTerm = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
123
|
+
const restrictCondition = (condition, flag, value) => {
|
|
124
|
+
if (condition.op === 'flag')
|
|
125
|
+
return condition.name === flag ? value : condition;
|
|
126
|
+
if (condition.op === 'not') {
|
|
127
|
+
const inner = restrictCondition(condition.x, flag, value);
|
|
128
|
+
return typeof inner === 'boolean' ? !inner : not(inner);
|
|
129
|
+
}
|
|
130
|
+
if (condition.op === 'and' || condition.op === 'or') {
|
|
131
|
+
const parts = condition.xs.map(c => restrictCondition(c, flag, value)), conjunction = condition.op === 'and';
|
|
132
|
+
if (parts.includes(!conjunction))
|
|
133
|
+
return !conjunction;
|
|
134
|
+
const rest = parts.filter((c) => typeof c !== 'boolean');
|
|
135
|
+
return !rest.length ? conjunction : rest.length === 1 ? rest[0] : conjunction ? all(...rest) : any(...rest);
|
|
136
|
+
}
|
|
137
|
+
if ((condition.op === '=' || condition.op === '<' || condition.op === '<=') && condition.a.op === 'const' && condition.b.op === 'const') {
|
|
138
|
+
return condition.op === '=' ? condition.a.value === condition.b.value : condition.op === '<' ? condition.a.value < condition.b.value : condition.a.value <= condition.b.value;
|
|
139
|
+
}
|
|
140
|
+
return condition;
|
|
141
|
+
};
|
|
142
|
+
const restrictValue = (value, flag, active) => {
|
|
143
|
+
if (value.op !== 'if')
|
|
144
|
+
return value;
|
|
145
|
+
const condition = restrictCondition(value.c, flag, active);
|
|
146
|
+
if (typeof condition === 'boolean')
|
|
147
|
+
return restrictValue(condition ? value.then : value.else, flag, active);
|
|
148
|
+
return { ...value, c: condition, then: restrictValue(value.then, flag, active), else: restrictValue(value.else, flag, active) };
|
|
149
|
+
};
|
|
150
|
+
const markerValue = (value, map, key, flag) => {
|
|
151
|
+
const active = restrictValue(value, flag, true), inactive = restrictValue(value, flag, false);
|
|
152
|
+
if (active.op !== 'const' || !Number.isSafeInteger(active.value) || active.value < 1)
|
|
153
|
+
return undefined;
|
|
154
|
+
const old = get(map, key), v = active.value;
|
|
155
|
+
if (sameTerm(inactive, old) || inactive.op === 'const' && inactive.value !== v)
|
|
156
|
+
return v;
|
|
157
|
+
// Boolean maps compile a preserved cell as if old=1 then 1 else 0.
|
|
158
|
+
// This cannot manufacture a marker outside the load branch.
|
|
159
|
+
if (inactive.op === 'if' && inactive.c.op === '=' && inactive.then.op === 'const' && inactive.then.value === v
|
|
160
|
+
&& inactive.else.op === 'const' && inactive.else.value !== v
|
|
161
|
+
&& (sameTerm(inactive.c, same(old, n(v))) || sameTerm(inactive.c, same(n(v), old))))
|
|
162
|
+
return v;
|
|
163
|
+
return undefined;
|
|
164
|
+
};
|
|
165
|
+
const emitted = new Map();
|
|
166
|
+
const add = (law) => {
|
|
167
|
+
const key = JSON.stringify(law.holds), old = emitted.get(key);
|
|
168
|
+
if (old)
|
|
169
|
+
return old;
|
|
170
|
+
emitted.set(key, law);
|
|
171
|
+
out.push(law);
|
|
172
|
+
return law;
|
|
173
|
+
};
|
|
174
|
+
for (const [map, base] of rows) {
|
|
175
|
+
const w = m.step.maps?.[map];
|
|
176
|
+
if (!base || !w || !('each' in w))
|
|
177
|
+
continue;
|
|
178
|
+
const loads = new Map();
|
|
179
|
+
const visit = (t, positive) => {
|
|
180
|
+
if (Array.isArray(t)) {
|
|
181
|
+
for (const u of t)
|
|
182
|
+
visit(u, positive);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (!node(t) || t.op === 'not')
|
|
186
|
+
return;
|
|
187
|
+
if (t.op === 'if') {
|
|
188
|
+
const branch = [...positive, ...atoms(t.c)];
|
|
189
|
+
visit(t.c, branch);
|
|
190
|
+
visit(t.then, branch);
|
|
191
|
+
visit(t.else, positive);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
const here = t.op === 'and' ? [...positive, ...atoms(t)] : positive;
|
|
195
|
+
const key = t.key, row = key?.b, input = row?.a?.name, src = t.map;
|
|
196
|
+
if (t.op === 'get' && src !== map && src in maps && !rows.has(src) && key?.op === 'sub' && key.a.op === 'var' && key.a.name === w.each
|
|
197
|
+
&& row?.op === 'mul' && row.k === base && row.a.op === 'var' && input !== undefined && m.inputs.includes(input)
|
|
198
|
+
&& here.some(q => sameTerm(q, atMost(times(base, x(input)), x(w.each))))
|
|
199
|
+
&& here.some(q => sameTerm(q, less(x(w.each), plus(times(base, x(input)), n(base))))))
|
|
200
|
+
for (const q of here)
|
|
201
|
+
if (q.op === 'flag') {
|
|
202
|
+
const flag = q.name;
|
|
203
|
+
loads.set(`${src}:${input}:${flag}`, { src, input, flag });
|
|
204
|
+
}
|
|
205
|
+
for (const u of Object.values(t))
|
|
206
|
+
visit(u, here);
|
|
207
|
+
};
|
|
208
|
+
visit(w.value, []);
|
|
209
|
+
const cell = (r) => get(map, plus(times(base, r), c));
|
|
210
|
+
for (const { src, input, flag } of loads.values())
|
|
211
|
+
for (const [mk, mw] of Object.entries(m.step.maps ?? {})) {
|
|
212
|
+
if ('each' in mw || mw.key.op !== 'var' || mw.key.name !== input || !(mk in maps) || rows.has(mk) || mk === src)
|
|
213
|
+
continue;
|
|
214
|
+
const v = markerValue(mw.value, mk, mw.key, flag);
|
|
215
|
+
if (v === undefined)
|
|
216
|
+
continue;
|
|
217
|
+
const marked = (r) => same(get(mk, r), n(v)), def = m.step.flags?.[flag];
|
|
218
|
+
const literals = atoms(def).filter(q => q.op === '=' && q.a.op === 'var' && q.a.name in m.state && q.b.op === 'const');
|
|
219
|
+
const load = (guards, label) => ({ name: `fields: ${mk}[a]=${v}${label} -> ${map} row is ${src}`, forall: ka, keys: [kc],
|
|
220
|
+
holds: any(not(all(da, less(c, bound), marked(a), ...guards)), same(cell(a), get(src, c))) });
|
|
221
|
+
const whole = add(load([], ''));
|
|
222
|
+
loadFieldFamily.set(whole, whole);
|
|
223
|
+
for (const lit of literals) {
|
|
224
|
+
const q = lit, weaker = load([lit], ` and ${q.a.name}=${q.b.value}`);
|
|
225
|
+
const choice = add(weaker);
|
|
226
|
+
weakensField.set(choice, whole);
|
|
227
|
+
loadFieldFamily.set(choice, whole);
|
|
228
|
+
}
|
|
229
|
+
for (const { f, g, law } of agrees.filter(r => r.map === map)) {
|
|
230
|
+
const guard = all(da, db, less(c, bound), same(get(f, a), get(f, b)), same(get(g, a), get(g, b)), marked(a), marked(b));
|
|
231
|
+
const weaker = { name: `fields: ${f}[a]=${f}[b] and ${g}[a]=${g}[b] and ${mk}[a]=${mk}[b]=${v} -> ${map} rows agree`, forall: ka, keys: [kb, kc], holds: any(not(guard), same(cell(a), cell(b))) };
|
|
232
|
+
weakensField.set(add(weaker), law);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return out;
|
|
238
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type C, type Law, type Machine, type State } from './machine.js';
|
|
2
|
+
type Env = Record<string, number>;
|
|
3
|
+
export declare function lawFrontiers(law: Law): C[][];
|
|
4
|
+
export declare function boundaryState(source: Machine, m: Machine, conditions: C[], p: Env, old: State, keys: Env): State | undefined;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Untrusted finite-state proposals from the laws' own syntax. No proposal is
|
|
2
|
+
// evidence: finiteHoudini still checks the entire family and the actual step.
|
|
3
|
+
import { carriedView, compileC, evalE } from "./machine.js";
|
|
4
|
+
import { checkWall, WallExpired } from "./wall.js";
|
|
5
|
+
const flatten = (c) => c.op === 'and' ? c.xs.flatMap(flatten) : [c];
|
|
6
|
+
export function lawFrontiers(law) {
|
|
7
|
+
const disjuncts = law.holds.op === 'or' ? law.holds.xs : [law.holds];
|
|
8
|
+
const guards = disjuncts.flatMap(c => c.op === 'not' ? [c.x] : []);
|
|
9
|
+
const out = guards.length ? [guards.flatMap(flatten)] : [];
|
|
10
|
+
for (const guard of guards) {
|
|
11
|
+
const atoms = flatten(guard), others = guards.filter(c => c !== guard).flatMap(flatten);
|
|
12
|
+
if (atoms.length === 2)
|
|
13
|
+
for (let i = 0; i < 2; i++)
|
|
14
|
+
out.push([...others, atoms[i], { op: 'not', x: atoms[1 - i] }]);
|
|
15
|
+
}
|
|
16
|
+
for (const c of disjuncts)
|
|
17
|
+
for (const atom of flatten(c))
|
|
18
|
+
if (atom.op === '<=')
|
|
19
|
+
out.push([...guards.flatMap(flatten), { op: '=', a: atom.a, b: atom.b }]);
|
|
20
|
+
return [...new Map(out.map(xs => [JSON.stringify(xs), xs])).values()];
|
|
21
|
+
}
|
|
22
|
+
export function boundaryState(source, m, conditions, p, old, keys) {
|
|
23
|
+
if (source.history || source.leasts)
|
|
24
|
+
return undefined;
|
|
25
|
+
const st = { ...old, scalars: { ...old.scalars }, maps: { ...old.maps } }, env = { ...p, ...st.scalars, ...keys };
|
|
26
|
+
let cached;
|
|
27
|
+
const view = () => cached ??= carriedView(m, st, Object.fromEntries((m.inputMaps ?? []).map(k => [k, new Map()])), undefined, p);
|
|
28
|
+
const value = (e) => evalE(e, env, view(), m);
|
|
29
|
+
const natural = (n) => Number.isSafeInteger(n) && n >= 0;
|
|
30
|
+
const write = (e, n, depth) => {
|
|
31
|
+
checkWall('finite boundary write');
|
|
32
|
+
if (!natural(n) || depth > 16)
|
|
33
|
+
return false;
|
|
34
|
+
if (value(e) === n)
|
|
35
|
+
return true;
|
|
36
|
+
if (e.op === 'var' && e.name in source.state && !(e.name in keys)) {
|
|
37
|
+
st.scalars[e.name] = env[e.name] = n;
|
|
38
|
+
cached = undefined;
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
if (e.op === 'get') {
|
|
42
|
+
const key = value(e.key);
|
|
43
|
+
if (!natural(key))
|
|
44
|
+
return false;
|
|
45
|
+
if (e.map in (source.maps ?? {})) {
|
|
46
|
+
st.maps[e.map] = new Map(st.maps[e.map]);
|
|
47
|
+
st.maps[e.map].set(key, n);
|
|
48
|
+
cached = undefined;
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
const count = m.counts?.[e.map];
|
|
52
|
+
if (!count)
|
|
53
|
+
return false;
|
|
54
|
+
const prior = { ...env };
|
|
55
|
+
env[count.j] = count.base ? Math.floor(key / count.base) : key;
|
|
56
|
+
if (count.lo && count.base)
|
|
57
|
+
env[count.lo] = key % count.base;
|
|
58
|
+
const bound = value(count.below);
|
|
59
|
+
if (!natural(bound) || bound > 64 || n > bound) {
|
|
60
|
+
Object.assign(env, prior);
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
let ok = true;
|
|
64
|
+
for (let i = 0; i < bound && ok; i++) {
|
|
65
|
+
env[count.key] = i;
|
|
66
|
+
ok = write(count.body, Number(i < n), depth + 1);
|
|
67
|
+
}
|
|
68
|
+
for (const k of Object.keys(env))
|
|
69
|
+
if (!(k in prior))
|
|
70
|
+
delete env[k];
|
|
71
|
+
Object.assign(env, prior, st.scalars);
|
|
72
|
+
return ok;
|
|
73
|
+
}
|
|
74
|
+
if (e.op === 'if') {
|
|
75
|
+
if (e.then.op === 'const' && e.then.value === n)
|
|
76
|
+
return force(e.c, true, depth + 1);
|
|
77
|
+
if (e.else.op === 'const' && e.else.value === n)
|
|
78
|
+
return force(e.c, false, depth + 1);
|
|
79
|
+
}
|
|
80
|
+
if (e.op === 'add')
|
|
81
|
+
return write(e.a, n - value(e.b), depth + 1) || write(e.b, n - value(e.a), depth + 1);
|
|
82
|
+
if (e.op === 'sub')
|
|
83
|
+
return write(e.a, n + value(e.b), depth + 1);
|
|
84
|
+
if (e.op === 'mul' && e.k > 0 && n % e.k === 0)
|
|
85
|
+
return write(e.a, n / e.k, depth + 1);
|
|
86
|
+
return false;
|
|
87
|
+
};
|
|
88
|
+
const force = (c, wanted, depth = 0) => {
|
|
89
|
+
if (depth > 16)
|
|
90
|
+
return false;
|
|
91
|
+
if (compileC(c, m)(env, view()) === wanted)
|
|
92
|
+
return true;
|
|
93
|
+
if (c.op === 'not')
|
|
94
|
+
return force(c.x, !wanted, depth + 1);
|
|
95
|
+
if (c.op === 'and')
|
|
96
|
+
return wanted ? c.xs.every(x => force(x, true, depth + 1)) : c.xs.some(x => force(x, false, depth + 1));
|
|
97
|
+
if (c.op === 'or')
|
|
98
|
+
return wanted ? c.xs.some(x => force(x, true, depth + 1)) : c.xs.every(x => force(x, false, depth + 1));
|
|
99
|
+
if (c.op === 'flag' || c.op === 'all')
|
|
100
|
+
return false;
|
|
101
|
+
const a = value(c.a), b = value(c.b);
|
|
102
|
+
if (c.op === '=')
|
|
103
|
+
return wanted ? write(c.a, b, depth + 1) || write(c.b, a, depth + 1) : write(c.a, b + 1, depth + 1) || write(c.b, a + 1, depth + 1);
|
|
104
|
+
if (c.op === '<=')
|
|
105
|
+
return wanted ? write(c.a, b, depth + 1) || write(c.b, a, depth + 1) : write(c.a, b + 1, depth + 1) || write(c.b, a - 1, depth + 1);
|
|
106
|
+
return wanted ? write(c.a, b - 1, depth + 1) || write(c.b, a + 1, depth + 1) : write(c.a, b, depth + 1) || write(c.b, a, depth + 1);
|
|
107
|
+
};
|
|
108
|
+
try {
|
|
109
|
+
return conditions.every(c => force(c, true)) && conditions.every(c => compileC(c, m)(env, view())) ? st : undefined;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
if (error instanceof WallExpired)
|
|
113
|
+
throw error;
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type Law, type Machine, type Request, type State } from './machine.js';
|
|
2
|
+
import { type TinyFiniteOptions, type TinyFiniteStatistics, type TinySeedStatistics } from './finite-tiny.js';
|
|
3
|
+
type Env = Record<string, number>;
|
|
4
|
+
type Samples = {
|
|
5
|
+
p: Env;
|
|
6
|
+
sts: State[];
|
|
7
|
+
}[];
|
|
8
|
+
type Truth = boolean | undefined;
|
|
9
|
+
export declare function finiteEvaluator(m: Machine, stop?: () => boolean): (law: Law, p: Env, st: State) => Truth;
|
|
10
|
+
export type FiniteDrop = {
|
|
11
|
+
round: number;
|
|
12
|
+
law: Law;
|
|
13
|
+
params: Env;
|
|
14
|
+
pre: State;
|
|
15
|
+
request: Request;
|
|
16
|
+
post: State;
|
|
17
|
+
};
|
|
18
|
+
export declare const finiteDump: {
|
|
19
|
+
onStart?: (value: {
|
|
20
|
+
machine: Machine;
|
|
21
|
+
caller: Law[];
|
|
22
|
+
candidates: Law[];
|
|
23
|
+
}) => void;
|
|
24
|
+
onDrop?: (drop: FiniteDrop) => void;
|
|
25
|
+
};
|
|
26
|
+
export type FiniteOptions = {
|
|
27
|
+
randomStates?: number;
|
|
28
|
+
requests?: number;
|
|
29
|
+
seed?: number;
|
|
30
|
+
targeted?: boolean;
|
|
31
|
+
wallMs?: number;
|
|
32
|
+
workLimit?: number;
|
|
33
|
+
onFinish?: (row: {
|
|
34
|
+
timedOut: boolean;
|
|
35
|
+
ms: number;
|
|
36
|
+
dropped: number;
|
|
37
|
+
work?: {
|
|
38
|
+
used: number;
|
|
39
|
+
limit: number;
|
|
40
|
+
exhausted: boolean;
|
|
41
|
+
};
|
|
42
|
+
}) => void;
|
|
43
|
+
onDrop?: (drop: FiniteDrop) => void;
|
|
44
|
+
onRound?: (row: {
|
|
45
|
+
round: number;
|
|
46
|
+
alive: number;
|
|
47
|
+
dropped: number;
|
|
48
|
+
randomStates: number;
|
|
49
|
+
steps: number;
|
|
50
|
+
}) => void;
|
|
51
|
+
};
|
|
52
|
+
export declare function finiteHoudini(source: Machine, m: Machine, caller: Law[], candidates: Law[], samples: Samples, options?: FiniteOptions): Law[];
|
|
53
|
+
export declare function finiteTinyHoudini(source: Machine, m: Machine, caller: Law[], candidates: Law[], params: Env[], options?: FiniteOptions & TinyFiniteOptions & {
|
|
54
|
+
rounds?: number;
|
|
55
|
+
onTiny?: (round: number, stats: TinyFiniteStatistics) => void;
|
|
56
|
+
onSeed?: (round: number, stats: TinySeedStatistics) => void;
|
|
57
|
+
}): Law[];
|
|
58
|
+
export {};
|