Previous Page
Strategies Specification
Non-Deterministic Computations
Rules Specifications
Modularity and parameterization
Next Page

ELAN - Strategies Specification

A labelled rule is the most elementary strategy and is called a primal strategy. The result of applying a rule labelled lab on a term t is a set of terms. Note that there may be several rules with the same label. If no rule labelled lab applies on the term t, the set of results is empty and we say that the rule lab fails. To understand why applying one rule at the top of a term can yield several results, one has to know that local assignments in a rewrite rule can call strategies on subterms. If the strategy in a local assignment has several results, so has the rewrite rule. A labelled rule lab can be considered as the simplest form of a strategy which returns all results of the rule application. As any strategy, lab can also be encapsulated by an operator dc one that returns a non-deterministically chosen result. In that case, dc one(lab) returns at most one result. In addition ELAN provides a few built-in strategy operators that take possibly several strategies as arguments and can be used to build new strategies: In addition to these primitive strategy operators, the user can define new strategy operators and strategy rules for their evaluation [14].