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/cycles.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { traceNow as countedTraceNow } from "./wall.js";
|
|
1
2
|
import { argsKey, atMost as le, compileFunction, cpair, cunpair, evalC as evalMC, evalE as evalME, fnValue, get, interpret, minus as sub, n as k, pairedArgs, plus as add, same as eqC, seeded, tupleParts, walk, x as v } from "./machine.js";
|
|
2
3
|
import { check, livenessHelpful, livenessParts, loopLiveness, loopMachine, loopObligations, strongly, substC, substE } from "../kernel/kernel.js";
|
|
3
4
|
import { checkCyclic, factsAvoid, lexLt } from "../kernel/cyclic.js";
|
|
@@ -638,10 +639,10 @@ const holdsExactly = (rows, w) => rows.every(l => {
|
|
|
638
639
|
function exactSolve(rows, until) {
|
|
639
640
|
// (the rows scaled to their largest entry first, then as they are: either way the tolerance may hide what a row of a
|
|
640
641
|
// vertex at 2^31 says, a coefficient 2^−31 read as 0 or 0 as 2^−31; infeasible where both say so)
|
|
641
|
-
const t0 =
|
|
642
|
+
const t0 = countedTraceNow(), first = floatSolve(rows, until), second = first && first !== 'infeasible' ? first : floatSolve(rows, until, false);
|
|
642
643
|
const fast = second && second !== 'infeasible' ? second : first === 'infeasible' && second === 'infeasible' ? 'infeasible' : undefined;
|
|
643
644
|
if (lpTrace)
|
|
644
|
-
console.error(`[lp] ${rows.length} rows ${new Set(rows.flatMap(l => Object.keys(l))).size} unknowns: ${fast === undefined ? 'undefined' : fast === 'infeasible' ? 'infeasible' : 'found'} ${Math.round(
|
|
645
|
+
console.error(`[lp] ${rows.length} rows ${new Set(rows.flatMap(l => Object.keys(l))).size} unknowns: ${fast === undefined ? 'undefined' : fast === 'infeasible' ? 'infeasible' : 'found'} ${Math.round(countedTraceNow() - t0)} ms`);
|
|
645
646
|
if (fast === 'infeasible')
|
|
646
647
|
return undefined;
|
|
647
648
|
if (fast)
|
|
@@ -1740,9 +1741,9 @@ export function findRank(l, laws = [], opts = {}) {
|
|
|
1740
1741
|
if (trace)
|
|
1741
1742
|
console.error(`[cycles] ${l.name}: the relation's rank ${'rank' in rel ? rel.text : rel.why} (from ${Math.round(relT0 - t0)} ms to ${Math.round(clock() - t0)} ms)`);
|
|
1742
1743
|
if ('rank' in rel) {
|
|
1743
|
-
const k0 =
|
|
1744
|
+
const k0 = countedTraceNow(), verdict = withDeadline(until, () => goalsProven(loopObligations(l, laws, rel.rank)));
|
|
1744
1745
|
if (trace)
|
|
1745
|
-
console.error(`[cycles] ${l.name}: the kernel on the relation's rank, ${Math.round(
|
|
1746
|
+
console.error(`[cycles] ${l.name}: the kernel on the relation's rank, ${Math.round(countedTraceNow() - k0)} ms: ${'trees' in verdict ? 'proven' : `${verdict.goal} ${verdict.stuck}`}`);
|
|
1746
1747
|
if ('trees' in verdict)
|
|
1747
1748
|
return done(rel.rank, verdict.trees);
|
|
1748
1749
|
relWhy = `the kernel refused ${rel.text.slice(0, 300)} at ${verdict.goal}`;
|
package/dist/core/cyclic.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { traceNow as countedTraceNow } from "./wall.js";
|
|
1
2
|
// Cyclic proofs found. Untrusted: an instance states the nodes and their uses, kernel/prove.ts grows a tree for every
|
|
2
3
|
// goal, and kernel/cyclic.ts checks the whole. The instances are today's induction rules said as one rule, each a
|
|
3
4
|
// graph of sequents whose back-edges lower a rank:
|
|
@@ -76,7 +77,7 @@ const profOn = () => env.GDP_CYCLIC_PROF === '1';
|
|
|
76
77
|
export function timedKind(kind, hyps, f) {
|
|
77
78
|
if (!profOn())
|
|
78
79
|
return f();
|
|
79
|
-
const was = profile.on, s0 = profile.solveMs, r0 = profile.rowsMs, t0 =
|
|
80
|
+
const was = profile.on, s0 = profile.solveMs, r0 = profile.rowsMs, t0 = countedTraceNow();
|
|
80
81
|
profile.on = true;
|
|
81
82
|
try {
|
|
82
83
|
return f();
|
|
@@ -84,7 +85,7 @@ export function timedKind(kind, hyps, f) {
|
|
|
84
85
|
finally {
|
|
85
86
|
profile.on = was;
|
|
86
87
|
const p = (cyclicProf[kind] ??= { ms: 0, n: 0, hyps: 0, solveMs: 0, rowsMs: 0 });
|
|
87
|
-
p.ms +=
|
|
88
|
+
p.ms += countedTraceNow() - t0;
|
|
88
89
|
p.n++;
|
|
89
90
|
p.hyps += hyps;
|
|
90
91
|
p.solveMs += profile.solveMs - s0;
|
|
@@ -216,9 +217,9 @@ export function proveCyclic(facts, specs, order0, grownBefore = searched, st = t
|
|
|
216
217
|
const sliced = sliceOn() ? slice(g, own) : undefined, part = sliced && hide(sliced);
|
|
217
218
|
if (part) {
|
|
218
219
|
// (within two seconds: a weaker goal no easier than the whole is left to the whole)
|
|
219
|
-
const t0 =
|
|
220
|
+
const t0 = countedTraceNow(), p = timedKind(`${kind} sliced`, part.hyps.length, () => grow(part, new Map(), { nodes: 0, until: clock() + Math.min(2_000, later ?? 2_000) }));
|
|
220
221
|
if (env.GDP_CYCLIC_DEBUG)
|
|
221
|
-
console.error(`[cyc] ${g.name}: ${part.hyps.length} hyps${part !== sliced ? ' (opaque)' : ''}, ${'tree' in p ? `${p.nodes} nodes` : p.stuck}, ${Math.round(
|
|
222
|
+
console.error(`[cyc] ${g.name}: ${part.hyps.length} hyps${part !== sliced ? ' (opaque)' : ''}, ${'tree' in p ? `${p.nodes} nodes` : p.stuck}, ${Math.round(countedTraceNow() - t0)} ms`);
|
|
222
223
|
if ('tree' in p)
|
|
223
224
|
return { tree: p.tree, from: part, used: () => new Set([...usedHyps(part, p.tree)].flatMap(i => part.from[i])) };
|
|
224
225
|
if (part !== sliced) {
|
|
@@ -1409,9 +1410,9 @@ export function crossCyclic(kind, name, usual, run0, usualMs, translated) {
|
|
|
1409
1410
|
delete cyclicProf[key];
|
|
1410
1411
|
// (a search within GDP_CERT_MS: one cut by it, or none to make where the translation fails, leaves the proof uncovered,
|
|
1411
1412
|
// not differing)
|
|
1412
|
-
const route = routeOf(), st = tstats(), t0 =
|
|
1413
|
+
const route = routeOf(), st = tstats(), t0 = countedTraceNow(), until = clock() + certMs();
|
|
1413
1414
|
const { out, how, why } = cyclicOf(route !== 'search' && usual ? translated : undefined, run, st, until, usualMs);
|
|
1414
|
-
const ms = Math.round(
|
|
1415
|
+
const ms = Math.round(countedTraceNow() - t0), cyclic = out.proven && out.checked;
|
|
1415
1416
|
if (usual && !cyclic && (!run0 || clock() > until)) {
|
|
1416
1417
|
uncovered(kind, name, `no cyclic proof found${run0 ? ` within ${certMs()} ms` : ''}${why ? ` (not translated: ${why})` : ''}`);
|
|
1417
1418
|
return;
|
|
@@ -1419,8 +1420,8 @@ export function crossCyclic(kind, name, usual, run0, usualMs, translated) {
|
|
|
1419
1420
|
const prof = profLine();
|
|
1420
1421
|
let search;
|
|
1421
1422
|
if (route === 'both' && run0) {
|
|
1422
|
-
const s0 =
|
|
1423
|
-
search = { searchMs: Math.round(
|
|
1423
|
+
const s0 = countedTraceNow(), o = run0();
|
|
1424
|
+
search = { searchMs: Math.round(countedTraceNow() - s0), searchCyclic: o.proven && o.checked };
|
|
1424
1425
|
}
|
|
1425
1426
|
cycLog({ kind, name, usual, cyclic, ms, ...(usualMs === undefined ? {} : { usualMs: Math.round(usualMs) }), route: how, ...(how !== 'searched' ? st : {}), ...(why ? { fellBack: why } : {}), ...search, ...prof, ...(out.proven ? { nodes: out.proof.nodes.length, ...(out.why ? { why: out.why } : {}) } : { goal: out.goal, stuck: out.stuck }) });
|
|
1426
1427
|
const lax = env.GDP_CYCLIC_LAX === '1';
|
|
@@ -1445,10 +1446,10 @@ export const uncovered = (kind, name, why) => cycLog({ kind, name, uncovered: tr
|
|
|
1445
1446
|
export function certCyclic(kind, name, translated, run0, usualMs, floor) {
|
|
1446
1447
|
for (const key of Object.keys(cyclicProf))
|
|
1447
1448
|
delete cyclicProf[key];
|
|
1448
|
-
const st = tstats(), t0 =
|
|
1449
|
+
const st = tstats(), t0 = countedTraceNow(), until = withinDeadline(clock() + certMs());
|
|
1449
1450
|
const { out, how, why } = cyclicOf(translated, (translated && !certSearch() ? undefined : run0) ?? none, st, until, usualMs, floor);
|
|
1450
1451
|
const checked = out.proven && out.checked;
|
|
1451
|
-
cycLog({ kind, name, cert: true, usual: true, cyclic: checked, ms: Math.round(
|
|
1452
|
+
cycLog({ kind, name, cert: true, usual: true, cyclic: checked, ms: Math.round(countedTraceNow() - t0), ...(usualMs === undefined ? {} : { usualMs: Math.round(usualMs) }), route: how, ...(how !== 'searched' ? st : {}), ...(why ? { fellBack: why } : {}), ...profLine() });
|
|
1452
1453
|
const expired = late(until) ? ' within the caller or certificate budget' : '';
|
|
1453
1454
|
return { checked, ...(out.proven ? { proof: out.proof } : {}), why: checked ? '' : `no cyclic proof found${expired}${why ? ` (not translated: ${why})` : ''}` };
|
|
1454
1455
|
}
|
package/dist/core/data.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { traceNow as countedTraceNow } from "./wall.js";
|
|
1
2
|
// Recursive datatypes as values, proven by cyclic proofs. Untrusted: this file states facts and nodes, kernel/prove.ts
|
|
2
3
|
// grows a tree for every goal, and kernel/cyclic.ts checks the whole, as for every cyclic proof (nothing here is new to
|
|
3
4
|
// the kernel). Lean's twin of a proof (lean-kernel/Data.lean and the export's own definitions) is about the datatype as
|
|
@@ -1620,7 +1621,7 @@ function termination(ring, why) {
|
|
|
1620
1621
|
const names = ring.map(f => f.name);
|
|
1621
1622
|
if (dataTrace)
|
|
1622
1623
|
console.error(`[data] termination of ${names.join(', ')}`);
|
|
1623
|
-
const t0 =
|
|
1624
|
+
const t0 = countedTraceNow();
|
|
1624
1625
|
if (!ring.some(f => f.params.some(p => measurable(p.sort))))
|
|
1625
1626
|
throw new Error(`${why}, and ${ring.length === 1 ? 'it has' : 'its ring has'} no parameter a measure reads (a natural or a datatype value)`);
|
|
1626
1627
|
const sites = ringSites(ring);
|
|
@@ -1633,13 +1634,13 @@ function termination(ring, why) {
|
|
|
1633
1634
|
guardedLeft.ms = guardedMs.ms * ring.length;
|
|
1634
1635
|
const invs = nested ? invariantsOf(ring) : [ring.map(() => undefined)];
|
|
1635
1636
|
if (dataTrace)
|
|
1636
|
-
console.error(`[data] its runs: ${edges.length} calls at ${Math.round(
|
|
1637
|
+
console.error(`[data] its runs: ${edges.length} calls at ${Math.round(countedTraceNow() - t0)} ms`);
|
|
1637
1638
|
try {
|
|
1638
1639
|
// (a nested call's arguments read the ring itself, whose values the candidates' samples compute: within the bounds)
|
|
1639
1640
|
for (const ms of nested ? bounded(() => candidates(ring, edges, sites, until)) : candidates(ring, edges, sites, until)) {
|
|
1640
1641
|
const text = ringText(ring, ms);
|
|
1641
1642
|
if (dataTrace)
|
|
1642
|
-
console.error(`[data] ${text} at ${Math.round(
|
|
1643
|
+
console.error(`[data] ${text} at ${Math.round(countedTraceNow() - t0)} ms`);
|
|
1643
1644
|
if (clock() > until) {
|
|
1644
1645
|
tried.push('out of time');
|
|
1645
1646
|
break;
|
|
@@ -1658,7 +1659,7 @@ function termination(ring, why) {
|
|
|
1658
1659
|
break;
|
|
1659
1660
|
const r = proveMeasures(ring, sites, ms, until, inv);
|
|
1660
1661
|
if ('obligations' in r)
|
|
1661
|
-
return ring.map((f, i) => ({ measure: ms[i], text: showMeasure(f, ms[i]), ...(inv[i] ? { invariant: inv[i] } : {}), obligations: r.obligations[i], ms: Math.round(
|
|
1662
|
+
return ring.map((f, i) => ({ measure: ms[i], text: showMeasure(f, ms[i]), ...(inv[i] ? { invariant: inv[i] } : {}), obligations: r.obligations[i], ms: Math.round(countedTraceNow() - t0) }));
|
|
1662
1663
|
tried.push(r.failed);
|
|
1663
1664
|
}
|
|
1664
1665
|
}
|
|
@@ -2668,8 +2669,8 @@ function schemes(p, l) {
|
|
|
2668
2669
|
function instancesOf(p, fs, w) {
|
|
2669
2670
|
// Past the attempt's time, what is found so far (the attempt then fails or proves with it).
|
|
2670
2671
|
const late = () => w.until !== undefined && clock() > w.until;
|
|
2671
|
-
const tt =
|
|
2672
|
-
console.error(`[data] instances: ${what} at ${Math.round(
|
|
2672
|
+
const tt = countedTraceNow(), lap = (what) => { if (dataTrace)
|
|
2673
|
+
console.error(`[data] instances: ${what} at ${Math.round(countedTraceNow() - tt)} ms`); };
|
|
2673
2674
|
const insts = [], seen = new Set();
|
|
2674
2675
|
const inst = (fact, at) => { const i = fs.at.get(fact); if (i === undefined)
|
|
2675
2676
|
return undefined; const id = sid([i, at]); if (seen.has(id))
|
|
@@ -3720,7 +3721,7 @@ function attempt(p, fs, l, scheme, depth, lemmas, level, pool) {
|
|
|
3720
3721
|
const name = title;
|
|
3721
3722
|
// Each attempt within its own time (a goal past it is left unknown, and the attempt fails).
|
|
3722
3723
|
if (dataTrace)
|
|
3723
|
-
console.error(`[data] @${Math.round(
|
|
3724
|
+
console.error(`[data] @${Math.round(countedTraceNow())} ${l.name} (${scheme?.name}) depth ${depth}, ${lemmas.length} lemmas: built in ${Math.round(clock() - t0)} ms (counted), ${specs.length} nodes, ${specs.reduce((n, x) => n + x.insts.length, 0)} instances`);
|
|
3724
3725
|
if (clock() > t0 + attemptMs.ms)
|
|
3725
3726
|
return { verdict: { proven: false, checked: false, node: name, goal: name, stuck: 'unknown' }, specs, main: base };
|
|
3726
3727
|
const was = pairedKeys.skip;
|
|
@@ -5112,7 +5113,7 @@ export function proveData(l, opts = {}) {
|
|
|
5112
5113
|
return counted(dataRate, () => bounded(() => { const until = clock() + (opts.ms ?? 120_000), v = proveDataCounted(l, opts, until); return { ...v, stopped: clock() > until }; }));
|
|
5113
5114
|
}
|
|
5114
5115
|
function proveDataCounted(l, opts, until) {
|
|
5115
|
-
const t0 =
|
|
5116
|
+
const t0 = countedTraceNow();
|
|
5116
5117
|
// Where the law calls a non-recursive function, or reaches a recursive one that agrees with a built-in (core/transfer.ts):
|
|
5117
5118
|
// the law alone at one unfolding first, then the law said through them, then the rest of the search on the law.
|
|
5118
5119
|
const plan = opts.transfer === false || opts.induction === false || Array.isArray(opts.lemmas) ? undefined : transferPlan(l);
|
|
@@ -5131,20 +5132,20 @@ function proveDataCounted(l, opts, until) {
|
|
|
5131
5132
|
throw e;
|
|
5132
5133
|
}
|
|
5133
5134
|
if (through?.proven)
|
|
5134
|
-
return { ...through, ms: Math.round(
|
|
5135
|
+
return { ...through, ms: Math.round(countedTraceNow() - t0) };
|
|
5135
5136
|
const rest = searchIn(l, opts, until, undefined, 'rest').verdict;
|
|
5136
|
-
return { ...rest, tried: rest.tried + quick.tried + (through?.tried ?? 0), ms: Math.round(
|
|
5137
|
+
return { ...rest, tried: rest.tried + quick.tried + (through?.tried ?? 0), ms: Math.round(countedTraceNow() - t0), ...(rest.goal || rest.proven ? {} : { goal: quick.goal, stuck: quick.stuck }) };
|
|
5137
5138
|
}
|
|
5138
5139
|
export function searchIn(l, opts, until, ctx, phase = 'all') {
|
|
5139
|
-
const t0 =
|
|
5140
|
+
const t0 = countedTraceNow(), w0 = work.n;
|
|
5140
5141
|
let p = ctx?.p ?? programOf([l, ...(Array.isArray(opts.lemmas) ? opts.lemmas : [])], [], false), fs = ctx?.fs ?? factsOf(p);
|
|
5141
5142
|
const base = ctx?.base ?? [], lv = ctx?.level ?? 0;
|
|
5142
5143
|
let out, proofFacts;
|
|
5143
5144
|
const contexts = new Map([[p, fs]]);
|
|
5144
5145
|
const done = (v) => {
|
|
5145
5146
|
if (dataTrace)
|
|
5146
|
-
console.error(`[data] ${l.name}: ${work.n - w0} units of work in ${Math.round(
|
|
5147
|
-
return { verdict: { law: l.name, ...v, ms: Math.round(
|
|
5147
|
+
console.error(`[data] ${l.name}: ${work.n - w0} units of work in ${Math.round(countedTraceNow() - t0)} ms`);
|
|
5148
|
+
return { verdict: { law: l.name, ...v, ms: Math.round(countedTraceNow() - t0) }, out, facts: proofFacts };
|
|
5148
5149
|
};
|
|
5149
5150
|
if (phase !== 'rest') {
|
|
5150
5151
|
const cex = refute(l, opts.samples ?? 400);
|
|
@@ -5206,9 +5207,9 @@ export function searchIn(l, opts, until, ctx, phase = 'all') {
|
|
|
5206
5207
|
// The steps the law's inductions leave (lemma calculation), then the conjectures from the values.
|
|
5207
5208
|
// (a conjecture that is the law at some of its values, or the law said as an equation with a constant, p(x) = true,
|
|
5208
5209
|
// is proven only by proving the law: none is tried)
|
|
5209
|
-
const tc =
|
|
5210
|
+
const tc = countedTraceNow(), calc = Array.isArray(opts.lemmas) ? [] : calculated(p, l, 2, 6).filter(c => !lawAgain(l, c));
|
|
5210
5211
|
if (dataTrace)
|
|
5211
|
-
console.error(`[data] ${l.name}: ${calc.length} calculated in ${Math.round(
|
|
5212
|
+
console.error(`[data] ${l.name}: ${calc.length} calculated in ${Math.round(countedTraceNow() - tc)} ms`);
|
|
5212
5213
|
const invented = Array.isArray(opts.lemmas) ? [] : synthesizedLemmas(p).filter(c => !lawAgain(l, c));
|
|
5213
5214
|
for (const c of invented)
|
|
5214
5215
|
distributed.add(c);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function withStageDeadline<T, F>(until: number, run: () => T, refused: () => F): T | F;
|
|
2
|
+
export declare function withStageAllowance<T, F>(ms: number, run: () => T, refused: () => F): T | F;
|
|
3
|
+
export declare function withStageWall<T, F>(until: number, run: () => T, refused: () => F): T | F;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Soft search limits are not replacements for the caller's work budget.
|
|
2
|
+
// Legacy mode executes the identical polling path. Full accounting consumes
|
|
3
|
+
// only authenticated refusals belonging to this stage's own endpoint.
|
|
4
|
+
import { budgetEnd, clock, fullRate, inWorkScope, withDeadline, withWall, wallDeadline } from "../kernel/prove.js";
|
|
5
|
+
import { workLedger } from "./work-admission.js";
|
|
6
|
+
import { workFromNumber, workMultiply } from "./work-amount.js";
|
|
7
|
+
import { completeWorkProfile } from "./work-profile.js";
|
|
8
|
+
import { inProxySearch } from "./search-policy.js";
|
|
9
|
+
export function withStageDeadline(until, run, refused) {
|
|
10
|
+
if (!completeWorkProfile.enabled || inProxySearch())
|
|
11
|
+
return withDeadline(until, run);
|
|
12
|
+
if (until === Infinity)
|
|
13
|
+
return workLedger.withCapacityRefusalBoundary(run);
|
|
14
|
+
return workLedger.withDeadlineRefusalBoundary(workMultiply(workFromNumber(until), workFromNumber(fullRate)), run, refused);
|
|
15
|
+
}
|
|
16
|
+
// These two stages previously polled their ms allowance without opening a
|
|
17
|
+
// legacy deadline. Only full accounting adds the admission boundary.
|
|
18
|
+
export function withStageAllowance(ms, run, refused) {
|
|
19
|
+
return completeWorkProfile.enabled && !inProxySearch() ? withStageDeadline(clock() + ms, run, refused) : run();
|
|
20
|
+
}
|
|
21
|
+
// A DSL wall used as a local stage allowance is also a counted deadline inside
|
|
22
|
+
// a work scope. Do not change the legacy wall path, or the supplied endpoint.
|
|
23
|
+
export function withStageWall(until, run, refused) {
|
|
24
|
+
if (inProxySearch())
|
|
25
|
+
return withWall(wallDeadline(until), run);
|
|
26
|
+
return inWorkScope() ? withStageDeadline(Math.min(budgetEnd(), until), run, refused) : withWall(wallDeadline(until), run);
|
|
27
|
+
}
|
package/dist/core/dsl.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type TranslationFields } from './source-check.js';
|
|
2
2
|
import { type C, type E, type Fn, type Law, type Recurrence, type Machine, type Rand, type Request, type State, type Sum } from './machine.js';
|
|
3
|
-
import { type Fold, type Goal, type Liveness, type Loop, type Recur, type StepLaw, type Tree } from '../kernel/kernel.js';
|
|
4
|
-
import { type Report } from '../kernel/prove.js';
|
|
3
|
+
import { type Fold, type Ghosted, type Goal, type Liveness, type Loop, type Recur, type StepLaw, type Tree } from '../kernel/kernel.js';
|
|
4
|
+
import { type Report, type ModelRoundPolicy } from '../kernel/prove.js';
|
|
5
|
+
import { type WorkAmount } from './work-amount.js';
|
|
5
6
|
import { findRing } from './live.js';
|
|
6
7
|
export type TermLike = Term | number;
|
|
7
8
|
export declare const termOf: (t: TermLike) => E;
|
|
@@ -380,6 +381,13 @@ export declare class SeqTable {
|
|
|
380
381
|
row(r: TermLike): SeqRef;
|
|
381
382
|
}
|
|
382
383
|
export declare const everyBelow: (n: TermLike, f: (key: Term) => Cond) => Cond;
|
|
384
|
+
export declare function sizedSort(name: string, size: TermLike): {
|
|
385
|
+
name: string;
|
|
386
|
+
size: Term;
|
|
387
|
+
has: (key: TermLike) => Cond;
|
|
388
|
+
every: (f: (key: Term) => Cond) => Cond;
|
|
389
|
+
some: (f: (key: Term) => Cond) => Cond;
|
|
390
|
+
};
|
|
383
391
|
export type PartsWrite = {
|
|
384
392
|
readonly parts: Record<string, MapWrite>;
|
|
385
393
|
};
|
|
@@ -944,13 +952,35 @@ export type Found = {
|
|
|
944
952
|
facts?: string[];
|
|
945
953
|
rank?: string;
|
|
946
954
|
};
|
|
955
|
+
export type CandidateSeedAudit = {
|
|
956
|
+
status: 'checked' | 'inconclusive';
|
|
957
|
+
kind?: 'usual' | 'counted';
|
|
958
|
+
kept: string[];
|
|
959
|
+
dropped: {
|
|
960
|
+
name: string;
|
|
961
|
+
goal?: string;
|
|
962
|
+
stuck?: 'sat';
|
|
963
|
+
reason?: string;
|
|
964
|
+
}[];
|
|
965
|
+
reason?: string;
|
|
966
|
+
};
|
|
947
967
|
export type ProveOptions = {
|
|
948
968
|
search?: boolean | {
|
|
949
969
|
ms?: number;
|
|
970
|
+
work?: number | WorkAmount;
|
|
950
971
|
cycles?: boolean;
|
|
951
972
|
};
|
|
952
973
|
from?: 'reachable' | 'any';
|
|
953
974
|
fast?: boolean;
|
|
975
|
+
modelRounds?: ModelRoundPolicy;
|
|
976
|
+
candidateSeeds?: {
|
|
977
|
+
kind?: 'usual' | 'counted';
|
|
978
|
+
laws: Law[];
|
|
979
|
+
counts?: NonNullable<Machine['counts']>;
|
|
980
|
+
witnesses?: Record<string, import('./machine.ts').SomeWitness>;
|
|
981
|
+
ghosts?: Pick<Ghosted, 'vars' | 'maps'>;
|
|
982
|
+
report?: (audit: CandidateSeedAudit) => void;
|
|
983
|
+
};
|
|
954
984
|
};
|
|
955
985
|
export declare class Unproven extends Error {
|
|
956
986
|
readonly verdict: Verdict;
|