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

Edit detail for SandBox Spad revision 2 of 2

1 2
Editor: test1
Time: 2013/07/31 18:13:42 GMT+0
Note:

changed:
-       degreeX:$ -> INT
       degreeX: % -> INT

changed:
-          a := [denom i for i in f::Rep]@List P  --  denom : FRAC UP -> UP(x,F)
-          b := map( (i) +-> degree i , a ) -- degree : UP -> NonNegativeInteger
          a := [denom i for i in f::Rep]@List(P)  --  denom : FRAC UP -> UP(x,F)
          b := map(di +-> degree(di), a)$ListFunctions2(P, INT) -- degree : UP -> NonNegativeInteger

removed:
-          12
-
-
-

added:

We need to package call 'map', otherwise compilation would fail.

From kratt6 Tue Apr 4 03:26:02 -0500 2006
From: kratt6
Date: Tue, 04 Apr 2006 03:26:02 -0500
Subject: 
Message-ID: <20060404032602-0500@wiki.axiom-developer.org>

The compiler is unable to find out the mode for '+->', since it doesn't know what map he is supposed to use. It is tedious, but the cure is to package call 'map'. Furthermore, it is usually easier to debug packages.

In fact, even with fully types '+->', the compilation fails, because the compiler can not find
appropriate 'map'.

changed:
-       degreeX:$ -> INT
       degreeX: LFRP -> INT

removed:
-          12
-
-

removed:
-
-From unknown Sat Apr 1 13:47:59 -0600 2006
-From: unknown
-Date: Sat, 01 Apr 2006 13:47:59 -0600
-Subject: 
-Message-ID: <20060401134759-0600@wiki.axiom-developer.org>
-
-I believe it's map (degree #1, a) we must type in *.spad files. 
-Last days I make the same error. I find this tips by grep *.spad file.
-
-FMy
-
-\begin{spad}
-)abbrev domain MINI MinimalInitialNotIntegrated
-MinimalInitialNotIntegrated(x,F): Exports == Implementation where
-    x: Symbol
-    F: Field
-
-    INT ==> Integer
-    P ==> UnivariatePolynomial(x,F)
-    FRP ==> Fraction P
-    LFRP ==> List FRP
-
-    Exports == with
-      
-       degreeX:$ -> INT
-
-    Implementation == add
-
-       Rep := LFRP
-
-       degreeX f ==
-          a := [denom i for i in f::Rep] --  denom : FRAC UP -> UP(x,F)
-          b := map( degree #1, a ) -- degree : UP -> NonNegativeInteger
-       -- b := [degree i for i in a ]
-          reduce( max, b ,0) :: INT
-          12
-
-\end{spad}
-
-I guess not yet
-
-From kratt6 Tue Apr 4 03:26:02 -0500 2006
-From: kratt6
-Date: Tue, 04 Apr 2006 03:26:02 -0500
-Subject: 
-Message-ID: <20060404032602-0500@wiki.axiom-developer.org>
-
-The compiler is unable to find out the mode for '#1', since it doesn't know what map he is supposed to use. It is tedious, but the cure is to package call 'map'. Furthermore, it is usually easier to debug packages.
-
-\begin{spad}
-)abbrev package MINI MinimalInitialNotIntegrated
-MinimalInitialNotIntegrated(x,F): Exports == Implementation where
-    x: Symbol
-    F: Field
-    INT ==> Integer
-    P ==> UnivariatePolynomial(x,F)
-    FRP ==> Fraction P
-    LFRP ==> List FRP
-    Exports == with
-       degreeX: LFRP -> INT
-    Implementation == add
-       degreeX f ==
-          a: List P := [denom i for i in f]
-          b := map(degree #1, a)$ListFunctions2(P, NonNegativeInteger)
-          reduce( max, b ,0) :: INT
-\end{spad}

A minimal exemple of my trouble.

fricas
(1) -> <spad>
fricas
)abbrev domain MINI MinimalInitialNotIntegrated
MinimalInitialNotIntegrated(x,F): Exports == Implementation where
    x: Symbol
    F: Field
INT ==> Integer P ==> UnivariatePolynomial(x,F) FRP ==> Fraction P LFRP ==> List FRP
Exports == with
degreeX: % -> INT
Implementation == add
Rep := LFRP
degreeX f == a := [denom i for i in f::Rep]@List(P) -- denom : FRAC UP -> UP(x,F) b := map(di +-> degree(di), a)$ListFunctions2(P, INT) -- degree : UP -> NonNegativeInteger --b := [degree i for i in a ] reduce( max, b ,0) :: INT</spad>
fricas
Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/1973871146429693580-25px001.spad
      using old system compiler.
   MINI abbreviates domain MinimalInitialNotIntegrated 
