OMD Documentation

Simplification Rules

This module defines the specific simplification rules used by the SimplificationEngine. The rules are organized into an object, keyed by the omdNode type they apply to.

Rule Structure

Each rule is an instance of SimplificationEngine.SimplificationRule and has three main parts:

  1. match function: Determines if the rule can be applied to a given node.
  2. transform function: Executes the simplification and returns a new, transformed node.
  3. message function: Generates a human-readable description of the transformation.

Available Rules

The rules object contains arrays of rules for each of the following node types:

binary (for omdBinaryExpressionNode)

rational (for omdRationalNode)

parenthesis (for omdParenthesisNode)

unary (for omdUnaryExpressionNode)

power (for omdPowerNode)

sqrt (for omdSqrtNode)

function (for omdFunctionNode)

Rule Lookup

The getRulesForNode(node) function is used by the simplification engine to retrieve the appropriate list of rules for a given node based on its type.

See Also

↑ Top