[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mon, 06 Feb 2006 06:14:24 -0600
Maybe this text should go into another place (where?), but the above code shows
It says (look at the representation):
Fraction(S: IntegralDomain): QuotientFieldCategory S with
== LocalAlgebra(S, S, S) add
Rep:= Record(num:S, den:S)
and in LocalAlgebra one can read
LocalAlgebra(A: Algebra R,
S: SubsetCategory(Monoid, R)): Algebra R with
== Localize(A, R, S) add
S:SubsetCategory(Monoid, R)): Module R with
If someone is going to change the Rep of Localize say
Rep := Record(somedata: SomeType, num: M, den: S)
then I suspect the code of Fraction will not work anymore.
The implementation of LocalAlgebra is fine, since it does not introduce a Rep,
but in Fraction there should also be no appearance of Rep.
The implementation of Fraction should completely do without Rep (information
since it should not know about the concrete representation of elements in the
In fact, the Category for Localize(M, R, S) is not rich enough. It already
exports two functions
numer: % -> M
++ numer x returns the numerator of x.
denom: % -> S
++ denom x returns the denominator of x.
but obviously its use in Fraction call for destructive functions
set!: (%, 'num', M) -> M
set!: (%, 'den', S) -> S
forwarded from http://wiki.axiom-developer.org/address@hidden
- [Axiom-developer] [Fraction],
Ralf Hemmecke <=