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]
fricas
degreeX(list)$MINI(x, FRAC INT)
Type: Integer