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
package/dist/core/effect.js
CHANGED
|
@@ -25,6 +25,7 @@ import { fromModel, namesOf } from "./extract.js";
|
|
|
25
25
|
import { check, sandbox } from "./extract-check.js";
|
|
26
26
|
import { Parts, readSchedule, replaySchedule, scheduleConforms, scheduleRule } from "./effect-schedule.js";
|
|
27
27
|
import { asRule, lift } from "./system.js";
|
|
28
|
+
import { attachSource, inheritSource } from "./source-check.js";
|
|
28
29
|
import { rewritePrims } from "./effect-prims.js";
|
|
29
30
|
export { proveRule, proveSteps } from "./dsl.js";
|
|
30
31
|
export { jitterRun, replaySchedule, scheduleConforms, stepper } from "./effect-schedule.js";
|
|
@@ -686,7 +687,9 @@ export function withLemmas(x, opts = {}) {
|
|
|
686
687
|
catch {
|
|
687
688
|
v = undefined;
|
|
688
689
|
}
|
|
689
|
-
|
|
690
|
+
// These are mathematical supports, not source claims. The caller's marked
|
|
691
|
+
// rule still requires native finalization; a native translation error is not admitted.
|
|
692
|
+
if (v && ((v.proven && v.checked) || (v.kernelProven === true && v.translation === 'unchecked'))) {
|
|
690
693
|
inv.push(l, ...(v.found?.laws ?? []).map(f => f.law));
|
|
691
694
|
proven.push(l.name);
|
|
692
695
|
}
|
|
@@ -901,6 +904,8 @@ function fibered(code, file, entry, E, opts) {
|
|
|
901
904
|
const one2 = one.rule;
|
|
902
905
|
const ints = [...one2.kindsOfState().filter(([n]) => shared.includes(n) && shared.includes(`${n}$neg`)), ...one2.kindsOfCells().filter(([n, k]) => k.vars(n).every(p => !local(p)))];
|
|
903
906
|
const rule = asRule({ ...lifted, name: `${m0.name}, every fiber` }, Object.fromEntries([...parts.params, ...parts.inputs].filter(whole).concat(ints)));
|
|
907
|
+
// Lifting is not transparent native replay: retain provenance, not the old journal.
|
|
908
|
+
inheritSource(one.rule, rule);
|
|
904
909
|
const names = (one.names ?? []).filter(n => !(n.role === 'state' && local(n.rule)) && n.role !== 'result' && !made.has(n.code));
|
|
905
910
|
const inv = (one.invariants ?? []).filter(l => ![...JSON.stringify(l.holds).matchAll(/"name":"([^"]*)"/g)].some(m => local(m[1])));
|
|
906
911
|
const steps = split.map((mt, mi) => ({ name: mt.name, steps: mt.units.length, base: (mi + 1) * 100 }));
|
|
@@ -981,6 +986,8 @@ function fromScheduleEntry(code, file, e, E, opts) {
|
|
|
981
986
|
const runs = opts.check?.runs ?? 60, c = scheduleConforms(sr, make, E, { runs, depth: 14 });
|
|
982
987
|
const evidence = { runs, requests: c.checked, fromStates: 0, probes: { conditions: 0, witnesses: 0, steps: 0 }, refusedBoth: 0, outside: 0, edge: 0, compiledAgreed: c.checked, coverage: { arms: 0, hit: 0, missed: [] }, ms: Date.now() - t0, ...(c.failure ? { mismatch: c.failure } : {}) };
|
|
983
988
|
const source = `// ${e.name}: ${e.expr.getText().replace(/\s+/g, ' ')}\n${sr.rule.machine.name}: state ${Object.keys(sr.rule.machine.state).join(', ')}; inputs ${sr.rule.machine.inputs.join(', ')}${sr.rule.machine.params.length ? `; params ${sr.rule.machine.params.join(', ')}` : ''}`;
|
|
989
|
+
// Schedule conformance checks transitions, not native source-law semantics.
|
|
990
|
+
attachSource(sr.rule, evidence, []);
|
|
984
991
|
if (c.failure)
|
|
985
992
|
return { ok: false, rule: sr.rule, source, refusals: [{ where: file, what: `the rule and Effect's own schedule part: ${c.failure}` }], notes, names: sr.names, evidence };
|
|
986
993
|
return { ok: true, rule: sr.rule, source, refusals: [], notes, names: sr.names, evidence, schedule: sr, replay: run => replaySchedule(sr, make(run.params), E, run) };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { withEvaluationAdmission } from './work-observe.js';
|
package/dist/core/exists.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type C, type E, type Law, type Machine, type SomeWitness, type State } from './machine.js';
|
|
1
|
+
import { type C, type E, type Law, type Machine, type Request, type SomeWitness, type State } from './machine.js';
|
|
2
2
|
import { type Report } from '../kernel/prove.js';
|
|
3
3
|
import { type Ghosted } from '../kernel/kernel.js';
|
|
4
4
|
type Env = Record<string, number>;
|
|
@@ -7,9 +7,14 @@ export declare const namesOf: (t: E | C) => string[];
|
|
|
7
7
|
export declare function groupsOf(vars: string[]): Group[];
|
|
8
8
|
export declare function substVarsE(e: E, s: Record<string, E>): E;
|
|
9
9
|
export declare function substVars(c: C, s: Record<string, E>): C;
|
|
10
|
+
export declare function retainedSamplePath(state: State, visit: () => void): Request[] | undefined;
|
|
11
|
+
export declare function retainedSamples(m: Machine): readonly {
|
|
12
|
+
p: Env;
|
|
13
|
+
sts: readonly State[];
|
|
14
|
+
}[];
|
|
10
15
|
export declare function small(m: Machine, p: Env, b: number, cap?: number, work?: number, walks?: number): State[];
|
|
11
16
|
export declare function ghostOf(m: Machine, law: Law): SomeWitness | undefined;
|
|
12
|
-
export declare function smallOf(m: Machine): {
|
|
17
|
+
export declare function smallOf(m: Machine, source?: Machine): {
|
|
13
18
|
p: Env;
|
|
14
19
|
sts: State[];
|
|
15
20
|
}[];
|
package/dist/core/exists.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { traceNow as countedTraceNow, BudgetExpired } from "./wall.js";
|
|
2
|
+
import { withReachabilityWork, reachState, reachEdge } from "./work-observe.js";
|
|
3
|
+
import { requestQuotient } from "./request-quotient.js";
|
|
1
4
|
// There exists: a law ∃ x. P(x) (core/machine.ts's Law with `some`: x a natural, or an integer as two, x and x$neg),
|
|
2
5
|
// proven through a witness. Nothing here is trusted: the kernel proves a plain law of a plain machine, and the Lean
|
|
3
6
|
// export states the existential again, proven by ⟨witness, proof⟩ (lean-kernel/Ghost.lean's some_updAll).
|
|
@@ -17,7 +20,8 @@
|
|
|
17
20
|
import { carriedView, compileC, evalC, evalE, fastStep, interpret, n as k, walk, x as v } from "./machine.js";
|
|
18
21
|
import { clock, proveLaw, proveLaws, withDeadline, withinDeadline } from "../kernel/prove.js";
|
|
19
22
|
import { env } from "./solver.js";
|
|
20
|
-
import {
|
|
23
|
+
import { WallExpired, checkWall } from "./wall.js";
|
|
24
|
+
import { finiteLawBound, ghostedMachine, ghostedOk, substC } from "../kernel/kernel.js";
|
|
21
25
|
const add = (a, b) => (a.op === 'const' && a.value === 0 ? b : b.op === 'const' && b.value === 0 ? a : { op: 'add', a, b });
|
|
22
26
|
const sum = (es) => es.reduce((acc, e) => add(acc, e), k(0));
|
|
23
27
|
const sub = (a, b) => (b.op === 'const' && b.value === 0 ? a : { op: 'sub', a, b });
|
|
@@ -165,12 +169,34 @@ const atomsOf2 = (c) => (c.op === 'and' || c.op === 'or' ? c.xs.flatMap(atomsOf2
|
|
|
165
169
|
// alike among those a few requests make: an action the BFS's levels never reach, a leader past a majority's votes, is
|
|
166
170
|
// taken as often as any other. Each state's step from the state it was first reached from is kept: `pathTo`.)
|
|
167
171
|
const pathTo = new WeakMap();
|
|
172
|
+
// Search hints only. A caller must replay this path on its original machine;
|
|
173
|
+
// an unrelated state with no cached parent must never be trusted as an init.
|
|
174
|
+
export function retainedSamplePath(state, visit) {
|
|
175
|
+
const requests = [], seen = new Set();
|
|
176
|
+
for (let at = state;;) {
|
|
177
|
+
visit();
|
|
178
|
+
if (seen.has(at))
|
|
179
|
+
return undefined;
|
|
180
|
+
seen.add(at);
|
|
181
|
+
const from = pathTo.get(at);
|
|
182
|
+
if (!from)
|
|
183
|
+
return requests.reverse();
|
|
184
|
+
requests.push(from[1]);
|
|
185
|
+
at = from[0];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export function retainedSamples(m) { return smalls.get(m) ?? []; }
|
|
168
189
|
export function small(m, p, b, cap = 3000, work = 300_000, walks = 0) {
|
|
190
|
+
return withReachabilityWork(() => smallWithin(m, p, b, cap, work, walks));
|
|
191
|
+
}
|
|
192
|
+
function smallWithin(m, p, b, cap, work, walks) {
|
|
193
|
+
reachState();
|
|
169
194
|
// (past a thousand steps, through the generated JavaScript, fastStep: the interpreter's states, as compile.test.ts holds
|
|
170
195
|
// them; a small machine's few steps cost less than its compiling)
|
|
196
|
+
checkWall('sample setup');
|
|
171
197
|
const run = interpret(m), start = run.init(p);
|
|
172
198
|
let steps = 0, fast = run.step;
|
|
173
|
-
const step = (p2, st, r) => { if (++steps === 1000)
|
|
199
|
+
const step = (p2, st, r) => { reachEdge(); if (++steps === 1000)
|
|
174
200
|
fast = fastStep(m) ?? run.step; return fast(p2, st, r); };
|
|
175
201
|
const subsets = Array.from({ length: 1 << b }, (_, s) => new Map(Array.from({ length: b }, (_, i) => i).filter(i => (s >> i) & 1).map(i => [i, 1])));
|
|
176
202
|
// (an input the assumption keeps below a few values, an action's, over all of them; the rest below b)
|
|
@@ -180,45 +206,96 @@ export function small(m, p, b, cap = 3000, work = 300_000, walks = 0) {
|
|
|
180
206
|
reqs = reqs.flatMap(r => Array.from({ length: below(i) }, (_, x) => ({ ...r, [i]: x })));
|
|
181
207
|
for (const c of m.inputMaps ?? [])
|
|
182
208
|
reqs = reqs.flatMap(r => subsets.map(s => ({ ...r, [c]: s })));
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
209
|
+
const quotient = env.GDP_REQUEST_QUOTIENT === '1' ? requestQuotient(m, reqs) : undefined;
|
|
210
|
+
// (a state once: by a hash of its scalars and nonzero cells, then a cell-by-cell comparison within the hash's bucket;
|
|
211
|
+
// the same classes as a sorted text of the state, without a sort or a text per step)
|
|
212
|
+
const scalarNames = Object.keys(start.scalars), mapNames = Object.keys(start.maps);
|
|
213
|
+
const hashOf = (s) => {
|
|
214
|
+
let h = 0x811C9DC5 | 0;
|
|
215
|
+
for (const n of scalarNames)
|
|
216
|
+
h = Math.imul(h ^ (s.scalars[n] | 0), 0x01000193);
|
|
217
|
+
for (const n of mapNames) {
|
|
218
|
+
let acc = 0;
|
|
219
|
+
for (const [k2, x2] of s.maps[n] ?? [])
|
|
220
|
+
if (x2)
|
|
221
|
+
acc = (acc + Math.imul((k2 * 0x85EBCA6B) ^ Math.imul(x2, 0xC2B2AE35), 0x27D4EB2F)) | 0;
|
|
222
|
+
h = Math.imul(h ^ acc, 0x01000193);
|
|
223
|
+
}
|
|
224
|
+
return h;
|
|
225
|
+
};
|
|
226
|
+
const sameCells = (a, b) => {
|
|
227
|
+
for (const [k2, x2] of a ?? [])
|
|
228
|
+
if (x2 !== (b?.get(k2) ?? 0))
|
|
229
|
+
return false;
|
|
230
|
+
for (const [k2, x2] of b ?? [])
|
|
231
|
+
if (x2 !== (a?.get(k2) ?? 0))
|
|
232
|
+
return false;
|
|
233
|
+
return true;
|
|
234
|
+
};
|
|
235
|
+
const equal = (a, b) => scalarNames.every(n => a.scalars[n] === b.scalars[n]) && mapNames.every(n => sameCells(a.maps[n], b.maps[n]));
|
|
236
|
+
const seen = new Map([[hashOf(start), [start]]]), all = [start], queue = [start];
|
|
237
|
+
const reached = (next, from, r) => {
|
|
238
|
+
const h = hashOf(next), bucket = seen.get(h);
|
|
239
|
+
if (bucket) {
|
|
240
|
+
for (const had of bucket)
|
|
241
|
+
if (equal(had, next))
|
|
242
|
+
return had;
|
|
243
|
+
bucket.push(next);
|
|
244
|
+
}
|
|
245
|
+
else
|
|
246
|
+
seen.set(h, [next]);
|
|
247
|
+
reachState();
|
|
248
|
+
all.push(next);
|
|
249
|
+
pathTo.set(next, [from, r]);
|
|
250
|
+
return next;
|
|
251
|
+
};
|
|
252
|
+
while (queue.length && all.length < cap && work > 0) {
|
|
253
|
+
const st = queue.shift(), covered = quotient ? new Set() : undefined;
|
|
254
|
+
let requestIndex = 0;
|
|
189
255
|
for (const r of reqs) {
|
|
256
|
+
checkWall('sample BFS');
|
|
190
257
|
if (--work < 0)
|
|
191
258
|
break;
|
|
259
|
+
const cls = quotient?.classes[requestIndex++];
|
|
260
|
+
if (cls !== undefined && covered.has(cls))
|
|
261
|
+
continue;
|
|
192
262
|
let next;
|
|
193
263
|
try {
|
|
194
264
|
next = step(p, st, r);
|
|
195
265
|
}
|
|
196
|
-
catch {
|
|
266
|
+
catch (error) {
|
|
267
|
+
if (error instanceof BudgetExpired)
|
|
268
|
+
throw error;
|
|
197
269
|
continue;
|
|
198
270
|
}
|
|
199
|
-
|
|
200
|
-
|
|
271
|
+
if (cls !== undefined)
|
|
272
|
+
covered.add(cls);
|
|
273
|
+
const n0 = all.length;
|
|
274
|
+
if (reached(next, st, r) && all.length > n0)
|
|
201
275
|
queue.push(next);
|
|
202
276
|
}
|
|
203
277
|
}
|
|
204
278
|
if (!queue.length)
|
|
205
|
-
return
|
|
279
|
+
return all;
|
|
206
280
|
const cell = (s, n, x) => s.maps[n]?.get(x) ?? s.defaults?.[n] ?? 0;
|
|
207
281
|
const kindOf = (a, c) => [...Object.keys(c.scalars).filter(n => a.scalars[n] !== c.scalars[n]),
|
|
208
282
|
...Object.keys(c.maps).filter(n => a.defaults?.[n] !== c.defaults?.[n] || [...a.maps[n]?.keys() ?? [], ...c.maps[n].keys()].some(x => cell(a, n, x) !== cell(c, n, x)))].join();
|
|
209
283
|
let seed = 7;
|
|
210
284
|
const rnd = (n) => { seed = (seed * 48271) % 2147483647; return seed % n; };
|
|
211
|
-
for (let t = 0; walks > 0 &&
|
|
212
|
-
let st = t % 2 ? start : [
|
|
285
|
+
for (let t = 0; walks > 0 && all.length < 2 * cap; t++) {
|
|
286
|
+
let st = t % 2 ? start : all[rnd(all.length)];
|
|
213
287
|
for (let d = 0; d < 40 && walks > 0; d++) {
|
|
214
288
|
const by = new Map();
|
|
215
289
|
for (let i = 0; i < 48; i++, walks--) {
|
|
290
|
+
checkWall('sample walks');
|
|
216
291
|
const r = reqs[rnd(reqs.length)];
|
|
217
292
|
let next;
|
|
218
293
|
try {
|
|
219
294
|
next = step(p, st, r);
|
|
220
295
|
}
|
|
221
|
-
catch {
|
|
296
|
+
catch (error) {
|
|
297
|
+
if (error instanceof BudgetExpired)
|
|
298
|
+
throw error;
|
|
222
299
|
continue;
|
|
223
300
|
}
|
|
224
301
|
const kd = kindOf(st, next);
|
|
@@ -231,7 +308,7 @@ export function small(m, p, b, cap = 3000, work = 300_000, walks = 0) {
|
|
|
231
308
|
st = reached(next, st, r);
|
|
232
309
|
}
|
|
233
310
|
}
|
|
234
|
-
return
|
|
311
|
+
return all;
|
|
235
312
|
}
|
|
236
313
|
// A ghost for a law about no key with one value ∃x. P over maps (PCorrect's "some process not done, or its y is 1"): x a
|
|
237
314
|
// state variable that starts at 0 or a param (or one less) and after each step keeps its value while P still holds there
|
|
@@ -260,13 +337,29 @@ export function ghostOf(m, law) {
|
|
|
260
337
|
// the walks past it in a third as many; an instance whose params the machine refuses has no states. With no params,
|
|
261
338
|
// 2 and 3 denote the same instance, so sample it only once. Read once a machine.
|
|
262
339
|
const smalls = new WeakMap();
|
|
263
|
-
|
|
340
|
+
// Adding fresh, unreferenced count definitions cannot change any transition.
|
|
341
|
+
// Reuse the engine's original samples instead of enumerating that same graph
|
|
342
|
+
// with every speculative count attached to every request. The structural check
|
|
343
|
+
// rejects changed transitions, replaced counts, and shadowed map reads.
|
|
344
|
+
export function smallOf(m, source) {
|
|
345
|
+
checkWall('sample cache');
|
|
264
346
|
let out = smalls.get(m);
|
|
347
|
+
if (!out && source && source !== m) {
|
|
348
|
+
const fields = new Set([...Object.keys(m), ...Object.keys(source)]);
|
|
349
|
+
const added = new Set(Object.keys(m.counts ?? {}).filter(k => !(k in (source.counts ?? {}))));
|
|
350
|
+
let safe = [...fields].every(k => k === 'counts' || m[k] === source[k]) && Object.entries(source.counts ?? {}).every(([k, d]) => m.counts?.[k] === d) && [...added].every(k => !(k in (source.maps ?? {})) && !(k in (source.fns ?? {})) && !source.inputMaps?.includes(k));
|
|
351
|
+
walk(source, o => { if (o.op === 'get' && added.has(o.map))
|
|
352
|
+
safe = false; });
|
|
353
|
+
if (safe)
|
|
354
|
+
smalls.set(m, (out = smallOf(source)));
|
|
355
|
+
}
|
|
265
356
|
if (!out)
|
|
266
357
|
smalls.set(m, (out = (m.params.length ? [2, 3] : [2]).map(x => { const p = Object.fromEntries(m.params.map(q => [q, x])); try {
|
|
267
358
|
return { p, sts: small(m, p, 3, 3000, 300_000, 100_000) };
|
|
268
359
|
}
|
|
269
|
-
catch {
|
|
360
|
+
catch (e) {
|
|
361
|
+
if (e instanceof WallExpired)
|
|
362
|
+
throw e;
|
|
270
363
|
return { p, sts: [] };
|
|
271
364
|
} })));
|
|
272
365
|
return out;
|
|
@@ -303,11 +396,20 @@ export function trueSmall(m, laws, ghosted) {
|
|
|
303
396
|
const views = new WeakMap();
|
|
304
397
|
const sampleTests = new WeakMap();
|
|
305
398
|
export function holdsAt(m, law, p, st, b) {
|
|
306
|
-
|
|
399
|
+
return withReachabilityWork(() => holdsAtWithin(m, law, p, st, b));
|
|
400
|
+
}
|
|
401
|
+
function holdsAtWithin(m, law, p, st, b) {
|
|
402
|
+
const finite = finiteLawBound(law);
|
|
403
|
+
let machineViews = views.get(m);
|
|
404
|
+
if (!machineViews)
|
|
405
|
+
views.set(m, (machineViews = new WeakMap()));
|
|
406
|
+
let view = machineViews.get(st);
|
|
307
407
|
if (!view) {
|
|
308
408
|
const empty = Object.fromEntries((m.inputMaps ?? []).map(c => [c, new Map()]));
|
|
309
|
-
|
|
409
|
+
machineViews.set(st, (view = carriedView(m, st, empty, undefined, p)));
|
|
310
410
|
}
|
|
411
|
+
if (finite)
|
|
412
|
+
return evalC({ op: 'all', key: law.forall, c: law.holds, finite: law.finite }, p, view, m);
|
|
311
413
|
let tests = sampleTests.get(m);
|
|
312
414
|
if (!tests)
|
|
313
415
|
sampleTests.set(m, (tests = new WeakMap()));
|
|
@@ -322,7 +424,12 @@ export function holdsAt(m, law, p, st, b) {
|
|
|
322
424
|
if (!fixed.has(name))
|
|
323
425
|
Object.defineProperty(env, name, { value: env[name], writable: true, enumerable: true, configurable: true });
|
|
324
426
|
const values = keys.length ? Array.from({ length: b }, (_, x) => x) : [];
|
|
427
|
+
// Poll at entry and every 256 visited tuple prefixes, rather than paying for
|
|
428
|
+
// a wall-clock read at every binding. Each new state/law starts with a poll.
|
|
429
|
+
let visited = 0;
|
|
325
430
|
const go = (depth) => {
|
|
431
|
+
if ((visited++ & 255) === 0)
|
|
432
|
+
checkWall('sample law bindings');
|
|
326
433
|
if (depth === keys.length)
|
|
327
434
|
return test(env, view);
|
|
328
435
|
const name = keys[depth], was = env[name];
|
|
@@ -1168,12 +1275,12 @@ export function proveSome(m, laws, opts = {}) {
|
|
|
1168
1275
|
firstPicks.set(key([m.step, m.assume ?? null, m.maps ?? null, p.law.holds]), pk.mode === 'map' ? { mode: 'map', at: pk.at } : { mode: 'term', at: [...pk.at] });
|
|
1169
1276
|
}
|
|
1170
1277
|
for (let round = 0;; round++) {
|
|
1171
|
-
const now = current(), t0 =
|
|
1278
|
+
const now = current(), t0 = countedTraceNow(), r = round === 0 && first ? { proven: false, ...first }
|
|
1172
1279
|
// (a ghost map's goals within 2 s: a search asks them with every candidate set, and one without its supports can take
|
|
1173
1280
|
// minutes; `mapMs` where the supports are the search's, found over the same map)
|
|
1174
1281
|
: p.pick.mode === 'map' ? withDeadline(clock() + (opts.mapMs ?? 2_000), () => proveLaw(now.machine, now.laws, i)) : proveLaw(now.machine, now.laws, i);
|
|
1175
1282
|
if (log)
|
|
1176
|
-
console.error(`exists: pass ${pass} round ${round} "${p.law.name}" ${p.pick.mode} ${describe(p, cases).slice(0, 160)}: ${r.proven ? 'proven' : `${r.goal} ${r.stuck}`} (${Math.round(
|
|
1283
|
+
console.error(`exists: pass ${pass} round ${round} "${p.law.name}" ${p.pick.mode} ${describe(p, cases).slice(0, 160)}: ${r.proven ? 'proven' : `${r.goal} ${r.stuck}`} (${Math.round(countedTraceNow() - t0)} ms)`);
|
|
1177
1284
|
if (r.proven)
|
|
1178
1285
|
return undefined;
|
|
1179
1286
|
const fail = (stuck) => ({ proven: false, nodes: 0, leaves: 0, checked: false, failed: { goal: r.goal, stuck, ...(r.witness ? { witness: r.witness } : {}) } });
|
|
@@ -1256,10 +1363,10 @@ export function proveSome(m, laws, opts = {}) {
|
|
|
1256
1363
|
return f;
|
|
1257
1364
|
}
|
|
1258
1365
|
for (let pass = 1;; pass++) {
|
|
1259
|
-
const { machine, laws: plain, ghosts } = current(), t0 =
|
|
1366
|
+
const { machine, laws: plain, ghosts } = current(), t0 = countedTraceNow();
|
|
1260
1367
|
const out = (opts.whole ?? proveLaws)(machine, plain), done = { ...out, laws: out.laws ?? plain, machine, ghosts, witnesses: Object.fromEntries([...plans.values()].map(p => [p.law.name, describe(p, cases)])) };
|
|
1261
1368
|
if (log)
|
|
1262
|
-
console.error(`exists: pass ${pass} the whole set: ${out.proven ? 'proven' : `${out.failed?.goal} ${out.failed?.stuck}`} (${Math.round(
|
|
1369
|
+
console.error(`exists: pass ${pass} the whole set: ${out.proven ? 'proven' : `${out.failed?.goal} ${out.failed?.stuck}`} (${Math.round(countedTraceNow() - t0)} ms)`);
|
|
1263
1370
|
const j = out.proven || !out.failed || pass > 8 ? undefined : [...plans.keys()].find(k => out.failed.goal.startsWith(`${laws[k].name} @`));
|
|
1264
1371
|
if (j === undefined)
|
|
1265
1372
|
return done;
|
|
@@ -5,6 +5,7 @@ import { type Model, type Var } from './extract-read.js';
|
|
|
5
5
|
import * as I from './extract-ir.js';
|
|
6
6
|
import type { B, N } from './extract-ir.js';
|
|
7
7
|
import type { Sorts } from './extract-print.js';
|
|
8
|
+
import { type NativeInputs } from './native-domain.js';
|
|
8
9
|
type Raw = number | boolean | string;
|
|
9
10
|
export type Arm = {
|
|
10
11
|
label: string;
|
|
@@ -57,8 +58,9 @@ export type Sandbox = {
|
|
|
57
58
|
};
|
|
58
59
|
setNow: (n: number) => void;
|
|
59
60
|
get: (name: string) => unknown;
|
|
61
|
+
bindings: (method: string) => Record<string, unknown> | undefined;
|
|
60
62
|
};
|
|
61
|
-
export declare function sandbox(code: string, file: string, expose: string[], modules?: Record<string, unknown>, init?: string, files?: Record<string, string>, extra?: [number, string][]): Sandbox & {
|
|
63
|
+
export declare function sandbox(code: string, file: string, expose: string[], modules?: Record<string, unknown>, init?: string, files?: Record<string, string>, extra?: [number, string][], nativeMethods?: string[]): Sandbox & {
|
|
62
64
|
arms: Arm[];
|
|
63
65
|
};
|
|
64
66
|
type Cells = Record<string, Record<string, Raw>>;
|
|
@@ -89,6 +91,7 @@ export type CheckOptions = {
|
|
|
89
91
|
probeMs?: number;
|
|
90
92
|
modules?: Record<string, unknown>;
|
|
91
93
|
files?: Record<string, string>;
|
|
94
|
+
lawCrossCheck?: boolean;
|
|
92
95
|
};
|
|
93
96
|
type Ev = Model['events'][number];
|
|
94
97
|
export type CodeSide = {
|
|
@@ -120,6 +123,9 @@ export type CodeSide = {
|
|
|
120
123
|
setNow: (n: number) => void;
|
|
121
124
|
init?: (snap: Snap, params: Record<string, Raw>) => string | undefined;
|
|
122
125
|
coverage: () => Coverage;
|
|
126
|
+
nativeState?: (self: unknown, snap: Snap, params: Record<string, Raw>) => unknown;
|
|
127
|
+
nativeBindings?: (event: Ev) => Record<string, unknown> | undefined;
|
|
128
|
+
nativeInputs?: NativeInputs;
|
|
123
129
|
input?: (v: Var, x: Raw, rand: Rand) => Raw;
|
|
124
130
|
drawSnap?: (rand: Rand) => Snap;
|
|
125
131
|
normalize?: (s: Snap) => Snap;
|