[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## [Axiom-developer] Issue 351

**From**: |
Waldek Hebisch |

**Subject**: |
[Axiom-developer] Issue 351 |

**Date**: |
Wed, 9 May 2007 23:32:17 +0200 (CEST) |

I wonder what shall we do with issue 351. One "solution" is to
say that this is just user error: COMPLEX PF 5 is not a field
(has zero divisors) so by GIGO principle the result is
correct (one could say that crashing prevents producing wrong
answers...).
But we probably want do better. One possibility is to prevent
creation of fake fields: when creating COMPLEX F we may try
to check if x^2 - 1 is irreducible over F. In general this
may be hard to check, but just looking at characteristic we
can reject PF 5 cheaply.
Another possibility is to look at the reason of crash. In
Factored we have:
...
if R has UniqueFactorizationDomain
then
coerce(r:R):% ==
zero? r => 0
unit? r => mkFF(r, empty())
unitNormalize(squareFree(r) pretend %)
...
and in Field we have:
squareFree x == x::Factored(%)
Every element of true field is a unit, so the third line of coerce
should be never executed for fields. But 1 + 2*%i is a zero
divisor in COMPLEX PF 5, and the test in the second line of coerce
fails. So we could change coerce so that it signals error if
R is claimed to be field, but test for unit fails:
...
if R has UniqueFactorizationDomain
then
coerce(r:R):% ==
zero? r => 0
unit? r => mkFF(r, empty())
if R has Field => error "zero divisor in a field"
unitNormalize(squareFree(r) pretend %)
...
--
Waldek Hebisch
address@hidden

**[Axiom-developer] Issue 351**,
*Waldek Hebisch* **<=**