arXiv:2611.00185cs.LOOct 2026

Manuscript Offprint

arXiv:2611.00185

Blazing-Fast SMT-LIB Parsing for Rust and Lean

Jan Onderka, Armin Biere, Henrik Böving

Jan Onderka¹, Armin Biere¹, and Henrik Böving²

¹ University of Freiburg, Germany {onderka,biere}@cs.uni-freiburg.de ² Lean FRO, Germany henrik@lean-fro.org

Abstract. SMT-LIB is a standard input format for Satisfiability Modulo Theories (SMT) solvers. However, parsing the format is non-trivial and can become a bottleneck, e.g. when retrieving benchmark metadata or normalising the input for solvers. We introduce blazing-smtlib, a Rust parsing library for SMT-LIB, and BSmtLib, its port to Lean. We outline the library API we designed for composability and extensibility (including non-standard SMT-LIB commands), and discuss our implementation decisions for fast lexing and parsing. We proved that our lexing and parsing with Lean-specific optimisations match our formalised reading of the SMT-LIB syntax. We measured performance on a representative sample from the 2025 SMT-LIB corpus and found that blazing-smtlib is more than 6 times faster on the geometric mean than previous parsing libraries and BSmtLib is faster or comparable to them.

Keywords: Satisfiability Modulo Theories · Interactive Theorem Proving · composable parser library · push-style zero-copy parsing

1 Introduction

Satisfiability Modulo Theories (SMT) solving is an important and rich topic in verification and automated reasoning. The almost universal input format for SMT solvers is SMT-LIB 2 [8], with a wide corpus of SMT benchmarks [42, 43] that can be used to test the solvers and is used to compare their performance in the annual SMT solver competition (SMT-COMP) [50].

While SMT-LIB 2 is human-readable and it is fairly easy to implement a parser that reads the standard benchmarks, writing a specification-compliant parser that covers all syntactic constructs is hard. There are SMT-LIB parsing libraries available for some programming languages but they tend to lack extensibility for non-standard commands that solvers with custom parsers can support and are not thoroughly optimised for performance.

We present blazing-smtlib, a high-performance SMT-LIB parsing library written in the programming language Rust, and its port BSmtLib in the Interactive Theorem Prover (ITP) language Lean [31].

Both libraries are composable and extensible, allowing implementation of solvers with non-standard commands, reparsers, pretty-printers, response parsers etc. They are zero-dependency (only using the standard library of Rust / Lean), contain no unsafe code, and are tested on a variety of valid and invalid inputs and the 2025 SMT-LIB corpus. BSmtLib lexing and parsing is additionally proven to match our reading of the SMT-LIB syntax formalised in Lean. On a geometric mean over a representative sample from the 2025 SMT-LIB corpus, blazing-smtlib is more than 6 times faster than previous parsing libraries and BSmtLib is faster or comparable to them.

References (48)