Algebra SandBoxNonZeroInteger is an attempt to define the domain of Integers without 0 as a SubDomain. \begin{spad} )abbrev domain NZINT NonZeroInteger NonZeroInteger: Join(OrderedAbelianSemiGroup, Monoid --,CoercibleTo(Integer) ) with commutative("*") gcd: (%,%) -> % ++ gcd(a,b) computes the greatest common divisor of two ++ positive integers \spad{a} and b. _-: % -> % --retract:Integer->% --retractIfCan:Integer->Union(%,"failed") --retract:NonNegativeInteger->% --retractIfCan:NonNegativeInteger->Union(%,"failed") --convert:NonNegativeInteger->% == SubDomain(Integer,not(#1 = 0)) add Rep == Integer x:% y:% z:Integer nz:NonNegativeInteger -x == (-(x pretend Integer)) pretend % x+y == (z:=(x pretend Integer)+(y pretend Integer)) = 0 => error "zero" z pretend % --coerce(x):Integer == x pretend Integer --retract(z)== z pretend % --convert(nz):% == retract(nz) --retractIfCan(z) == -- zero?(z) => "failed" -- retract(z) --retract(nz)== nz pretend % --retractIfCan(nz) == -- zero?(nz) => "failed" -- retract(nz) \end{spad} \begin{axiom} )show NZINT \end{axiom} \begin{axiom} i:NZINT := 1$NZINT i:NZINT := (1::Integer) i:NZINT := 1 \end{axiom} \begin{axiom} j:NZINT := -1 \end{axiom} \begin{axiom} j:NZINT:=-i i+1 j+1 i+j \end{axiom} \begin{axiom} i-j retractIfCan(0)$NZINT \end{axiom} Can we define \begin{axiom} )show NonZero(Float) \end{axiom} \begin{axiom} f:NonZero(Float):=1 g:NonZero(Float):=-f f+(1.1::NonZero(Float)) f + -g f+g \end{axiom} Some or all expressions may not have rendered properly, because Axiom returned the following error: Error: export FRICAS=/usr/local/lib/open-axiom/x86_64-unknown-linux/1.3.0-2009-01-05; export ALDORROOT=/usr/local/aldor/linux/1.1.0; export PATH=$ALDORROOT/bin:$PATH; export HOME=/var/zope2/var/LatexWiki; ulimit -t 600; export LD_LIBRARY_PATH=/usr/local/lib/open-axiom/x86_64-unknown-linux/1.3.0-2009-01-05/lib; LANG=en_US.UTF-8 $FRICAS/bin/FRICASsys < /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/3437484353503122027-25px.axm /bin/sh: /usr/local/lib/open-axiom/x86_64-unknown-linux/1.3.0-2009-01-05/bin/FRICASsys: not found Some or all expressions may not have rendered properly, because Latex returned the following error: This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) \write18 enabled. %&-line parsing enabled. entering extended mode (./7851149973523920894-16.0px.tex LaTeX2e <2005/12/01> Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, arabic, farsi, croatian, ukrainian, russian, bulgarian, czech, slov ak, danish, dutch, finnish, basque, french, german, ngerman, ibycus, greek, mon ogreek, ancientgreek, hungarian, italian, latin, mongolian, norsk, icelandic, i nterlingua, turkish, coptic, romanian, welsh, serbian, slovenian, estonian, esp eranto, uppersorbian, indonesian, polish, portuguese, spanish, catalan, galicia n, swedish, ukenglish, pinyin, loaded. (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2005/09/16 v1.4f Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size12.clo)) (/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty (/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def)) (/usr/share/texmf-texlive/tex/latex/base/inputenc.sty (/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def)) (/usr/share/texmf-texlive/tex/latex/bbm/bbm.sty) (/usr/share/texmf-texlive/tex/latex/jknapltx/mathrsfs.sty) (/usr/share/texmf-texlive/tex/latex/base/fontenc.sty (/usr/share/texmf-texlive/tex/latex/base/t1enc.def)) (/usr/share/texmf-texlive/tex/latex/pstricks/pstricks.sty (/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.tex `PSTricks' v1.15 <2006/12/22> (tvz) (/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.con)) (/usr/share/texmf/tex/latex/xcolor/xcolor.sty (/etc/texmf/tex/latex/config/color.cfg) (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def) (/usr/share/texmf-texlive/tex/latex/graphics/dvipsnam.def))) (/usr/share/texmf-texlive/tex/latex/graphics/epsfig.sty (/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty) (/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty (/usr/share/texmf-texlive/tex/latex/graphics/trig.sty) (/etc/texmf/tex/latex/config/graphics.cfg)))) (/usr/share/texmf-texlive/tex/latex/pst-grad/pst-grad.sty (/usr/share/texmf-texlive/tex/generic/pst-grad/pst-grad.tex (/usr/share/texmf-texlive/tex/latex/xkeyval/pst-xkey.tex (/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty (/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.tex))) `pst-plot' v1.05, 2006/11/04 (tvz,dg,hv))) (/usr/share/texmf-texlive/tex/latex/pstricks/pst-plot.sty (/usr/share/texmf-texlive/tex/generic/pstricks/pst-plot.tex v97 patch 2, 1999/12/12 (/usr/share/texmf-texlive/tex/generic/multido/multido.tex v1.41, 2004/05/18 <tvz>))) (/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty (/usr/share/texmf-texlive/tex/xelatex/xetexconfig/geometry.cfg) |