Open eki opened 4 years ago
All operations should produce the most minimal immediate representation. Which is to say:
Sum
Ratio
Term
x + y / 1
x + y
2x^2 / x
2x
(x + y) / (x + y)
1
Setup some test coverage that enforces this invariant.
All operations should produce the most minimal immediate representation. Which is to say:
Sum
with only one term (could be just a term).Ratio
that can reduce to aSum
orTerm
x + y / 1
=>x + y
(sum)2x^2 / x
=>2x
(term)(x + y) / (x + y)
=>1
(term)Setup some test coverage that enforces this invariant.