Unification in Matching Logic -- Revisited

Ádám Kurucz,Péter Bereczky,Dániel Horpácsi
DOI: https://doi.org/10.4204/EPTCS.410.1
2024-10-31
Abstract:Matching logic is a logical framework for specifying and reasoning about programs using pattern matching semantics. A pattern is made up of a number of structural components and constraints. Structural components are syntactically matched, while constraints need to be satisfied. Having multiple structural patterns poses a practical problem as it requires multiple matching operations. This is easily remedied by unification, for which an algorithm has already been defined and proven correct in a sorted, polyadic variant of matching logic. This paper revisits the subject in the applicative variant of the language while generalising the unification problem and mechanizing a proven-sound solution in Coq.
Logic in Computer Science
What problem does this paper attempt to address?
### What problem does this paper attempt to solve? This paper aims to solve the problem of unification in Matching Logic. Specifically, the authors re - examine the unification problem in the applied, unclassified variants of Matching Logic, generalize this problem, and mechanize a proven and reliable solution in Coq. #### Background of Matching Logic Matching Logic is a logical framework that uses pattern - matching semantics to specify and reason about programs. A pattern consists of multiple structural components and constraints. Structural components are matched syntactically, while constraints need to be satisfied. When there are multiple structural patterns, this will lead to the need to perform multiple matching operations, which brings practical problems. This problem can be effectively solved through unification. #### The Unification Problem Unification is the process of solving equations between first - order terms. For two first - order terms \(t_1\) and \(t_2\), the result of unification is a substitution \(\sigma\) such that the two terms become syntactically equal after the substitution is applied: \(t_1\sigma = t_2\sigma\). Unification plays a crucial role in automated theorem proving and term - rewriting systems. #### Main Contributions of the Paper 1. **Defined a generalized abstract unification problem**: - Formalized the abstract representation of the unification problem in Matching Logic. 2. **Provided a rule - based unification algorithm for unclassified applied variants of Matching Logic**: - This algorithm is applicable to a wider range of situations and can handle complex pattern - matching problems. 3. **Proved the reliability of the unification algorithm**: - Proved the correctness of the algorithm using single - conclusion sequent calculus, ensuring its theoretical reliability. 4. **Achieved machine - checked results**: - Formalized and verified the above results in Coq, ensuring the correctness and reliability of the algorithm. #### Innovation Points of the Paper Compared with previous work, the main innovations of this paper are: - **Completely syntax - based reliability proof**: - There is no need to synthesize proofs for specific unifications. Instead, the equivalence between unification patterns and semantic unifiers is directly proven through constructive reliability proofs. - **Adapt to different logical variants**: - This paper not only considers sorted polymorphic variants of Matching Logic, but also extends to unclassified applied variants, making its scope of application wider. In general, this paper provides a more general and reliable solution by re - examining and improving the unification problem in Matching Logic, thus providing strong support for automated theorem proving and program verification.