Sequence variables are an advanced feature of modern programming languages. They enhance the support for writing programs in a declarative and easily understood way. To our knowledge, Mathematica provides the best support for programming with sequence variables, but it requires a good understanding of how the interpreter chooses the matcher. This is so because matching against patterns with sequence variables is in general not unitary. We claim that there is room to improve the programming style with sequence variables. We propose a number of new programming constructs which impose certain strategies on the pattern matching process. Our constructs enable to control the selection of a matcher by annotating sequence variables with binding priorities and ranges for their lengths, and to compute optimal values characterized by a score function to be optimized. To this end we have developed the package Sequentica. With Sequentica the Mathematica programmers and users get additional support for defining functions and transformation rules in an easy and convenient way. We outline the algorithmic difficulties to support these extensions and describe how they are implemented in Sequentica. The usefulness of these extensions is illustrated with various examples. We regard these extensions as a first step towards identifying a new programming style: programming with sequence variables. Such a programming style is useful to solve problems based on sequence analysis such as bio-informatics, cryptography or data mining. The concept of sequence variable has proved useful in many areas, such as symbolic
REF provided a more advanced mechanism to control pattern matching with sequence variables in Mathematica.
Programming with Sequence Variables : the Sequentica Package
ICLP
Computer Science