Abstract
In this paper we study matching in equational theories that specify counterparts of associativity and commutativity for variadic function symbols. We design a procedure to solve a system of matching equations and prove its termination, soundness, completeness, and minimality. The minimal complete set of matchers for such a system can be infinite, but our algorithm computes its finite representation in the form of solved set. From the practical side, we identify two finitary cases and impose restrictions on the procedure to get an incomplete algorithm, which, based on our experiments, describes the input-output behavior and properties of Mathematica's flat and orderless pattern matching.
Highlights
In variadic languages, function symbols do not have a fixed arity
In this paper we address the problem of pattern matching in variadic languages, where some function symbols satisfy the commutativity (C) and associativity (A) properties
We studied matching in variadic equational theories for associativity, commutativity, and their combination
Summary
Function symbols do not have a fixed arity. They can take an arbitrary number of arguments. In this paper we address the problem of pattern matching in variadic languages, where some function symbols satisfy (the variadic counterparts of) the commutativity (C) and associativity (A) properties. Its programming language, called Wolfram, has a powerful matching engine It uses variadic symbols, individual and sequence variables, and can work modulo A and C theories, called there flat and orderless theories, respectively. The comparison with Mathematica’s behavior is more comprehensive in the current paper than in (Kutsia, 2008) It covers more theories, since in addition to flat, we discuss matching with the orderless and flat-orderless attributes, as the Mathematica counterparts of variadic commutative and variadic associative-commutative matching. Usefulness of variadic operators and sequence variables in logical frameworks has been discussed in (Horozal et al, 2014; Horozal, 2014)
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.