Liking cljdoc? Tell your friends :D

hive-ansatz

Prover-agnostic proof persistence for ansatz-style kernel environments, packaged as a host-neutral hive-addon (IAddon 0.2.0).

What it does

  • Export a live prover env's local overlay (session-proved defns, equation lemmas, theorems with proof terms) to a durable snapshot file.
  • Import a snapshot into an env, then kernel-re-verify every theorem — a snapshot is only trusted after :all-verified true.
  • Inspect snapshots without touching the env.
  • Proving idioms as data (hive-ansatz.recipes) — deterministic, simp-free tactic strategies for large stores, queryable by tag.

Architecture (CPPB / SOLID)

layernsrole
typeshive-ansatz.schemamalli value objects (drive m/=> + synthesized tests)
portshive-ansatz.portsIProofEnv / IDeclInfo / IDeclCodec (ISP; decls stay opaque)
purehive-ansatz.snapshotselection + import-plan decisions
purehive-ansatz.recipesidioms as data (OCP: new idiom = new entry)
boundaryhive-ansatz.persistenceexport! / import! / inspect over injected ports (DIP)
adapterhive-ansatz.adapters.ansatzLiveAnsatzEnv + AnsatzFressianCodec (only ns touching ansatz classes; codec delegates to hive-fressian)
addonhive-ansatz.addonIAddon record; ansatz_proofs supertool

Core namespaces never require ansatz or hive-fressian — the adapter loads only when both are on the classpath. Without a prover the addon initializes degraded with the recipes surface still available.

deps.edn is :mvn/version-only. Unpublished deps (ansatz, hive-fressian pre-publish) are supplied by the untracked local.deps.edn:

clj -Sdeps "$(cat local.deps.edn)" -M:test ...

Usage

;; with ansatz on the classpath and a live env
(require '[hive-ansatz.adapters.ansatz :as ad]
         '[hive-ansatz.persistence :as p])

(def env (ad/live-env))
(def codec (ad/fressian-codec))

(p/export! env env codec "exports/session.fressian" {:exclude #{"scratch"}})
(p/import! env env codec "exports/session.fressian")
;; => {:added [..] :skipped [..] :all-verified true :results {..}}

Tests

clj -M:test -e "(require 'hive-ansatz.snapshot-test 'hive-ansatz.recipes-test)(let [r (clojure.test/run-all-tests #\"hive-ansatz.*-test\")](shutdown-agents)(System/exit (+ (:fail r)(:error r))))"

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close