RewriteRule

it.grypho.scala.leonardo.scalar.RewriteRule
case class RewriteRule(lhs: _Expression, rhs: _Expression, condition: (Map[String, _Expression], _Variable) => Boolean, name: String)

A rewrite rule: match lhs, check condition, produce rhs.

Value parameters

condition

a guard over the bindings and the context variable∫ dv/(a²+v²) needs the hole a to be free of the integration variable, which is only readable once that variable is threaded in. The combinators below (freeOf, nonZero, …) are the intended way to build one.

lhs

the pattern, built from ordinary nodes plus _Pattern holes

name

a label, for diagnostics and test failure messages

rhs

the template, whose _Pattern holes are filled from the match

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product