factor(X) $UP(x,INT)

0 views
Skip to first unread message

Serge D. Mechveliani

unread,
Feb 28, 2012, 3:06:39 PM2/28/12
to fricas...@googlegroups.com
Can you, please tell, what is wrong here?


---------------------------------------------- t.spad ------------
INT ==> Integer
NNI ==> NonNegativeInteger
UPol ==> UnivariatePolynomial(x, Integer)

)abbrev package FOO Foo
Foo() : with
f : () -> Factored UPol
==
add
f() : Factored UPol ==
X := monomial(1 ::INT, 1 ::NNI) $UPol
factor(X) $UPol
-------------------------------------------------------------------

In the interpreter, factor(f) works for f : UPol.

And the compiler of fricas-1.1.6 + SBCL 1.0.55 reports

Compiling FriCAS source code from file
/home/mechvel/haxiom/fromA-aim/t.spad using old system compiler.
FOO abbreviates package Foo
------------------------------------------------------------------------
initializing NRLIB FOO for Foo
compiling into NRLIB FOO
compiling exported f : () -> Factored UnivariatePolynomial(x,Integer)
****** comp fails at level 3 with expression: ******
error in function f

(SEQ
(LET X
((|elt| (|UnivariatePolynomial| |x| (|Integer|)) |monomial|)
(|::| 1 (|Integer|)) (|::| 1 (|NonNegativeInteger|))))
(|exit| 1 | << | ((|elt| (|UnivariatePolynomial| |x| (|Integer|))
|factor|) X)
| >> |))
****** level 3 ******
$x:= ((elt (UnivariatePolynomial x (Integer)) factor) X)
$m:= (Factored (UnivariatePolynomial x (Integer)))
$f:=
((((X #) (|$Information| #) (|f| #) (|$DomainsInScope| # # #) ...)))

>> Apparent user error:
not known that (UnivariatePolynomial x (Integer)) has
(has (Integer) (PolynomialFactorizationExplicit))
-------------------------------------------------------------------

Thanks,

------
Sergei
mec...@botik.ru


Waldek Hebisch

unread,
Feb 29, 2012, 12:13:50 PM2/29/12
to fricas...@googlegroups.com

You need to "package call" it. In this case:

factor(X)$UnivariateFactorize(Upol)

--
Waldek Hebisch
heb...@math.uni.wroc.pl

Serge D. Mechveliani

unread,
Feb 29, 2012, 12:44:31 PM2/29/12
to fricas...@googlegroups.com
On Wed, Feb 29, 2012 at 06:13:50PM +0100, Waldek Hebisch wrote:
> Serge D. Mechveliani wrote:
> >
> > [..]

> > f() : Factored UPol ==
> > X := monomial(1 ::INT, 1 ::NNI) $UPol
> > factor(X) $UPol
[..]

> > >> Apparent user error:
> > not known that (UnivariatePolynomial x (Integer)) has
> > (has (Integer) (PolynomialFactorizationExplicit))
> >
>
> You need to "package call" it. In this case:
>
> factor(X)$UnivariateFactorize(Upol)
>

Thank you.
And where to call prime?( g : UP(x,INT) ) from?

------
Sergei
mec...@botik.ru

Reply all
Reply to author
Forward
0 new messages