Skip to content
mikera edited this page Apr 19, 2013 · 4 revisions

objective

Expresso aims to be ex extendable.

Rules

Rules are just clauses: (rule old-exp new-exp) They fail if they are not applicable. Otherwise they return the new-exp

  • this makes it possible to write a rule calculo, which checks if there are no variables in the expression and calculates the result

mikera: do these apply to all possible transformations? or just simplifications? general transformations are probably more complex, since they may need to transform both directions. Simplification is easier, since it always means transformation in the direction of the standard form of expression

Rule syntax

the rule macro provides experimental syntax for rules - using matche-syntax

apply rules

apply-ruleso takes a vector of rules and a expression. returns a modified expression or faiils. It successievly tries to apply the rules in the vector, returning the modified expression if one rule succeeds. Fails if all rules fail

Clone this wiki locally