OK, I removed all the useless stuff around and even replaced my
R==>PolynomialRing(...) by R==>Integer.
I replaced even the body of the function by 'error "..."', but the weird
behaviour still happens with my FriCAS.
Admittedly, I have some changes in my compiled FriCAS, but they
shouldn't actually affect that behaviour, since it's just adding some
more domains. So let's see whether you can reproduce it.
With p::R I get...
(1) -> )co bugcoerce.spad
Compiling FriCAS source code from file
/home/hemmecke/backup/git/fricas/bugcoerce.spad using old system
compiler.
QETAWORK abbreviates package QEtaWork
------------------------------------------------------------------------
initializing NRLIB QETAWORK for QEtaWork
compiling into NRLIB QETAWORK
compiling exported eliminate : List Polynomial C -> List Polynomial C
processing macro definition R ==> Integer
****** comp fails at level 1 with expression: ******
error in function eliminate
((|::| |p| (|Integer|)))
****** level 1 ******
$x:= (:: p (Integer))
$m:= (Integer)
$f:=
((((|p| # #) (|rs| #) (|value| # #) (|coerce| # #) ...)))
>> Apparent user error:
Cannot coerce p
of mode (Polynomial C)
to mode (Integer)
while "coerce(p)@R" compiles without complaint.
Ralf
=============================================================
(1) -> )co bugcoerce.spad
Compiling FriCAS source code from file
/home/hemmecke/backup/git/fricas/bugcoerce.spad using old system
compiler.
QETAWORK abbreviates package QEtaWork
------------------------------------------------------------------------
initializing NRLIB QETAWORK for QEtaWork
compiling into NRLIB QETAWORK
compiling exported eliminate : List Polynomial C -> List Polynomial C
processing macro definition R ==> Integer
Time: 0.01 SEC.
(time taken in buildFunctor: 4)
;;; *** |QEtaWork| REDEFINED
;;; *** |QEtaWork| REDEFINED
Time: 0.00 SEC.
Cumulative Statistics for Constructor QEtaWork
Time: 0.01 seconds
finalizing NRLIB QETAWORK
Processing QEtaWork for Browser database:
--->/home/hemmecke/backup/git/fricas/bugcoerce.spad-->QEtaWork(constructor):
Not documented!!!!
--->/home/hemmecke/backup/git/fricas/bugcoerce.spad-->QEtaWork((eliminate ((List
(Polynomial C)) (List (Polynomial C))))): Not documented!!!!
--->/home/hemmecke/backup/git/fricas/bugcoerce.spad-->QEtaWork():
Missing Description
; compiling file
"/home/hemmecke/backup/git/fricas/QETAWORK.NRLIB/QETAWORK.lsp" (written
22 DEC 2015 02:37:50 PM):
; file: /home/hemmecke/backup/git/fricas/QETAWORK.NRLIB/QETAWORK.lsp
; in: SDEFUN |QETAWORK;eliminate;2L;1|
; (BOOT::SDEFUN BOOT::|QETAWORK;eliminate;2L;1|
; ((BOOT::|lpol| BOOT::|List| (BOOT::|Polynomial|
BOOT::C))
; (BOOT::$ BOOT::|List| (BOOT::|Polynomial| BOOT::C)))
; (BOOT::SPROG
; ((BOOT::|rs| (BOOT::|List| #)) (#:G733 NIL)
(BOOT::|p| NIL)
; (#:G732 NIL) (BOOT::|coerce| (BOOT::|Mapping| # #)))
; (BOOT::SEQ
; (BOOT::LETT BOOT::|coerce|
; (LIST #'BOOT::|QETAWORK;eliminate;2L;1!0|)
; BOOT::|QETAWORK;eliminate;2L;1|)
; (BOOT::LETT BOOT::|rs| (PROGN # #)
; BOOT::|QETAWORK;eliminate;2L;1|)
; (BOOT::EXIT (BOOT::|error| "not finished")))))
; --> DEFUN PROGN SB-IMPL::%DEFUN SB-IMPL::%DEFUN SB-INT:NAMED-LAMBDA
; ==>
; #'(SB-INT:NAMED-LAMBDA BOOT::|QETAWORK;eliminate;2L;1|
; (BOOT::|lpol| BOOT::$)
; (BLOCK BOOT::|QETAWORK;eliminate;2L;1|
; (BOOT::SPROG
; ((BOOT::|rs| #) (#:G733 NIL) (BOOT::|p| NIL) (#:G732 NIL)
; (BOOT::|coerce| #))
; (BOOT::SEQ
; (BOOT::LETT BOOT::|coerce| # BOOT::|QETAWORK;eliminate;2L;1|)
; (BOOT::LETT BOOT::|rs| # BOOT::|QETAWORK;eliminate;2L;1|)
; (BOOT::EXIT #)))))
;
; caught STYLE-WARNING:
; The variable $ is defined but never used.
; in: SDEFUN |QETAWORK;eliminate;2L;1!0|
; (BOOT::SDEFUN BOOT::|QETAWORK;eliminate;2L;1!0|
; ((BOOT::|p| NIL) (BOOT::$$ NIL))
; (BOOT::|error| "not implemented"))
; --> DEFUN PROGN SB-IMPL::%DEFUN SB-IMPL::%DEFUN SB-INT:NAMED-LAMBDA
; ==>
; #'(SB-INT:NAMED-LAMBDA BOOT::|QETAWORK;eliminate;2L;1!0|
; (BOOT::|p| BOOT::$$)
; (BLOCK BOOT::|QETAWORK;eliminate;2L;1!0|
; (BOOT::|error| "not implemented")))
;
; caught STYLE-WARNING:
; The variable |p| is defined but never used.
;
; caught STYLE-WARNING:
; The variable $$ is defined but never used.
;
; compilation unit finished
; caught 3 STYLE-WARNING conditions
; /home/hemmecke/backup/git/fricas/QETAWORK.NRLIB/QETAWORK.fasl written
; compilation finished in 0:00:00.009
------------------------------------------------------------------------
QEtaWork is already explicitly exposed in frame frame1
QEtaWork will be automatically loaded when needed from
/home/hemmecke/backup/git/fricas/QETAWORK.NRLIB/QETAWORK
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
P ==> PositiveInteger
Pol ==> Polynomial C
LPol ==> List Pol
)abbrev package QETAWORK QEtaWork
QEtaWork(C: Field): with
eliminate: LPol -> LPol
== add
eliminate(lpol: LPol): LPol ==
R ==> Integer
coerce(p: Pol): R == error "not implemented"
rs: List R := [coerce(p)@R for p in lpol]
-- rs: List R := [p::R for p in lpol]
error "not finished"