collectTransformations.frink

Download or view collectTransformations.frink in plain text format


/** This implements a "collect" function as transformation rules.  It collects
    terms of x with like exponents.
*/

transformations collect
{
   collect[(_a:1) _x^(_n:1) + (_b:1) _x^(_n) + (_c:0) , _x] <-> collect[(_a + _b) _x^_n + _c, _x]

   collect[_a === _d, _x] <-> collect[_a, _x] === collect[_d, _x]

   // Bailout condition
   collect[_a, _x] :: freeOf[_a, _x]  <-> _a
}

    


Download or view collectTransformations.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20218 days, 0 hours, 6 minutes ago.