Anti-patterns for Rule-based Languages - Inria - Institut national de recherche en sciences et technologies du numérique
Article Dans Une Revue Journal of Symbolic Computation Année : 2010

Anti-patterns for Rule-based Languages

Résumé

Negation is intrinsic to human thinking and most of the time when searching for something, we base our patterns on both positive and negative conditions. This should be naturally reflected in software that provide pattern-based searches. We would like for example to specify that we search for white cars that are not station wagons, or that we search for a list of objects that does not contain two identical elements. In this paper we extend the notion of pattern to the one of anti-pattern, i.e. patterns that may contain complement symbols. This concept is appropriate to design powerful extensions to pattern-based programming languages like ML, AsfSdf, Stratego, Maude, Elan or Tom and we show how this is used to extend the expressiveness and usability of the~Tom language. We further define formally the semantics of anti-patterns both in the syntactic case, i.e. when the symbols have no specific theory associated, and modulo an arbitrary equational theory. We then extend the classical notion of matching between patterns and ground terms to matching between anti-patterns and ground terms. Solving such problems can be performed either using general techniques as disunification, which we exemplify in the syntactical case, or more tailored and efficient approaches, which we chose to illustrate on the specific and very useful case of associativity, possibly with a unity. This allows us to be generic enough to give in this framework a very simple and natural expression of, for instance, the AllDiff standard predicate of constraint programming.

Dates et versions

inria-00429226 , version 1 (02-11-2009)

Identifiants

Citer

Horatiu Cirstea, Claude Kirchner, Radu Kopetz, Pierre-Etienne Moreau. Anti-patterns for Rule-based Languages. Journal of Symbolic Computation, 2010, 54 (5), pp.523-550. ⟨10.1016/j.jsc.2010.01.007⟩. ⟨inria-00429226⟩
94 Consultations
0 Téléchargements

Altmetric

Partager

More