Associative commutative pattern matching

  • Authors:
  • J. M. Hvllot

  • Affiliations:
  • IRIA-LABORIA, France

  • Venue:
  • IJCAI'79 Proceedings of the 6th international joint conference on Artificial intelligence - Volume 1
  • Year:
  • 1979

Quantified Score

Hi-index 0.00

Visualization

Abstract

Plotkin [MO] has opened the way to the design of unification algorithm incorporating equality axioms and their use in complete proof systems. In particular he gives complete unification algorithms for terms containing associative function symbols and for an arithmetic theory. Huet gives in [18] a unification algorithm for X-conversion and discusses in [19] general properties of complete set of unifiers, A complete and finite algorithm for unification with associative commutative function symbols is given in Stickel [14] and Lankford shows in [22] how to extend it to abelian group theory. Various other specific unification problems are discussed in [9,15, 23]. In the case of equational theories which possess a complete set of reductions as defined in Knuth-Bendix [7], Fay has given in [20,21] a general unification algorithm. We are interested in this paper in the special case of commutative associative function symbols. We first study the equivalence problem which is reduced to regognizing the equality of two multiset representations. In the same way, matching reduces to generating ordered partitions of a multiset. This generation is carried out by two processes operating on tree data structures spanning the lattice of partitions. Cardinality conditions inherited from the matching problem are used to cut the search drastically : our processes operate bidirectionnally in a coroutine manner, each one trimming sub-structures from both search spaces. The two processes are formally defined by a unique recursive definition, and their computations correspond to a call-by-need interpretation of this definition. The correctness of the method is proved formally. This basic organization is used to derive a new algorithm for associative commutative unification improving over Stickel [14], We have programmed in LISP all these algorithms, using University of Vincennes's V-LISP system [3]. We have applied them to the Stickel-Peterson's generalization of the Knuth and Bendix extension algorithm [7, 8, 16]. Their algorithm relies on associative-commutative unification for the computation of critical pairs, but also most critically on associative-commutative match, in order to reduce terms to their normal forms, Stickel and Peterson proposed to use unification for matching, but this leads to unnecessary inefficiencies that preclude the practical use of their method. We give in the Appendix running times on a DEC KL10 using the VLISP system, corresponding to some of their examples. Most proofs are omitted in this version, the full paper is available as a technical report [24].