# Rewrite

The term for replacement of strings, terms, trees, or other forms of expression according to logical rules, particularly as a form of evaluation semantics.Examples:

- The basic algebraic law (or axiom) that

`a + b = b + a`

is a bi-directional rewrite rule. You can replace the first expression with the second, and the second with the first, assuming matching has taken place. So there are two directional rewrite rules there, which are conveniently thought of as the same thing. That's what constitutes an equation. - Evaluation rules that define functions are a kind of rewrite. The term

`F(a,b,c) = b^2 - 4*a*c`

defining function`F`as a kind of discriminant. Evaluating

`F(2,3,4)`

`-19`

is an application of this rule.

- The rewriting home page
- A rewriting system for Joy: an example application of rewriting systems to programming language semantics specification (see Joy).

**Pages in this topic: ** ASF+SDF Macro Maude Q Rewrite for Optimization Stratego

**Also linked from: ** Alan Bundy BOBJ C++ Context Dispatch Linear Logic OBJ Family Parsing Rewrite Logic 101 Tactic