axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-math] Simplification rules


From: Igor Khavkine
Subject: [Axiom-math] Simplification rules
Date: Wed, 9 Aug 2006 16:47:20 -0400

I'm trying to construct a rule that simplifies expressions based on
the identity g(a,b) = g(b,a), where I've defined g := operator 'g.
Sadly, I'm failing miserably.

The most brain dead approach is to define and use the rule

-> symr := rule g(a,b) = g(b,a)
-> symr g(x,y)

Unfortunately, the last line produces an infinite loop because, even
after the substitution, the rule still matches and so gets applied
repeatedly.

The standard solution is to make the rule match only g(b,a), where a
and b are in some sense ordered and b > a. Then g(a,b) will no longer
match once a <= b. For example, alphabetic ordering for the string
representations of a and b would be nice, even if it only works when a
and b are Symbols. I haven't been able to construct such a rule. The
more or less obvious approach

-> symr := g(b, (a | notOrdered?(a,b)) == g(b,a)

does not seem to work. For some reason the function notOrdered? is not
even called when the rule is applied. Why? Is there another way to
construct this simplification rule that I'm not seeing?

Thanks in advance.

Igor




reply via email to

[Prev in Thread] Current Thread [Next in Thread]