Opinions?
I don't really think these forgetful functors are needed. Do you have some concrete use cases?
Why do I believe they are unnecessary? If ever one wants to compute with a monoid then one would write a package Pkg(M: Monoid): with ... === add ...Inside "add" one can only rely on monoid operations. But calling Pkg(Integer) works fine and basically automatically forgets about the ring properties.
And unless SPAD semantics is different from Aldor semantics there was an issue at the Aldor Workshop 2007 where I constructed legal Aldor code that inhabits a domain of non-negative numbers with a -1 (see attachment).
Looking at http://axiom-wiki.newsynthesis.org/SandBoxAldorSemantics seems to show that your definition
AsRing(R : Ring) : Ring == R doesn't actually do what it should. I'm pretty sure that falls into the B: CatA == Dom;class and leads to somewhat surprising (not necessarily wrong) results for "AsRing(Fraction Integer) has Field".
Interestingly, SPAD is really different from Aldor in this case. ---rhxBEGIN asring.as #include "algebra" #include "aldorio" AsRing1(R: Ring): Ring == R; AsRing2(R: Ring): Ring == R add; stdout << "1: " << (AsRing1(Fraction Integer) has Field) << newline; stdout << "2: " << (AsRing2(Fraction Integer) has Field) << newline; ---rhxEND This program returns: 1: T 2: F while ---rhxBEGIN asring.spad )abbrev domain ASRING AsRing AsRing(R : Ring) : Ring == R ---rhxEND (1) -> AsRing(Fraction Integer) has Field (1) falseAnyway, I think, unless you give a convincing use case, adding forgetful functors is unnecessary.
My 2 cents. Ralf -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en.
HasSemantics.as
Description: application/applix-spreadsheet
