login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

# Edit detail for SandBox Zero revision 1 of 1

 1 Editor: Time: 2007/11/18 18:44:59 GMT-8 Note: use 0 instead of Zero

changed:
-
We are trying to create a Zero

\begin{aldor}
#include "axiom.as"

INT ==> Integer;
NNI ==> NonNegativeInteger;
P ==> UnivariatePolynomial(x ,F);
FP ==> Fraction P ;
LFP ==> List FP;

NTBA(x:Symbol,F:Field): with {
0:% ;
coerce: LFP -> % ;
coerce: % -> LFP ;
coerce: % -> OutputForm ;

dummy:% -> % ;

}  == add {
Rep ==> LFP;
import from INT, NNI ;
import from F, P, LFP ;
import from PrintPackage ;

0:% == per [0$FP] ; coerce (f:LFP):% == per f; coerce (f:%):LFP == rep f; coerce (f:%):OutputForm == { a1 := rep f :: OutputForm ; a2 := message("D ")$OutputForm;
hconcat(a2,a1) }

dummy (f:%):% == {
0$% ; } } \end{aldor} Let see \begin{axiom} a := [1,2,3] :: List FRAC UP(x, FRAC INT) :: NTBA(x, FRAC INT) dummy( a) )show NTBA(x,FRAC INT) \end{axiom} So there should be one .. \begin{axiom} 0$NTBA(x,FRAC INT)
\end{axiom}



We are trying to create a Zero

aldor
#include "axiom.as"
INT ==> Integer;
NNI ==> NonNegativeInteger;
P ==> UnivariatePolynomial(x ,F);
FP ==> Fraction P ;
LFP ==> List FP;
NTBA(x:Symbol,F:Field): with {
0:% ;
coerce: LFP -> % ;
coerce: % -> LFP ;
coerce: % -> OutputForm ;
dummy:% -> % ;
}  == add {
Rep ==> LFP;
import from INT, NNI ;
import from F, P, LFP ;
import from PrintPackage ;
0:% == per [0$FP] ; coerce (f:LFP):% == per f; coerce (f:%):LFP == rep f; coerce (f:%):OutputForm == { a1 := rep f :: OutputForm ; a2 := message("D ")$OutputForm;
hconcat(a2,a1) }
dummy (f:%):% == {
0$% ; } } aldor  Compiling FriCAS source code from file /var/zope2/var/LatexWiki/3380871952956020278-25px001.as using AXIOM-XL compiler and options -O -Fasy -Fao -Flsp -laxiom -Mno-ALDOR_W_WillObsolete -DAxiom -Y$AXIOM/algebra -I $AXIOM/algebra Use the system command )set compiler args to change these options. Compiling Lisp source code from file ./3380871952956020278-25px001.lsp Issuing )library command for 3380871952956020278-25px001 Reading /var/zope2/var/LatexWiki/3380871952956020278-25px001.asy NTBA is now explicitly exposed in frame initial NTBA will be automatically loaded when needed from /var/zope2/var/LatexWiki/3380871952956020278-25px001 Let see axiom a := [1,2,3] :: List FRAC UP(x, FRAC INT) :: NTBA(x, FRAC INT)  (1) Type: NTBA(x,Fraction(Integer)) axiom dummy( a)  (2) Type: NTBA(x,Fraction(Integer)) axiom )show NTBA(x,FRAC INT) NTBA(x,Fraction(Integer)) is a domain constructor. Abbreviation for NTBA is NTBA This constructor is exposed in this frame. ------------------------------- Operations -------------------------------- 0 : () -> % coerce : % -> OutputForm dummy : % -> % coerce : % -> List(Fraction(UnivariatePolynomial(x,Fraction(Integer)))) coerce : List(Fraction(UnivariatePolynomial(x,Fraction(Integer)))) -> % So there should be one .. axiom 0$NTBA(x,FRAC INT)
 (3)
Type: NTBA(x,Fraction(Integer))