Anti-pattern Matching

  • Claude Kirchner
  • Radu Kopetz
  • Pierre-Etienne Moreau
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4421)


It is quite appealing to base the description of pattern-based searches on positive as well as negative conditions. We would like for example to specify that we search for white cars that are not station wagons.

To this end, we define the notion of anti-patterns and their semantics along with some of their properties. We then extend the classical notion of matching between patterns and ground terms to matching between anti-patterns and ground terms. We provide a rule-based algorithm that finds the solutions to such problems and prove its correctness and completeness. Anti-pattern matching is by nature different from disunification and quite interestingly the anti-pattern matching problem is unitary. Therefore the concept is appropriate to ground a powerful extension to pattern-based programming languages and we show how this is used to extend the expressiveness and usability of the Tom language.


Normal Form Pattern Match Free Variable Function Symbol Equational Problem 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Aiken, A., Kozen, D., Wimmers, E.: Decidability of systems of set constraints with negative constraints. Information and Computation 122(1), 30–44 (1995)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Aiken, A., Wimmers, E.L.: Solving systems of set constraints (extended abstract). In: LICS, pp. 329–340. IEEE Computer Society Press, Los Alamitos (1992)Google Scholar
  3. 3.
    Ait-Kaci, H., Podelski, A., Smolka, G.: A feature constraint system for logic programming with entailment. Theoretical Computer Science 122(1–2), 263–283 (1994)zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Baader, F., et al.: On the expressivity of feature logics with negation, functional uncertainty, and sort equations. Journal of Logic, Language and Information 2, 1–18 (1993)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Baader, F., Nipkow, T.: Term Rewriting and all That. Cambridge University Press, Cambridge (1998)Google Scholar
  6. 6.
    Backofen, R., Smolka, G.: A complete and recursive feature theory. Theoretical Computer Science 146(1–2), 243–268 (1995)zbMATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Charatonik, W., Pacholski, L.: Negative set constraints with equality. In: LICS, pp. 128–136. IEEE Computer Society Press, Los Alamitos (1994)Google Scholar
  8. 8.
    Clark, K.L.: Negation as Failure. In: Gallaire, H., Minker, J., Nicolas, J. (eds.) Logic and databases, pp. 293–322. Plenum Press, New York (1978)Google Scholar
  9. 9.
    Comon, H.: Unification et disunification. Théories et applications. Thèse de Doctorat d’Université, Institut Polytechnique de Grenoble (France) (1988)Google Scholar
  10. 10.
    Comon, H.: Disunification: a survey. In: Lassez, J.-L., Plotkin, G. (eds.) Computational Logic. Essays in honor of Alan Robinson, pp. 322–359. MIT Press, Cambridge (1991)Google Scholar
  11. 11.
    Comon, H., Lescanne, P.: Equational problems and disunification. In: Kirchner, C. (ed.) Unification, pp. 297–352. Academic Press, London (1990)Google Scholar
  12. 12.
    Foster, J.S.: CLP(SC): Implementation and efficiency considerations. In: Proceedings Workshop on Set Constraints, held in Conjunction with CP’96, Boston, Massachusetts (1996)Google Scholar
  13. 13.
    Huet, G.: Résolution d’equations dans les langages d’ordre 1, 2, ..., ω. Thèse de Doctorat d’Etat, Université de Paris 7 (France) (1976)Google Scholar
  14. 14.
    Kirchner, C., Kirchner, H.: Rewriting, solving, proving (1999), A preliminary version of a book available at
  15. 15.
    Kirchner, C., Moreau, P.-E., Reilles, A.: Formal validation of pattern matching code. In: Barahona, P., Felty, A. (eds.) Proceedings of the 7th ACM SIGPLAN PPDP, July 2005, pp. 187–197. ACM Press, New York (2005)Google Scholar
  16. 16.
    Lassez, J.-L., Marriott, K.: Explicit representation of terms defined by counter examples. Journal of Automated Reasoning 3(3), 301–317 (1987)zbMATHCrossRefMathSciNetGoogle Scholar
  17. 17.
    Liquori, L.: iRho: the software [system description]. In: DCM: International Workshop on Development in Computational Models. Electr. Notes Theor. Comput. Sci, vol. 135(3), pp. 85–94 (2006)Google Scholar
  18. 18.
    Momigliano, A.: Elimination of negation in a logical framework. In: Clote, P.G., Schwichtenberg, H. (eds.) CSL 2000. LNCS, vol. 1862, pp. 411–426. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  19. 19.
    Moreau, P.-E., Ringeissen, C., Vittek, M.: A Pattern Matching Compiler for Multiple Target Languages. In: Hedin, G. (ed.) CC 2003 and ETAPS 2003. LNCS, vol. 2622, pp. 61–76. Springer, Heidelberg (2003)Google Scholar
  20. 20.
    Müller, M., Niehren, J., Podelski, A.: Inclusion constraints over non-empty sets of trees. In: Bidoit, M., Dauchet, M. (eds.) CAAP 1997, FASE 1997, and TAPSOFT 1997. LNCS, vol. 1214, pp. 217–231. Springer, Heidelberg (1997)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Claude Kirchner
    • 1
  • Radu Kopetz
    • 1
  • Pierre-Etienne Moreau
    • 1
  1. 1.INRIA & LORIA, NancyFrance

Personalised recommendations