Liking cljdoc? Tell your friends :D

hive-ansatz

Clojars Project cljdoc release License: MIT

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 + AnsatzCborCodec (only ns touching ansatz classes; the codec uses ansatz.export.codec, so it needs ansatz 0.2.715 or later)
addonhive-ansatz.addonIAddon record; ansatz_proofs supertool

Core namespaces never require ansatz. The adapter loads only when ansatz is on the classpath. Without a prover the addon initializes degraded with the recipes surface still available.

deps.edn is :mvn/version-only and does not name ansatz. It is supplied by the untracked local.deps.edn (org.replikativ/ansatz, 0.2.715 or later):

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/cbor-codec))

(p/export! env env codec "exports/session.cbor" {:exclude #{"scratch"}})
(p/import! env env codec "exports/session.cbor")
;; => {: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