cvc.lean latest release: v4.35.0, for Lean 4.35.0

A high-level, strongly-typed Lean 4 API for the cvc5 SMT solver, built on top of
lean-cvc5.

module
import Cvc
open Cvc Typed

public def main : IO Unit := Env.runIO do
  let solver ← Solver.new
  solver.setOpt .smt_produceModels true
  let x ← Term.mkSymbolAs Int "x"
  let y ← Term.mkSymbolAs Int "y"
  smt! 0 < x ∧ x < y ∧ x + y = 10 >>= solver.assert
  let (xVal, yVal) ← solver.checkSat
    (ifSat := return (← solver.getValue x, ← solver.getValue y))
  println! "x := {xVal}, y := {yVal}"

prints x := 4, y := 6.

Documentation

Using cvc.lean

cvc.lean is not on Reservoir yet: depend on its repository at one of its releases, in
place of vX.Y.Z below.

[[require]]
name = "cvc"
git = "https://github.com/anzenlang/cvc.lean"
rev = "vX.Y.Z"

or, in a lakefile.lean,

require cvc from git "https://github.com/anzenlang/cvc.lean" @ "vX.Y.Z"

then run lake update cvc to record the dependency in your project's lake-manifest.json. This is
needed once when you add cvc.lean, and again when you move to another of its releases; in between,
lake build is all it takes.

Building from source

lake build builds the library and lake test runs the tests and the examples. There is nothing
to set up first: lean-cvc5 downloads the cvc5 release it needs as part of the build.
lake run buildManual and lake run buildApiDocs build the documentation, and lake run serveManual and lake run serveApiDocs serve it locally.

License

Apache 2.0, see LICENSE. The lean-cvc5 bundles attached to releases hold cvc5's static
libraries, under cvc5's licenses and those of its dependencies, which they include.