
Nominal Matching Logic with Fixpoints
Abstract
This paper introduces Nominal Matching Logic (NML) and its extension with fixpoint operators, presenting a formalization of nominal logic as a matching logic theory. Published at CPP 2025 (the 14th ACM SIGPLAN International Conference on Certified Programs and Proofs), the work addresses the challenge of specifying and reasoning about programming languages and formal systems that feature binders --- constructs that introduce bound variables, such as -abstraction, universal quantification, and channel restriction. Nominal logic, developed by Gabbay and Pitts, provides powerful principles for reasoning about names and binding, including name swapping (, the simultaneous transposition of names and throughout ), freshness (, asserting is not free in ), and the (new-name) quantifier (). This paper shows that all of nominal logic can be faithfully embedded within matching logic, obtaining a theory called NLML (Nominal Logic as Matching Logic). The key technical contribution is showing that when NLML is extended with set variables and fixpoint operators (specifically the -binder from matching -logic), an -structural induction principle for any nominal binding signature can be derived. This induction principle is essential for proving properties of languages with binders, such as type preservation, confluence, and normalization of the -calculus.
Introduction and Motivation
Programming languages universally feature binding constructs: function definitions bind parameters, let-expressions bind local variables, quantifiers bind logical variables, and pattern matching binds pattern variables. Formally reasoning about programs and languages requires a rigorous treatment of these binders, which involves managing -equivalence (the principle that the choice of bound variable name is irrelevant), capture-avoiding substitution (ensuring that free variables are not accidentally captured when substituting under a binder), and freshness (the ability to choose a variable name that does not conflict with existing names). The nominal approach, pioneered by Gabbay and Pitts in their foundational work on nominal sets, provides an elegant mathematical framework for these concepts based on the idea of name permutations and the finite support principle.
In the nominal approach, names (or atoms) are elements of a countably infinite set, and the key operation is swapping two names throughout a term or structure. A name is fresh for an object (written ) if swapping with any other fresh name leaves unchanged. The quantifier (), read "for some new , holds," asserts the existence of a fresh name satisfying a property. Nominal logic has been successfully applied in proof assistants (notably Nominal Isabelle) and has led to powerful induction principles for reasoning about abstract syntax with binding. However, nominal logic has traditionally existed as a standalone formalism, separate from the matching logic ecosystem that underpins the K framework for programming language semantics. This paper bridges that gap by embedding nominal logic within matching logic, thereby making nominal reasoning techniques available within the K framework and its associated verification tools.
Background: Nominal Logic and Nominal Sets
Nominal sets provide the mathematical semantics for nominal logic. A nominal set is a set equipped with a group action of the group of finite permutations of names (the symmetric group ) on , satisfying the finite support condition: every element has a finite set of names such that any permutation fixing all names in also fixes . Intuitively, is the set of "free names" of . The freshness relation holds when , meaning that the name does not appear "free" in .
The key constructions in nominal sets include the name-abstraction , which represents the equivalence class of pairs modulo -equivalence. Formally, if and only if there exists a fresh name such that , where denotes the swapping (transposition) of and . The name-abstraction type is itself a nominal set, and it provides the mathematical model for binders. For example, the set of -terms modulo -equivalence can be defined as the initial algebra of the functor , where the three summands correspond to variables, applications, and -abstractions respectively. Nominal sets also support a notion of equivariance: a function between nominal sets is equivariant if for all permutations , ensuring that treats all names uniformly.
Nominal Logic as a Matching Logic Theory (NLML)
The core technical construction of the paper is the embedding of nominal logic into matching logic, yielding the theory NLML. The matching logic signature is extended with symbols for names (atoms), name swapping, name abstraction, and the freshness predicate. Specifically, the signature includes:
- A sort for atoms/names, with constants
- A swapping operation , denoting the result of simultaneously swapping all occurrences of and in
- A name-abstraction constructor , representing the abstraction
- A freshness predicate , defined as a matching logic pattern asserting that is not in the support of
The axioms of NLML encode the properties of these operations as matching logic formulas. For example, the axiom for swapping being an involution is . The axiom for -equivalence of name abstractions states:
The freshness predicate is axiomatized to satisfy the expected properties: when (freshness for distinct names), (a name is not fresh for itself), and the equivariance property . The quantifier is defined in terms of the existential quantifier and freshness: , where is the list of free variables of other than . The paper proves that NLML is a sound and faithful embedding of nominal logic, meaning that a judgment is provable in nominal logic if and only if the corresponding matching logic formula is provable in NLML.
Extension with Fixpoints
The central motivation for extending NLML with fixpoint operators is the need for induction principles. Many important properties of languages with binders are proved by structural induction on terms, but because terms are considered modulo -equivalence, the induction principle must respect this equivalence. The standard structural induction principle does not suffice; what is needed is an -structural induction principle that allows the inductive hypothesis to be applied to -equivalent terms. In nominal logic, this takes the form:
To prove for all terms , it suffices to show:
- for all names (variable case)
- (application case)
- For a fresh name (i.e., where are the parameters of ): (abstraction case)
The freshness side-condition in the abstraction case is what makes this an -structural (rather than merely structural) induction principle. By extending NLML with the least fixpoint operator from matching -logic, the paper can express inductive definitions as fixpoints and derive the corresponding induction principles. The least fixpoint is the smallest set satisfying , and the associated induction principle states that for any property , if then . The paper shows that by carefully constructing the functor using the nominal constructions (particularly the quantifier for the binder case), the resulting fixpoint induction principle yields exactly the -structural induction principle.
Deriving the Alpha-Structural Induction Principle
The derivation of the -structural induction principle is the main theorem of the paper. For a nominal binding signature (which specifies the constructors of the term language, indicating which arguments are names, which are terms, and which are abstractions), the paper defines the term sort as a least fixpoint:
where each encodes the arguments of constructor , using name-abstraction for binding positions. The -structural induction principle is then derived from the fixpoint induction rule. For the specific case of the -calculus, the term sort is:
The three disjuncts correspond to variables, applications, and -abstractions. The in the abstraction case ensures that the bound name is chosen fresh. From the fixpoint definition, the paper derives that for any predicate (where are additional parameters), if: (1) holds for all names ; (2) ; and (3) for some fresh (i.e., ), ; then holds for all terms . This is precisely the -structural induction principle as it appears in nominal logic.
Applications to the Lambda-Calculus
The paper illustrates the use of the derived -structural induction principle by proving several fundamental properties of the -calculus within the NLML + fixpoints framework. These include:
- Substitution lemma: The capture-avoiding substitution is well-defined on -equivalence classes. The proof uses -structural induction on , with the freshness condition in the abstraction case ensuring that the bound variable of the abstraction is chosen fresh for both and , thereby avoiding capture.
- Properties of free variables: The set of free variables is well-defined and satisfies the expected equalities, such as for fresh .
- Size/depth properties: Structural metrics on terms (such as the depth of nesting) are well-defined modulo -equivalence.
These proofs demonstrate that the NLML + fixpoints framework provides a practical and rigorous foundation for reasoning about the -calculus and, by extension, about any language with binders whose abstract syntax can be described by a nominal binding signature. The paper notes that the proofs closely mirror informal mathematical practice, where one routinely says "choose fresh" and proceeds by induction on the structure of -equivalence classes.
Proof System and Soundness
The paper presents a proof system for NLML extended with fixpoints, building on the Hilbert-style proof system of matching -logic. The proof system includes all the axioms and rules of matching -logic (including the fixpoint induction rule, or Park's rule: if then ), together with the axioms of NLML for swapping, freshness, name-abstraction, and the quantifier. Soundness of the proof system is established by constructing models in the category of nominal sets. Each matching logic model is built from a nominal set, where the group action of name permutations provides the semantics for the swapping operation, and the support function provides the semantics for the freshness predicate.
The least fixpoint is interpreted using the Knaster-Tarski theorem applied to the lattice of subsets of the nominal set, restricted to equivariant subsets (subsets that are closed under name permutations). The restriction to equivariant subsets is necessary to ensure that the fixpoint respects the nominal structure --- in particular, that the set of terms defined by the fixpoint is closed under -equivalence. The paper proves that all the axioms of NLML + fixpoints are sound with respect to these nominal set models, and that the derived -structural induction principle is a valid consequence of the fixpoint induction rule and the NLML axioms. The paper also discusses the question of completeness and notes that while full completeness of matching -logic is an open problem in general, the specific theories considered in the paper (such as the theory of -terms) admit complete axiomatizations.
Conclusion
The paper makes a significant contribution to the theory of formal reasoning about languages with binders by showing that nominal logic can be faithfully embedded in matching logic and that the crucial -structural induction principle can be derived within this framework using fixpoint operators. This result has important implications for the K framework and the broader matching logic ecosystem, because it means that all the powerful nominal reasoning techniques --- including equivariance, the quantifier, and -structural induction --- are available within matching logic without requiring any extension to the logic itself (beyond the already-established fixpoint operators of matching -logic).
The work complements the earlier approach of Chen and Rosu (ICFP 2020) for defining binders using matching logic's existential quantifier. While that approach offers a more lightweight encoding suitable for defining operational semantics in K, the nominal approach provides richer reasoning principles that are essential for metatheoretic proofs (such as type preservation and strong normalization). Together, the two approaches give matching logic a comprehensive toolkit for handling binders, covering both the definitional and the reasoning aspects. The paper suggests several directions for future work, including mechanizing the proofs in a proof assistant, extending the approach to more complex binding patterns (such as telescopic and recursive binders), and investigating the connections with cubical type theory and homotopy type theory.
Stay Informed
Sign up for updates and never miss important announcements.
Join the community
Join our Discord server to get support or connect with the Pi² community.