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 fricas (1) -> <spad> fricas )abbrev domain DIFF Difference Difference(T:Join(Monoid, fricas Compiling FriCAS source code from file
/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/7646994448072444383-25px001.spad
using old system compiler.
DIFF abbreviates domain Difference
------------------------------------------------------------------------
initializing NRLIB DIFF for Difference
compiling into NRLIB DIFF
****** Domain: T$ already in scope
****** Domain: T$ already in scope
****** Domain: T$ already in scope
processing macro definition Rep ==> Record(neg: T$,Now use DIFF to define an "Integer" fricas i:DIFF(CardinalNumber) Type: Void
fricas i:=2
Type: Difference(CardinalNumber?)
fricas j:=i-4
Type: Difference(CardinalNumber?)
fricas k:=j+2
Type: Difference(CardinalNumber?)
fricas test(k=0)
Type: Boolean
fricas i:=1234567
Type: Difference(CardinalNumber?)
fricas j:=i-7654321
Type: Difference(CardinalNumber?)
fricas k:=j+6666666-246912
Type: Difference(CardinalNumber?)
fricas test(k=0)
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."
|