------------------------------------------------------------------------
   initializing NRLIB MINI for MinimalInitialNotIntegrated 
   compiling into NRLIB MINI 
   compiling exported degreeX : % -> Integer
Time: 0.05 SEC.
(time taken in buildFunctor: 0)
;;; *** |MinimalInitialNotIntegrated| REDEFINED
;;; *** |MinimalInitialNotIntegrated| REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor MinimalInitialNotIntegrated Time: 0.05 seconds
finalizing NRLIB MINI Processing MinimalInitialNotIntegrated for Browser database: --->-->MinimalInitialNotIntegrated(constructor): Not documented!!!! --->-->MinimalInitialNotIntegrated((degreeX ((Integer) %))): Not documented!!!! --->-->MinimalInitialNotIntegrated(): Missing Description ; compiling file "/var/aw/var/LatexWiki/MINI.NRLIB/MINI.lsp" (written 01 NOV 2024 03:07:33 AM):
; wrote /var/aw/var/LatexWiki/MINI.NRLIB/MINI.fasl ; compilation finished in 0:00:00.008 ------------------------------------------------------------------------ MinimalInitialNotIntegrated is now explicitly exposed in frame initial MinimalInitialNotIntegrated will be automatically loaded when needed from /var/aw/var/LatexWiki/MINI.NRLIB/MINI

We need to package call map, otherwise compilation would fail.

The compiler is unable to find out the mode for +->, since it doesn't know what map he is supposed to use. It is tedious, but the cure is to package call map. Furthermore, it is usually easier to debug packages.

In fact, even with fully types +->, the compilation fails, because the compiler can not find appropriate map.

spad
)abbrev domain MINI MinimalInitialNotIntegrated
MinimalInitialNotIntegrated(x,F): Exports == Implementation where
    x: Symbol
    F: Field
INT ==> Integer P ==> UnivariatePolynomial(x,F) FRP ==> Fraction P LFRP ==> List FRP
Exports == with
degreeX: LFRP -> INT
Implementation == add
Rep := LFRP
degreeX f == a := [denom i for i in f::Rep] -- denom : FRAC UP -> UP(x,F) --b := map( degree , a ) -- degree : UP -> NonNegativeInteger b := [degree i for i in a ] reduce( max, b ,0) :: INT
spad
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/914813484557723871-25px002.spad
      using old system compiler.
   MINI abbreviates domain MinimalInitialNotIntegrated 
------------------------------------------------------------------------
   initializing NRLIB MINI for MinimalInitialNotIntegrated 
   compiling into NRLIB MINI 
   compiling exported degreeX : List Fraction UnivariatePolynomial(x,F) -> Integer
Time: 0.02 SEC.
(time taken in buildFunctor: 0)
;;; *** |MinimalInitialNotIntegrated| REDEFINED
;;; *** |MinimalInitialNotIntegrated| REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor MinimalInitialNotIntegrated Time: 0.02 seconds
finalizing NRLIB MINI Processing MinimalInitialNotIntegrated for Browser database: --->/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/1973871146429693580-25px001.spad-->MinimalInitialNotIntegrated(constructor): Not documented!!!! --->/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/1973871146429693580-25px001.spad-->MinimalInitialNotIntegrated((degreeX ((Integer) (List (Fraction (UnivariatePolynomial x F)))))): Not documented!!!! --->/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/1973871146429693580-25px001.spad-->MinimalInitialNotIntegrated(): Missing Description ; compiling file "/var/aw/var/LatexWiki/MINI.NRLIB/MINI.lsp" (written 01 NOV 2024 03:07:33 AM):
; wrote /var/aw/var/LatexWiki/MINI.NRLIB/MINI.fasl ; compilation finished in 0:00:00.012 ------------------------------------------------------------------------ MinimalInitialNotIntegrated is already explicitly exposed in frame initial MinimalInitialNotIntegrated will be automatically loaded when needed from /var/aw/var/LatexWiki/MINI.NRLIB/MINI

fricas
list:List FRAC UP(x,FRAC INT):= [x^2+1/x::FRAC UP(x,FRAC INT), x+1/x^2]

\label{eq1}\left[{\frac{{{x}^{3}}+ 1}{x}}, \:{\frac{{{x}^{3}}+ 1}{{x}^{2}}}\right](1)
Type: List(Fraction(UnivariatePolynomial(x,Fraction(Integer))))
fricas
degreeX(list)$MINI(x, FRAC INT)

\label{eq2}2(2)
Type: Integer