gdp-wired 0.48.0 → 0.50.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 +6 -2
- package/dist/core/bmc.js +10 -7
- package/dist/core/candidate-seeds.d.ts +25 -0
- package/dist/core/candidate-seeds.js +90 -0
- package/dist/core/check.js +7 -2
- package/dist/core/cli.js +3 -0
- 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.js +3 -2
- 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 +10 -2
- package/dist/core/count-cert-transport.js +60 -9
- 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-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-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-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-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-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/conditional-check-cache.js +3 -2
- package/dist/core/count-recovery/conditional-cuts.js +5 -4
- package/dist/core/count-recovery/conditional-proof.d.ts +37 -3
- package/dist/core/count-recovery/conditional-proof.js +72 -30
- package/dist/core/count-recovery/derivability-closure.js +2 -1
- package/dist/core/count-recovery/guard-cases.js +2 -1
- 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/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.js +2 -1
- 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-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 +1 -0
- package/dist/core/count-support.js +26 -4
- package/dist/core/count-tier-budget.d.ts +14 -0
- package/dist/core/count-tier-budget.js +64 -0
- package/dist/core/count-unwritten-prefix.d.ts +24 -0
- package/dist/core/count-unwritten-prefix.js +97 -0
- package/dist/core/count-write-shape.d.ts +15 -0
- package/dist/core/count-write-shape.js +73 -0
- package/dist/core/counted-candidate-seeds.d.ts +12 -0
- package/dist/core/counted-candidate-seeds.js +31 -0
- package/dist/core/counts.d.ts +37 -13
- package/dist/core/counts.js +999 -129
- 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 +32 -2
- package/dist/core/dsl.js +202 -64
- package/dist/core/evaluation-admission.d.ts +1 -0
- package/dist/core/evaluation-admission.js +3 -0
- package/dist/core/exists.d.ts +6 -1
- package/dist/core/exists.js +53 -10
- package/dist/core/field-laws.d.ts +3 -1
- package/dist/core/field-laws.js +159 -3
- package/dist/core/finite-houdini.d.ts +6 -0
- package/dist/core/finite-houdini.js +63 -21
- package/dist/core/finite-tiny.js +95 -67
- package/dist/core/fixtures/count-completion/paxos-decision.json +1 -0
- package/dist/core/fresh.js +5 -1
- package/dist/core/infer.js +49 -33
- package/dist/core/kind.js +2 -1
- package/dist/core/lemma-cuts.js +11 -10
- package/dist/core/lift-cli.d.ts +11 -0
- package/dist/core/lift-cli.js +113 -0
- package/dist/core/linear-admission.d.ts +14 -0
- package/dist/core/linear-admission.js +151 -0
- package/dist/core/machine.d.ts +5 -2
- package/dist/core/machine.js +105 -31
- package/dist/core/meter.d.ts +22 -0
- package/dist/core/meter.js +34 -0
- package/dist/core/nonterm.js +4 -3
- package/dist/core/proof-output.d.ts +53 -0
- package/dist/core/proof-output.js +38 -0
- 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 +21 -1
- package/dist/core/quorum-laws.js +80 -17
- 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/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 +2 -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/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/system.js +4 -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 +6 -1
- package/dist/core/wall.js +23 -9
- package/dist/core/watch.d.ts +1 -1
- package/dist/core/watch.js +13 -4
- 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.js +93 -40
- package/dist/kernel/epr.js +23 -8
- package/dist/kernel/function-instances.d.ts +45 -0
- package/dist/kernel/function-instances.js +460 -0
- package/dist/kernel/kernel.d.ts +47 -1
- package/dist/kernel/kernel.js +417 -68
- package/dist/kernel/prove.d.ts +61 -6
- package/dist/kernel/prove.js +625 -205
- package/dist/kernel/prover-rows.d.ts +1 -0
- package/dist/kernel/prover-rows.js +12 -1
- 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/axiom-audit.d.ts +11 -0
- package/dist/lean-kernel/axiom-audit.js +50 -0
- package/dist/lean-kernel/emit.d.ts +34 -3
- package/dist/lean-kernel/emit.js +215 -28
- 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/legacy-family-order.d.ts +1 -0
- package/dist/lean-kernel/legacy-family-order.js +26 -0
- package/dist/lean-kernel/library.js +25 -3
- package/dist/lean-kernel/lift/counted-source-data.d.ts +7 -0
- package/dist/lean-kernel/lift/counted-source-data.js +78 -0
- package/dist/lean-kernel/lift/index.d.ts +82 -0
- package/dist/lean-kernel/lift/index.js +116 -0
- package/dist/lean-kernel/lift/project.d.ts +4 -0
- package/dist/lean-kernel/lift/project.js +15 -0
- package/dist/lean-kernel/lift/proof-capture.d.ts +104 -0
- package/dist/lean-kernel/lift/proof-capture.js +216 -0
- package/dist/lean-kernel/lift/proof-codec.d.ts +28 -0
- package/dist/lean-kernel/lift/proof-codec.js +299 -0
- package/dist/lean-kernel/lift/proof-counted-source.d.ts +16 -0
- package/dist/lean-kernel/lift/proof-counted-source.js +68 -0
- package/dist/lean-kernel/lift/proof-frontier.d.ts +19 -0
- package/dist/lean-kernel/lift/proof-frontier.js +153 -0
- package/dist/lean-kernel/lift/proof-graph.d.ts +17 -0
- package/dist/lean-kernel/lift/proof-graph.js +130 -0
- package/dist/lean-kernel/lift/proof-parts.d.ts +29 -0
- package/dist/lean-kernel/lift/proof-parts.js +131 -0
- package/dist/lean-kernel/lift/proof-prelude.d.ts +2 -0
- package/dist/lean-kernel/lift/proof-prelude.js +38 -0
- package/dist/lean-kernel/lift/proof-witness.d.ts +30 -0
- package/dist/lean-kernel/lift/proof-witness.js +283 -0
- package/dist/lean-kernel/lift/shape.d.ts +5 -0
- package/dist/lean-kernel/lift/shape.js +57 -0
- package/dist/lean-kernel/lift/source-projection.d.ts +16 -0
- package/dist/lean-kernel/lift/source-projection.js +81 -0
- package/dist/lean-kernel/lift/source.d.ts +23 -0
- package/dist/lean-kernel/lift/source.js +111 -0
- package/dist/lean-kernel/lift/witness-alpha.d.ts +9 -0
- package/dist/lean-kernel/lift/witness-alpha.js +31 -0
- package/dist/lean-kernel/lift-legacy.d.ts +58 -0
- package/dist/lean-kernel/lift-legacy.js +84 -0
- package/dist/lean-kernel/lift-names.d.ts +22 -0
- package/dist/lean-kernel/lift-names.js +36 -0
- package/dist/lean-kernel/lift-simulation/index.d.ts +29 -0
- package/dist/lean-kernel/lift-simulation/index.js +352 -0
- package/dist/lean-kernel/lift-simulation/shape.d.ts +41 -0
- package/dist/lean-kernel/lift-simulation/shape.js +173 -0
- package/dist/lean-kernel/lift-special/index.d.ts +36 -0
- package/dist/lean-kernel/lift-special/index.js +241 -0
- package/dist/lean-kernel/lift-special/structural.d.ts +25 -0
- package/dist/lean-kernel/lift-special/structural.js +126 -0
- package/dist/lean-kernel/lift-typed/index.d.ts +35 -0
- package/dist/lean-kernel/lift-typed/index.js +256 -0
- package/dist/lean-kernel/lift-typed/roles.d.ts +17 -0
- package/dist/lean-kernel/lift-typed/roles.js +170 -0
- package/dist/lean-kernel/lift-typed/shape.d.ts +1 -0
- package/dist/lean-kernel/lift-typed/shape.js +12 -0
- package/dist/lean-kernel/lift.d.ts +30 -0
- package/dist/lean-kernel/lift.js +97 -0
- package/package.json +5 -1
package/dist/core/lemma-cuts.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { searchNow as countedSearchNow } from "./wall.js";
|
|
1
2
|
// Untrusted proof compression. Turn repeated forced splits into independently checked conditional cuts.
|
|
2
3
|
// No search, protocol vocabulary, new facts or proof-budget changes: failed transport/check returns no proposal.
|
|
3
4
|
import { n, plus, times, x } from "./machine.js";
|
|
@@ -74,7 +75,7 @@ const proofPath = (when, cut) => {
|
|
|
74
75
|
};
|
|
75
76
|
// Unlike widen, transport never calls a solver when a row is missing.
|
|
76
77
|
function transport(from, to, tree, before, after, until, missing) {
|
|
77
|
-
if (
|
|
78
|
+
if (countedSearchNow() >= until)
|
|
78
79
|
return undefined;
|
|
79
80
|
if ('split' in tree) {
|
|
80
81
|
const known = decide(tree.split, after);
|
|
@@ -127,7 +128,7 @@ class ObservedPath extends Map {
|
|
|
127
128
|
has(key) { this.observed.add(key); return super.has(key); }
|
|
128
129
|
}
|
|
129
130
|
function dependencies(g, t, path, facts, atoms, until) {
|
|
130
|
-
if (
|
|
131
|
+
if (countedSearchNow() >= until)
|
|
131
132
|
return false;
|
|
132
133
|
if ('split' in t)
|
|
133
134
|
return dependencies(g, t.yes, put(path, t.split, true), facts, atoms, until)
|
|
@@ -176,7 +177,7 @@ function scopeCondition(lin) {
|
|
|
176
177
|
}
|
|
177
178
|
// Candidate construction only. Call shareLemmaCuts or the containing machine checker before admission.
|
|
178
179
|
export function proposeLemmaCuts(goal, tree, options = {}) {
|
|
179
|
-
const started =
|
|
180
|
+
const started = countedSearchNow(), root = options.path ?? new Map(), until = options.until ?? Infinity;
|
|
180
181
|
const sizes = new WeakMap(), repeats = new Map();
|
|
181
182
|
const measure = (t) => {
|
|
182
183
|
if ('leaf' in t) {
|
|
@@ -271,7 +272,7 @@ export function proposeLemmaCuts(goal, tree, options = {}) {
|
|
|
271
272
|
return { when, cut: t.split, tree: proof, slice };
|
|
272
273
|
};
|
|
273
274
|
const visit = (t, original, real) => {
|
|
274
|
-
if (
|
|
275
|
+
if (countedSearchNow() >= until)
|
|
275
276
|
return undefined;
|
|
276
277
|
if ('leaf' in t) {
|
|
277
278
|
const copy = { ...t };
|
|
@@ -290,8 +291,8 @@ export function proposeLemmaCuts(goal, tree, options = {}) {
|
|
|
290
291
|
found = usable;
|
|
291
292
|
}
|
|
292
293
|
if (found === undefined) {
|
|
293
|
-
const begun =
|
|
294
|
-
options.trace?.({ stage: 'lemma', produced: !!lemma, nodes: sizes.get(t.no) ?? 0, ms:
|
|
294
|
+
const begun = countedSearchNow(), lemma = makeLemma(t, original, real);
|
|
295
|
+
options.trace?.({ stage: 'lemma', produced: !!lemma, nodes: sizes.get(t.no) ?? 0, ms: countedSearchNow() - begun, when: lemma?.when.length ?? -1, hyps: lemma?.slice?.length ?? -1 });
|
|
295
296
|
if (lemma) {
|
|
296
297
|
const key = keyOf(lemma.when, lemma.cut);
|
|
297
298
|
found = shared.get(key);
|
|
@@ -345,21 +346,21 @@ export function proposeLemmaCuts(goal, tree, options = {}) {
|
|
|
345
346
|
const count = (t) => 'leaf' in t ? 1 : 1 + count(t.yes) + count(t.no);
|
|
346
347
|
const after = count(out) + lemmas.reduce((n, l) => n + count(l.tree), 0);
|
|
347
348
|
const workBefore = before * Math.max(1, goal.hyps.length), workAfter = count(out) * Math.max(1, scoped.hyps.length) + lemmas.reduce((n, l) => n + count(l.tree) * Math.max(1, l.slice?.length ?? scoped.hyps.length), 0);
|
|
348
|
-
if (workAfter >= workBefore ||
|
|
349
|
+
if (workAfter >= workBefore || countedSearchNow() >= until) {
|
|
349
350
|
options.trace?.({ stage: 'not-cheaper-or-expired', before, after, workBefore, workAfter });
|
|
350
351
|
return undefined;
|
|
351
352
|
}
|
|
352
|
-
return { goal: scoped, tree: out, lemmas, stats: { before, after, cuts: lemmas.length, sourceHyps: goal.hyps.length, lemmaHyps: lemmas.reduce((n, l) => n + (l.slice?.length ?? scoped.hyps.length), 0), mainNodes: count(out), checkMs: 0, buildMs:
|
|
353
|
+
return { goal: scoped, tree: out, lemmas, stats: { before, after, cuts: lemmas.length, sourceHyps: goal.hyps.length, lemmaHyps: lemmas.reduce((n, l) => n + (l.slice?.length ?? scoped.hyps.length), 0), mainNodes: count(out), checkMs: 0, buildMs: countedSearchNow() - started } };
|
|
353
354
|
}
|
|
354
355
|
export function shareLemmaCuts(goal, tree, options = {}) {
|
|
355
356
|
const proposed = proposeLemmaCuts(goal, tree, options);
|
|
356
357
|
if (!proposed)
|
|
357
358
|
return undefined;
|
|
358
|
-
const start =
|
|
359
|
+
const start = countedSearchNow(), checked = checkGoalLemmas(proposed.goal, proposed.tree, proposed.lemmas);
|
|
359
360
|
if (!checked) {
|
|
360
361
|
options?.trace?.({ stage: 'kernel-rejected' });
|
|
361
362
|
return undefined;
|
|
362
363
|
}
|
|
363
|
-
proposed.stats.checkMs =
|
|
364
|
+
proposed.stats.checkMs = countedSearchNow() - start;
|
|
364
365
|
return proposed;
|
|
365
366
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface LiftArguments {
|
|
2
|
+
capsule: string;
|
|
3
|
+
source: string;
|
|
4
|
+
out?: string;
|
|
5
|
+
sha256?: string;
|
|
6
|
+
emitOnly: boolean;
|
|
7
|
+
json: boolean;
|
|
8
|
+
timeoutMs: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseLiftArguments(argv: string[]): LiftArguments;
|
|
11
|
+
export declare function liftMain(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Node-only command adapter. The capsule is data, never an executable module.
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import { readFileSync, writeFileSync, lstatSync, realpathSync } from 'node:fs';
|
|
5
|
+
import { basename, isAbsolute, join, resolve, sep } from 'node:path';
|
|
6
|
+
import { lift } from "../lean-kernel/lift.js";
|
|
7
|
+
import { auditLiftLog, gate } from "../lean-kernel/axiom-audit.js";
|
|
8
|
+
export function parseLiftArguments(argv) {
|
|
9
|
+
const positional = [], seen = new Set();
|
|
10
|
+
const options = { capsule: '', source: '', emitOnly: false, json: false, timeoutMs: 1_800_000 };
|
|
11
|
+
for (let i = 0; i < argv.length; i++) {
|
|
12
|
+
const a = argv[i];
|
|
13
|
+
if (!a.startsWith('--')) {
|
|
14
|
+
positional.push(a);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (seen.has(a))
|
|
18
|
+
throw Error('duplicate lift option: ' + a);
|
|
19
|
+
seen.add(a);
|
|
20
|
+
if (a === '--emit-only')
|
|
21
|
+
options.emitOnly = true;
|
|
22
|
+
else if (a === '--json')
|
|
23
|
+
options.json = true;
|
|
24
|
+
else if (a === '--out' || a === '--sha256' || a === '--timeout-ms') {
|
|
25
|
+
const value = argv[++i];
|
|
26
|
+
if (!value || value.startsWith('--'))
|
|
27
|
+
throw Error('missing value for ' + a);
|
|
28
|
+
if (a === '--out')
|
|
29
|
+
options.out = value;
|
|
30
|
+
else if (a === '--sha256') {
|
|
31
|
+
if (!/^[a-f0-9]{64}$/.test(value))
|
|
32
|
+
throw Error('invalid capsule SHA-256');
|
|
33
|
+
options.sha256 = value;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
const n = Number(value);
|
|
37
|
+
if (!Number.isSafeInteger(n) || n < 1 || n > 7_200_000)
|
|
38
|
+
throw Error('invalid lift timeout');
|
|
39
|
+
options.timeoutMs = n;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else
|
|
43
|
+
throw Error('unknown lift option: ' + a);
|
|
44
|
+
}
|
|
45
|
+
if (positional.length !== 2)
|
|
46
|
+
throw Error('usage: gdp-wired lift <capsule> <source.json> [--out DIR] [--emit-only] [--sha256 HASH] [--timeout-ms N] [--json]');
|
|
47
|
+
options.capsule = positional[0];
|
|
48
|
+
options.source = positional[1];
|
|
49
|
+
return options;
|
|
50
|
+
}
|
|
51
|
+
const sha = (data) => createHash('sha256').update(data).digest('hex');
|
|
52
|
+
function verifyFiles(directory, files) {
|
|
53
|
+
if (!files || typeof files !== 'object' || !Object.keys(files).length)
|
|
54
|
+
throw Error('missing emitted file hashes');
|
|
55
|
+
const realRoot = realpathSync(directory);
|
|
56
|
+
for (const [name, digest] of Object.entries(files)) {
|
|
57
|
+
const path = resolve(directory, name);
|
|
58
|
+
if (isAbsolute(name) || !path.startsWith(directory + sep) || !/^[a-f0-9]{64}$/.test(digest))
|
|
59
|
+
throw Error('invalid emitted path/hash: ' + name);
|
|
60
|
+
const stat = lstatSync(path);
|
|
61
|
+
if (!stat.isFile() || stat.isSymbolicLink() || !realpathSync(path).startsWith(realRoot + sep) || sha(readFileSync(path)) !== digest)
|
|
62
|
+
throw Error('emitted file changed: ' + name);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export async function liftMain(argv) {
|
|
66
|
+
let output;
|
|
67
|
+
try {
|
|
68
|
+
const args = parseLiftArguments(argv);
|
|
69
|
+
output = resolve(args.out ?? basename(args.source).replace(/\.json$/, '') + '.lift');
|
|
70
|
+
const manifest = lift(resolve(args.capsule), resolve(args.source), output, { expectedManifestSha256: args.sha256 });
|
|
71
|
+
if (args.emitOnly) {
|
|
72
|
+
console.log(args.json ? JSON.stringify(manifest) : `EMITTED_NOT_CHECKED: ${output}`);
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
const emission = readFileSync(join(output, 'EMITTED.json'));
|
|
76
|
+
verifyFiles(output, manifest.files);
|
|
77
|
+
const commands = [];
|
|
78
|
+
const run = (label, command) => {
|
|
79
|
+
const result = spawnSync(command[0], command.slice(1), { cwd: output, env: { ...process.env, GDP_LEAN_NATIVE: '0' }, encoding: 'utf8', timeout: args.timeoutMs, maxBuffer: 32 * 1024 * 1024, killSignal: 'SIGKILL' });
|
|
80
|
+
const stdout = result.stdout ?? '', stderr = result.stderr ?? '';
|
|
81
|
+
writeFileSync(join(output, label + '.stdout.log'), stdout, { flag: 'wx' });
|
|
82
|
+
writeFileSync(join(output, label + '.stderr.log'), stderr, { flag: 'wx' });
|
|
83
|
+
if (result.error || result.signal || result.status !== 0)
|
|
84
|
+
throw Error(`${label} failed: ${result.error?.message ?? result.signal ?? result.status}`);
|
|
85
|
+
commands.push({ command, exitCode: result.status, stdoutSha256: sha(stdout), stderrSha256: sha(stderr) });
|
|
86
|
+
return stdout + '\n' + stderr;
|
|
87
|
+
};
|
|
88
|
+
const build = run('lift-build', ['lake', 'build']);
|
|
89
|
+
const buildErrors = gate(build, [], false);
|
|
90
|
+
if (buildErrors.length || /\berror:/.test(build))
|
|
91
|
+
throw Error(buildErrors.join('; ') || 'Lean build reported an error');
|
|
92
|
+
const log = run('lift-root', ['lake', 'env', 'lean', 'BapaProof.lean']);
|
|
93
|
+
const declarations = manifest;
|
|
94
|
+
const sourceTheorems = declarations.sourceProjection?.sourceTheorems;
|
|
95
|
+
if (!sourceTheorems?.length)
|
|
96
|
+
throw Error('missing original source theorem coverage');
|
|
97
|
+
const required = declarations.requiredTheorems ?? [declarations.familyTheorem, ...sourceTheorems];
|
|
98
|
+
const axioms = auditLiftLog(log, [readFileSync(join(output, 'BapaProof.lean'), 'utf8')], required);
|
|
99
|
+
verifyFiles(output, manifest.files);
|
|
100
|
+
if (sha(readFileSync(join(output, 'EMITTED.json'))) !== sha(emission))
|
|
101
|
+
throw Error('emission manifest changed during Lean execution');
|
|
102
|
+
const receipt = { schema: 'gdp-lift-check/v1', status: 'SOURCE_CHECKED', scope: 'provided source machine and laws', emissionSha256: sha(emission), files: manifest.files, commands, checkedTheorems: axioms };
|
|
103
|
+
writeFileSync(join(output, 'LIFT-CHECKED.json'), JSON.stringify(receipt, null, 2) + '\n', { flag: 'wx' });
|
|
104
|
+
console.log(args.json ? JSON.stringify(receipt) : `SOURCE_CHECKED: ${sourceTheorems.join(', ')}\n${output}`);
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
console.error(`gdp-wired lift: ${error instanceof Error ? error.message : String(error)}`);
|
|
109
|
+
if (output)
|
|
110
|
+
console.error(`No source acceptance. Any partial output is retained at ${output}.`);
|
|
111
|
+
return 2;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Lin } from './solver.js';
|
|
2
|
+
export declare function fundedAdd(...inputs: Lin[]): Lin;
|
|
3
|
+
export declare const fundedSub: (a: Lin, b: Lin) => Lin;
|
|
4
|
+
export declare const fundedScale: (a: Lin, factor: number) => Lin;
|
|
5
|
+
export declare const fundedVariable: (name: string) => Lin;
|
|
6
|
+
export declare function fundedConstant(value: number): Lin;
|
|
7
|
+
export declare function admittedLinearProduct(a: Lin, b: Lin, keyOf: (p: string, q: string) => string | undefined, site: string, safeIntegers: boolean): Lin | undefined;
|
|
8
|
+
export declare function everyLinearCell(lin: Lin, test: (key: string, value: number) => boolean, site: string): boolean;
|
|
9
|
+
export declare function visitLinearCells(lin: Lin, visit: (key: string, value: number) => void, site: string): void;
|
|
10
|
+
export declare function admittedLinearSub(a: Lin, b: Lin, site: string): Lin;
|
|
11
|
+
export declare function admittedLinearAdd(a: Lin, b: Lin, site: string): Lin;
|
|
12
|
+
export declare function admittedLinearScale(a: Lin, factor: number, site: string): Lin;
|
|
13
|
+
export declare function admittedLinearCopy(a: Lin, site: string): Lin;
|
|
14
|
+
export declare function admittedLinearVariable(name: string, coefficient: number, site: string): Lin;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Owned two-phase coefficient production. Discovery and output are DISTINCT
|
|
2
|
+
// physical cell operations; zero/cancelled inputs still cost discovery work.
|
|
3
|
+
// Domain: synchronous ordinary data records, no Proxy/exotic prototype. Native
|
|
4
|
+
// own-key enumeration still needs a candidate-specific M1/M3 summary; this
|
|
5
|
+
// module alone does not close the global SIZE/ORDER gate.
|
|
6
|
+
import { add, scale, sub, v } from "./solver.js";
|
|
7
|
+
import { completeWorkProfile } from "./work-profile.js";
|
|
8
|
+
import { BudgetExpired, startWork, withAdmittedChunk } from "./work-admission.js";
|
|
9
|
+
function emitOwned(plan, keepZero, site) {
|
|
10
|
+
// The plan is local and owns primitive values, never references input cells.
|
|
11
|
+
// Map.size and array.length below are intrinsic metadata of owned containers.
|
|
12
|
+
const output = [], iterator = plan.entries(), size = plan.size;
|
|
13
|
+
let nonzero = 0;
|
|
14
|
+
for (let i = 0; i < size; i++) {
|
|
15
|
+
startWork('tableCells', 1, `${site}:select`);
|
|
16
|
+
const entry = iterator.next();
|
|
17
|
+
if (entry.done)
|
|
18
|
+
throw new Error('coefficient plan changed during selection');
|
|
19
|
+
if (entry.value[1] !== 0)
|
|
20
|
+
nonzero++;
|
|
21
|
+
if (keepZero || entry.value[1] !== 0)
|
|
22
|
+
output.push({ key: entry.value[0], value: entry.value[1], charge: entry.value[1] === 0 ? 0 : 1 });
|
|
23
|
+
}
|
|
24
|
+
return withAdmittedChunk('tableCells', nonzero, lease => {
|
|
25
|
+
// This producer cannot return a partial row. Refuse before creating any
|
|
26
|
+
// output coefficient, then let finally retire the unused reservation.
|
|
27
|
+
if (lease.granted !== nonzero)
|
|
28
|
+
throw new BudgetExpired(`${site}:emit`);
|
|
29
|
+
const out = Object.create(null);
|
|
30
|
+
for (let i = 0; i < output.length; i++) {
|
|
31
|
+
const entry = output[i];
|
|
32
|
+
// Occupancy is cached metadata, not a repeated coefficient read. A zero
|
|
33
|
+
// representation entry is no nonzero emission; start(0) validates life.
|
|
34
|
+
lease.start(entry.charge);
|
|
35
|
+
out[entry.key] = entry.value;
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}, `${site}:emit`);
|
|
39
|
+
}
|
|
40
|
+
function discover(inputs, keepZero, site) {
|
|
41
|
+
const plan = new Map();
|
|
42
|
+
for (const { lin, factor } of inputs) {
|
|
43
|
+
const prototype = Object.getPrototypeOf(lin);
|
|
44
|
+
if (prototype !== null && prototype !== Object.prototype)
|
|
45
|
+
throw new TypeError('coefficient input must be an ordinary data record');
|
|
46
|
+
for (const key in lin) {
|
|
47
|
+
startWork('tableCells', 1, `${site}:input`);
|
|
48
|
+
const descriptor = Object.getOwnPropertyDescriptor(lin, key);
|
|
49
|
+
if (!descriptor || !('value' in descriptor) || typeof descriptor.value !== 'number')
|
|
50
|
+
throw new TypeError('coefficient input must have own numeric data cells');
|
|
51
|
+
// This is the first cell lookup/arithmetic/accumulation, after start.
|
|
52
|
+
const value = descriptor.value;
|
|
53
|
+
plan.set(key, plan.has(key) ? plan.get(key) + value * factor : value * factor);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return emitOwned(plan, keepZero, site);
|
|
57
|
+
}
|
|
58
|
+
export function fundedAdd(...inputs) {
|
|
59
|
+
if (!completeWorkProfile.enabled)
|
|
60
|
+
return add(...inputs);
|
|
61
|
+
const plan = [];
|
|
62
|
+
for (let i = 0; i < inputs.length; i++) {
|
|
63
|
+
startWork('ticks', 1, 'linear add operand');
|
|
64
|
+
plan.push({ lin: inputs[i], factor: 1 });
|
|
65
|
+
}
|
|
66
|
+
return discover(plan, false, 'linear:add');
|
|
67
|
+
}
|
|
68
|
+
export const fundedSub = (a, b) => admittedLinearSub(a, b, 'linear:sub');
|
|
69
|
+
export const fundedScale = (a, factor) => admittedLinearScale(a, factor, 'linear:scale');
|
|
70
|
+
export const fundedVariable = (name) => admittedLinearVariable(name, 1, 'linear:variable');
|
|
71
|
+
export function fundedConstant(value) {
|
|
72
|
+
if (!completeWorkProfile.enabled)
|
|
73
|
+
return value === 0 ? {} : { 1: value };
|
|
74
|
+
startWork('tableCells', 1, 'linear:constant:input');
|
|
75
|
+
const plan = new Map();
|
|
76
|
+
if (value !== 0)
|
|
77
|
+
plan.set('1', value);
|
|
78
|
+
return emitOwned(plan, false, 'linear:constant');
|
|
79
|
+
}
|
|
80
|
+
export function admittedLinearProduct(a, b, keyOf, site, safeIntegers) {
|
|
81
|
+
const plan = new Map();
|
|
82
|
+
for (const p in a)
|
|
83
|
+
for (const q in b) {
|
|
84
|
+
startWork('tableCells', 1, `${site}:left`);
|
|
85
|
+
const ad = Object.getOwnPropertyDescriptor(a, p);
|
|
86
|
+
if (!ad || !('value' in ad) || typeof ad.value !== 'number')
|
|
87
|
+
throw new TypeError('product input must have numeric data cells');
|
|
88
|
+
const cp = ad.value;
|
|
89
|
+
startWork('tableCells', 1, `${site}:right`);
|
|
90
|
+
const bd = Object.getOwnPropertyDescriptor(b, q);
|
|
91
|
+
if (!bd || !('value' in bd) || typeof bd.value !== 'number')
|
|
92
|
+
throw new TypeError('product input must have numeric data cells');
|
|
93
|
+
const cq = bd.value, key = keyOf(p, q);
|
|
94
|
+
if (key === undefined)
|
|
95
|
+
return undefined;
|
|
96
|
+
const value = (plan.get(key) ?? 0) + cp * cq;
|
|
97
|
+
if (safeIntegers && ![cp, cq, cp * cq, value].every(Number.isSafeInteger))
|
|
98
|
+
return undefined;
|
|
99
|
+
plan.set(key, value);
|
|
100
|
+
}
|
|
101
|
+
return emitOwned(plan, false, site);
|
|
102
|
+
}
|
|
103
|
+
export function everyLinearCell(lin, test, site) {
|
|
104
|
+
if (!completeWorkProfile.enabled)
|
|
105
|
+
return Object.entries(lin).every(([key, value]) => test(key, value));
|
|
106
|
+
for (const key in lin) {
|
|
107
|
+
if (completeWorkProfile.enabled)
|
|
108
|
+
startWork('tableCells', 1, site);
|
|
109
|
+
const descriptor = Object.getOwnPropertyDescriptor(lin, key);
|
|
110
|
+
if (!descriptor || !('value' in descriptor) || typeof descriptor.value !== 'number')
|
|
111
|
+
throw new TypeError('coefficient input must have numeric data cells');
|
|
112
|
+
if (!test(key, descriptor.value))
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
export function visitLinearCells(lin, visit, site) {
|
|
118
|
+
if (!completeWorkProfile.enabled) {
|
|
119
|
+
for (const [key, value] of Object.entries(lin))
|
|
120
|
+
visit(key, value);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
for (const key in lin) {
|
|
124
|
+
if (completeWorkProfile.enabled)
|
|
125
|
+
startWork('tableCells', 1, `${site}:visit`);
|
|
126
|
+
const descriptor = Object.getOwnPropertyDescriptor(lin, key);
|
|
127
|
+
if (!descriptor || !('value' in descriptor) || typeof descriptor.value !== 'number')
|
|
128
|
+
throw new TypeError('coefficient input must have numeric data cells');
|
|
129
|
+
visit(key, descriptor.value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export function admittedLinearSub(a, b, site) {
|
|
133
|
+
return completeWorkProfile.enabled ? discover([{ lin: a, factor: 1 }, { lin: b, factor: -1 }], false, site) : sub(a, b);
|
|
134
|
+
}
|
|
135
|
+
export function admittedLinearAdd(a, b, site) {
|
|
136
|
+
return completeWorkProfile.enabled ? discover([{ lin: a, factor: 1 }, { lin: b, factor: 1 }], false, site) : add(a, b);
|
|
137
|
+
}
|
|
138
|
+
export function admittedLinearScale(a, factor, site) {
|
|
139
|
+
return completeWorkProfile.enabled ? discover([{ lin: a, factor }], false, site) : scale(a, factor);
|
|
140
|
+
}
|
|
141
|
+
export function admittedLinearCopy(a, site) {
|
|
142
|
+
return completeWorkProfile.enabled ? discover([{ lin: a, factor: 1 }], true, site) : a;
|
|
143
|
+
}
|
|
144
|
+
export function admittedLinearVariable(name, coefficient, site) {
|
|
145
|
+
if (!completeWorkProfile.enabled)
|
|
146
|
+
return coefficient === 1 ? v(name) : { [name]: coefficient };
|
|
147
|
+
startWork('tableCells', 1, `${site}:construct`);
|
|
148
|
+
const plan = new Map();
|
|
149
|
+
plan.set(name, coefficient);
|
|
150
|
+
return emitOwned(plan, true, site);
|
|
151
|
+
}
|
package/dist/core/machine.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export declare const lcg: (x: number) => number;
|
|
|
3
3
|
export type Rand = (k: number) => number;
|
|
4
4
|
export declare const seeded: (seed: number) => Rand;
|
|
5
5
|
export declare const walk: (t: unknown, f: (o: Record<string, unknown>) => void) => void;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const hasFinite: (value: unknown) => boolean;
|
|
7
|
+
export declare const walkOnce: (t: unknown, f: (o: object) => void, before?: () => void) => void;
|
|
7
8
|
export type E = {
|
|
8
9
|
op: 'var';
|
|
9
10
|
name: string;
|
|
@@ -62,6 +63,7 @@ export type C = {
|
|
|
62
63
|
keys?: string[];
|
|
63
64
|
c: C;
|
|
64
65
|
witness?: E;
|
|
66
|
+
finite?: string;
|
|
65
67
|
};
|
|
66
68
|
export type Machine = {
|
|
67
69
|
name: string;
|
|
@@ -207,6 +209,7 @@ export type Law = {
|
|
|
207
209
|
holds: C;
|
|
208
210
|
forall?: string;
|
|
209
211
|
keys?: string[];
|
|
212
|
+
finite?: string;
|
|
210
213
|
stated?: C;
|
|
211
214
|
some?: string[];
|
|
212
215
|
witness?: SomeWitness;
|
|
@@ -295,7 +298,7 @@ export type Compiled = {
|
|
|
295
298
|
head?: number;
|
|
296
299
|
};
|
|
297
300
|
fork: (st: State) => State;
|
|
298
|
-
step: (params: object, st: State, input: object) => State & {
|
|
301
|
+
step: (params: object, st: State, input: object, finiteCheck?: () => void) => State & {
|
|
299
302
|
head?: number;
|
|
300
303
|
};
|
|
301
304
|
cells?: (params: object, st: State, input: object, tick: () => void) => Record<string, Map<number, number>>;
|