Why are the domains PositiveInteger and NonNegativeInteger defined as SubDomains of Integer insteadof the other way around? Here is a (still somewhat imperfect) example of one way of defining Integer from a more primitive domain (some domain without negatives and perhaps without zero, sometimes called a rig - ring without negative) although Axiom does not currently implement such a category. (Related: category RNG - ring without identity).
http://golem.ph.utexas.edu/category/2008/05/theorems_into_coffee_iii.html (Refer also to his discussion of PROPS.) Most CAS doesn't bother to define natural numbers via the Peano Axioms and then derive integers, for example, as an equivalence class of pairs of natural numbers so that (a, b) ~ (c, d) iff a + d = b + c. The question is whether a compiler could be smart enough to replace the definition via equivalence classes by an efficient representation that is, for example, used by GMP. First let's define a constructor name
spad Compiling OpenAxiom source code from file
/var/zope2/var/LatexWiki/3066500097849615682-25px001.spad using
Spad compiler.
DIFF abbreviates domain Difference
------------------------------------------------------------------------
initializing NRLIB DIFF for Difference
compiling into NRLIB DIFF
Adding $ modemaps
Adding T$ modemaps
Adding T$ modemaps
****** Domain: T$ already in scope
Adding T$ modemaps
****** Domain: T$ already in scope
Adding T$ modemaps
****** Domain: T$ already in scope
compiling local rep : % -> Record(neg: T$,pos: T$)
DIFF;rep is replaced by G1392
Time: 0.07 SEC.Now use DIFF to define an "Integer"
Type: Void
Type: Difference CardinalNumber?
Type: Difference CardinalNumber?
Type: Difference CardinalNumber?
Type: Boolean
Type: Difference CardinalNumber?
Type: Difference CardinalNumber?
Type: Difference CardinalNumber?
Type: Boolean
The point of this construction is to illustrate several problems. One such problem is that current generation of compilers in computer algebra systems such as Axiom, specifically Spad and Aldor, are not able to automatically convert this presumably mathematically correct specification to an efficient implementation, e.g. signed integers. Another issue is why these languages do not have some built-in support for such common algebraic constructions as "taking a quotient". In particular, there seems to be no general way of defining a "canonical representation". A mathematician, a biologist and a physicist --Bill Page, Sun, 27 Jul 2008 11:11:48 -0700 reply are sitting in a street café watching people entering and leaving the house on the other side of the street. First they see two people entering the house. Time passes. After a while they notice three people leaving the house. The physicist says, "The measurement wasn't accurate." The biologist says, "They must have reproduced." The mathematician says, "If one more person enters the house then it will be empty."
|