Frex: dependently-typed algebraic simplification

📅 2023-06-27
🏛️ arXiv.org
📈 Citations: 5
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenges of ensuring termination, semantic reliability, and completeness for user-defined modules in algebraic simplification libraries. We propose a generic algebraic modeling paradigm based on dependent types, formalizing algebraic structures via free algebras (fral) and variable extensions (frex), and enforcing simplification rules at the type level using dependently typed languages (Idris2/Agda). This guarantees strong normalization, semantic soundness, and completeness under a given equational theory for both built-in and user-defined modules. We introduce a novel “interface–implementation” separation, enabling dual modularity: reuse of foundational infrastructure (term representation, reflection, certification) and compositional nesting of existing simplification modules. We experimentally implement verified simplifiers for monoids and their variants (commutative, involutive), demonstrating feasibility, scalability, and high reusability within real-world theorem-proving environments.
📝 Abstract
We present an extensible, mathematically-structured algebraic simplification library design. We structure the library using universal algebraic concepts: a free algebra -- fral -- and a free extension -- frex -- of an algebra by a set of variables. The library's dependently-typed API guarantees simplification modules, even user-defined ones, are terminating, sound, and complete with respect to a well-specified class of equations. Completeness offers intangible benefits in practice -- our main contribution is the novel design. Cleanly separating between the interface and implementation of simplification modules provides two new modularity axes. First, simplification modules share thousands of lines of infrastructure code dealing with term-representation, pretty-printing, certification, and macros/reflection. Second, new simplification modules can reuse existing ones. We demonstrate this design by developing simplification modules for monoid varieties: ordinary, commutative, and involutive. We implemented this design in the new Idris2 dependently-typed programming language, and in Agda.
Problem

Research questions and friction points this paper is trying to address.

Designing a dependently-typed algebraic simplification library
Ensuring termination, soundness, and completeness of simplification modules
Supporting modular extension and proof extraction in Idris 2/Agda
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dependently-typed algebraic simplification library
Modular extension to new theories
Proof extraction and certification
🔎 Similar Papers
No similar papers found.
G
Guillaume Allais
University of St. Andrews, UK
E
Edwin C. Brady
University of St. Andrews, UK
N
N. Corbyn
University of Oxford, UK
Ohad Kammar
Ohad Kammar
University of Edinburgh School of Informatics
programming languages
J
J. Yallop
University of Cambridge, UK