$ show ufmg-smite/lean-smt
This repository provides a Lean 4 tactic `smt` that automates theorem proving by delegating goals to the cvc5 SMT solver and reconstructing the resulting proof in Lean. It supports a range of theories including uninterpreted functions, linear integer and real arithmetic, bitvectors, strings, and quantifiers. The codebase is organized into preprocessing (normalization, monomorphization, embedding), translation to SMT-LIB, solver communication, and proof reconstruction for each theory. The project is in beta but actively developed, with extensive test coverage across supported domains. While the primary interface is a tactic, the architecture reveals multiple reusable components such as an S-expression DSL, SMT term representation, graph data structure, and a configurable WHNF reduction engine. The main entry point is `Smt/Tactic/Smt.lean`, and the library is distributed as a Lean package. The code is tightly integrated with the cvc5 FFI and Lean's metaprogramming infrastructure, making it primarily a library rather than a standalone application, but it fits the 'application' category as a tool for interactive theorem proving.
The LLM identified 3 files worth highlighting for reuse:
Implements an S-expression data structure and a DSL macro `sexp!{...}` for building parsed S-expressions. This is a self-contained utility that can be extracted for any project requiring S-expression parsing/printing, especially relevant for SMT-LIB interaction. It demonstrates clean functional design and macro writing.
Provides a simple, generic graph data structure (nodes, edges) with basic operations. It is standalone, with no internal dependencies outside standard Lean libraries. Could be reused in any Lean project needing a graph representation. It demonstrates a well-typed, functional graph implementation.
Defines an inductive term language (`proof.term`, `proof.sort`, `proof.value`) that mirrors SMT-LIB operators as a Lean type, along with a set of proof rules. This component is part of the certified proof reconstruction layer and is largely self-contained within the `Certified` submodule. It can serve as a reference or be extracted for formalizing SMT proof calculi in other settings.