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

Read more

Summary

Introduction

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)

Preliminaries
Variadic equational matching problems
Matching algorithm for linear problems
Nonlinear matching
Finitary fragment and variant
Bounded fragment
Strict variant
Data and observations
Imitating variadic equational matching of Mathematica
Discussion and conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call