On Mon, Mar 02, 2020 at 08:21:58PM +0100, Ralf Hemmecke wrote:
> I've setup an automatic check. After applying this patch,
>
> commit 917f06d2921e44f541f0440f693d1f9312a5f5c4
> Author: Waldek Hebisch <[email protected]>
> Date: Mon Mar 2 14:55:49 2020 +0000
>
> Generalize GENUPS
>
> git-svn-id:
> https://fricas.svn.sourceforge.net/svnroot/fricas/trunk@2626
> b0c55286-4f34-0410-a049-a1e7e93b0762
>
> the compilation of libfricas.al aborts with
>
> "ap/GENUPS2.ap", line 60:
> (|If| (|Test| (|Has| |#2| (|Apply| |FunctionSpace| |#1|)))
> ....................................................................^
> [L60 C69] #1 (Error) Argument 1 of `FunctionSpace' did not match any
> possible parameter type. The rejected type is Join(IntegralDomain,
> RetractableTo(Integer)) with .
> Expected type Comparable.
>
<snip>
>
> Obvioustly, we have
>
> FunctionSpace(R : Comparable) : Category == Definition where
>
> but you only require
>
> GenerateUnivariatePowerSeries2(R, FE) : Exports == Implementation where
> R : Join(IntegralDomain, RetractableTo Integer)
> FE : Join(Ring, RetractableTo SY)
>
> so
>
> if FE has FunctionSpace(R) then
>
> cannot work.
What about attached patch.
Note: I prefer to weaken requirements of GenerateUnivariatePowerSeries2,
instead of replacing them by stronger ones.
--
Waldek Hebisch
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/20200304145638.GA4928%40math.uni.wroc.pl.
Index: src/algebra/genups.spad
===================================================================
--- src/algebra/genups.spad (revision 2626)
+++ src/algebra/genups.spad (working copy)
@@ -140,8 +126,7 @@
++ Description:
++ \spadtype{GenerateUnivariatePowerSeries} provides functions that create
++ power series from explicit formulas for their \spad{n}th coefficient.
-GenerateUnivariatePowerSeries2(R, FE) : Exports == Implementation where
- R : Join(IntegralDomain, RetractableTo Integer)
+GenerateUnivariatePowerSeries2(FE) : Exports == Implementation where
FE : Join(Ring, RetractableTo SY)
ANY1 ==> AnyFunctions1
EQ ==> Equation
@@ -190,7 +175,7 @@
++ \spad{series(n +-> a(n), x = a, r0..r1, r)} returns
++ \spad{sum(n = r0 + k*r while n <= r1, a(n) * (x - a)^n)}.
- if FE has FunctionSpace(R) then
+ if FE has RetractableTo(I) and FE has Evalable(FE) then
taylor : (FE, SY, EQ FE) -> Any
++ \spad{taylor(a(n), n, x = a)} returns
@@ -207,6 +192,8 @@
++ \spad{laurent(a(n), n, x=a, n0..n1)} returns
++ \spad{sum(n = n0..n1, a(n) * (x - a)^n)}.
+ if FE has RetractableTo(RN) and FE has Evalable(FE) then
+
puiseux : (FE, SY, EQ FE, SEG RN, RN) -> Any
++ \spad{puiseux(a(n), n, x = a, r0.., r)} returns
++ \spad{sum(n = r0, r0 + r, r0 + 2*r..., a(n) * (x - a)^n)};
@@ -265,7 +252,7 @@
series(f : RN -> FE, eq : EQ FE, seg : SEG RN, r : RN) ==
puiseux(f, eq, seg, r)
- if FE has FunctionSpace(R) then
+ if FE has RetractableTo(I) and FE has Evalable(FE) then
taylor(an : FE, n : SY, eq : EQ FE) : Any ==
taylor((i : I) : FE +-> eval(an, (n :: FE) = (i :: FE)), eq)
@@ -276,6 +263,8 @@
laurent(an, n, eq, seg) ==
laurent((i : I) : FE +-> eval(an, (n :: FE) = (i :: FE)), eq, seg)
+ if FE has RetractableTo(RN) and FE has Evalable(FE) then
+
puiseux(an, n, eq, r0, m) ==
puiseux((r : RN) : FE +-> eval(an, (n :: FE) = (r :: FE)), eq, r0, m)
@@ -295,7 +284,7 @@
LinearlyExplicitOver Integer),
FE : Join(RetractableTo Symbol, TranscendentalFunctionCategory,
FunctionSpace R)) ==
- GenerateUnivariatePowerSeries2(R, FE)
+ GenerateUnivariatePowerSeries2(FE)
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.