[ Previous | Up | Next ]

Introduction

So far we have assumed the basic actions applied by strategies are rewrite rules. However, taking a closer look at rules, we see that they are actually composed from several ingredients, i.e., matching the pattern in the left-hand side, verifying the side conditions, and instantiating the pattern on the right-hand side. In addition, a rule implicitly delimits the scope of the variables that it uses. If we take rules apart and make their components available as first-class strategy actions, many interesting idioms can be expressed directly.

This chapter introduces the strategy actions match (?p), build (p), and scope ({x1,...,xn:s}), and shows how unconditional and conditional rewrite rules can be expressed in terms of these actions. Many other language constructs that involve matching can also be expressed in terms of these operations.

Preprint

Remarks

  • Rule for explicit pattern matching is missing
  • Rule for term project should use where

Revision: r1.3 - 14 Dec 2003 - 13:15 - EelcoVisser
Book > TableOfContents > PartIII > ChapterFirstClassPatternMatching
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback