DEVELOPMENT EDITION · 769442725406
Toolchain Manual

veradic harvest

Find, in idle time, what a project's costly proofs depend on, so that edits to anything else keep them proved.

veradic harvest [--project FILE] [--for SECONDS] [--watch] [-j N]
veradic harvest                 # until the queue is empty
veradic harvest --watch &       # keep running beside an editor or a test loop
veradic harvest --for 600       # at most ten minutes

Every proof is kept in the project's cache by the text of its query, and with the facts of the query that proved it, so that adding a fact (a hint assertion, say) leaves it proved. A change to a fact the query held, a contract its subprogram calls for example, changes that text, and the check goes back to the solver, though most proofs never used that fact. And a check whose proof was hard to find can fail when it is asked again with one more fact.

When prove, run, build or the editor proves a check that takes the solver more than a tenth of a second, it queues the query in .verada/harvest. harvest takes the queue costliest first. For each query it asks the solver which facts the proof used (an unsat core), asks again with those facts alone to check that they prove the goal, and keeps them with the project's other proofs. Later, a check with that goal whose query holds those facts, as the same text, is proved without a solver, whatever else changed.

A query leaves the queue once the solver has answered it, whether or not a core came of it. When the solver gives no answer (it cannot be started, is stopped, or runs out of time), the query is asked again and, still unanswered, stays queued for the next harvest; after three harvests without an answer it is dropped. What came of each query not kept, and why, is written to .verada/harvest/outcomes.

It runs at the lowest scheduling priority, and on macOS as background work, so it uses only processor time nothing else wants: while you type, while tests leave cores free, overnight. While the load average is above the number of cores it waits. One harvester works on a project at a time; another started meanwhile says so and exits. The editor's language server starts one after each proof when the queue has entries, unless its proof.harvest setting is off.

Option Meaning
--project FILE The project (default: verada.toml in the current directory)
--for SECONDS Stop after this long, leaving the rest of the queue
--watch Keep running, taking queries as later proofs queue them
-j, --jobs N Solvers at once (default: half the processor cores)

VERADA_HARVEST_THRESHOLD sets the time above which a proof is queued (seconds, default 0.1); VERADA_HARVEST_NOW makes a harvester work at once, at normal priority, without waiting for the load to fall below the number of cores (for tests, or to have the cores now); VERADA_NO_HARVEST stops the editor from starting one. Only proofs are kept this way, never a counterexample or an undecided check, and only cores the solver has checked. Deleting .verada/harvest empties the queue; the cores already kept stay in .verada/fact-proofs, within the cache's bound (see prover operation).