Does someone know what happens in this session?

The interesting part happens here:

(18) -> subst(ee, v=z)

   (18)  z - 1
                                  Type: Expression(Integer)
(19) -> s := solve(ee)

   (19)  [a  = 1]
           0
                   Type: List(Equation(Expression(Integer)))


(20) -> )compile /tmp/hemmecke/sol.spad
    ..............

(20) -> subst(ee, v=z)

   (20)  a  - 1
          0
                                   Type: Expression(Integer)
(21) -> s := solve(ee)

   (21)  []
                   Type: List(Equation(Expression(Integer)))


How can it be that compiling a package changes the behaviour of a function?

That looks like a bug to me.

Any ideas?

Ralf

-- 
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/814e5fb1-a692-0cca-bf6a-8b6944951d98%40hemmecke.org.
)abbrev package SOLRHX Solrhx
Solrhx: Exports == Implementation where
  Z ==> Integer
  E ==> Expression Z
  ST ==> Stream(E)
  O ==> OutputForm
  Exports ==> with
    solrhx: ST -> ST
  Implementation ==> add
    solrhx(st: ST): ST == delay
      empty? st => st
      e: E := first st
      print(hconcat(["e="::Symbol::O, e::O]$List(O)))
      leq: List Equation E := solve(e)$TransSolvePackage(Z)
      print(hconcat(["leq="::Symbol::O, leq::O]$List(O)))
      eq: Equation E := first leq
      print(hconcat(["eq="::Symbol::O, eq::O]$List(O)))
      cons(rhs eq, solrhx map(z+->eval(z, eq), rest st))
Z ==> Integer
Q ==> Fraction Z
E ==> Expression Z
ROZE==>RecurrenceOperator(Z, E)

aList(n)==[n*factorial(n+2*k-1)/(factorial(n + k)*factorial(k))*(-1)^k for k in 
0..14]

res := guessAlg(aList 1, indexName==a)

e := getEq(res.1)$ROZE

)clear prop f x
f := operator 'f
a: Symbol := 'a;
st: Stream E := [a[i::OutputForm] for i in 0..];
s := series(st)$SparseUnivariateTaylorSeries(E,x,0)
et := subst(e,f(x)=t)
function(et, 'h, [t,x]);
xx := monomial(1,1)$SparseUnivariateTaylorSeries(E,x,0);

cs := coefficients h(s,xx)
ee := first cs
v := first variables ee
subst(ee, v=z)
s := solve(ee)

)compile /tmp/hemmecke/sol.spad

subst(ee, v=z)
s := solve(ee)
Checking for foreign routines
FRICAS="/home/hemmecke/HDD/hemmecke/software/lib/fricas/target/x86_64-linux-gnu"
spad-lib="/home/hemmecke/HDD/hemmecke/software/lib/fricas/target/x86_64-linux-gnu/lib/libspad.so"
foreign routines found
openServer result -2
                       FriCAS Computer Algebra System 
          Version: FriCAS 99b0ed3ba53afbba57169283e803b2009020047d
                  Timestamp: Sun Oct  4 17:43:38 CEST 2020
-----------------------------------------------------------------------------
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave FriCAS and return to shell.
-----------------------------------------------------------------------------
 
(1) -> Z ==> Integer
                                                                   Type: Void
(2) -> Q ==> Fraction Z
                                                                   Type: Void
(3) -> E ==> Expression Z
                                                                   Type: Void
(4) -> ROZE==>RecurrenceOperator(Z, E)
                                                                   Type: Void
(5) -> aList(n)==[n*factorial(n+2*k-1)/(factorial(n + k)*factorial(k))*(-1)^k 
for k in 0..14]
                                                                   Type: Void
(6) -> res := guessAlg(aList 1, indexName==a)
   Compiling function aList with type PositiveInteger -> List(Fraction(
      Integer)) 

   (6)
       a             2                                   2      3      4
   [[[x ]f(x): x f(x)  + f(x) - 1 = 0, f(x) = 1 - x + 2 x  - 5 x  + O(x )]]
                                              Type: List(Expression(Integer))
(7) -> e := getEq(res.1)$ROZE

              2
   (7)  x f(x)  + f(x) - 1
                                                    Type: Expression(Integer)
(8) -> )clear prop f x
(8) -> f := operator 'f

   (8)  f
                                                          Type: BasicOperator
(9) -> a: Symbol := 'a;

                                                                 Type: Symbol
(10) -> st: Stream E := [a[i::OutputForm] for i in 0..];

                                            Type: Stream(Expression(Integer))
(11) -> s := series(st)$SparseUnivariateTaylorSeries(E,x,0)

   (11)
                   2      3      4      5      6      7      8      9       10
     a  + a x + a x  + a x  + a x  + a x  + a x  + a x  + a x  + a x  + a  x
      0    1     2      3      4      5      6      7      8      9      10
   + 
        11
     O(x  )
                  Type: SparseUnivariateTaylorSeries(Expression(Integer),x,0)
(12) -> et := subst(e,f(x)=t)

          2
   (12)  t x + t - 1
                                                    Type: Expression(Integer)
(13) -> function(et, 'h, [t,x]);

                                                                 Type: Symbol
(14) -> xx := monomial(1,1)$SparseUnivariateTaylorSeries(E,x,0);

                  Type: SparseUnivariateTaylorSeries(Expression(Integer),x,0)
(15) -> cs := coefficients h(s,xx)
   Compiling function h with type (SparseUnivariateTaylorSeries(
      Expression(Integer),x,0), SparseUnivariateTaylorSeries(Expression
      (Integer),x,0)) -> SparseUnivariateTaylorSeries(Expression(
      Integer),x,0) 

   (15)
                   2                               2
   [a  - 1, a  + a  , a  + 2 a a , a  + 2 a a  + a  , a  + 2 a a  + 2 a a ,
     0       1    0    2      0 1   3      0 2    1    4      0 3      1 2
                             2
    a  + 2 a a  + 2 a a  + a  , a  + 2 a a  + 2 a a  + 2 a a ,
     5      0 4      1 3    2    6      0 5      1 4      2 3
                                      2
    a  + 2 a a  + 2 a a  + 2 a a  + a  ,
     7      0 6      1 5      2 4    3
    a  + 2 a a  + 2 a a  + 2 a a  + 2 a a ,
     8      0 7      1 6      2 5      3 4
                                               2
    a  + 2 a a  + 2 a a  + 2 a a  + 2 a a  + a  , ...]
     9      0 8      1 7      2 6      3 5    4
                                            Type: Stream(Expression(Integer))
(16) -> ee := first cs

   (16)  a  - 1
          0
                                                    Type: Expression(Integer)
(17) -> v := first variables ee

   (17)  a
          0
                                                                 Type: Symbol
(18) -> subst(ee, v=z)

   (18)  z - 1
                                                    Type: Expression(Integer)
(19) -> s := solve(ee)

   (19)  [a  = 1]
           0
                                    Type: List(Equation(Expression(Integer)))
(20) -> )compile /tmp/hemmecke/sol.spad
   Compiling FriCAS source code from file /tmp/hemmecke/sol.spad using 
      old system compiler.
   SOLRHX abbreviates package Solrhx 
------------------------------------------------------------------------
   initializing NRLIB SOLRHX for Solrhx 
   compiling into NRLIB SOLRHX 
   compiling exported solrhx : Stream Expression Integer -> Stream Expression 
Integer
Time: 0.03 SEC.

(time taken in buildFunctor:  1)

;;;     ***       |Solrhx| REDEFINED

;;;     ***       |Solrhx| REDEFINED
Time: 0.00 SEC.


   Cumulative Statistics for Constructor Solrhx
      Time: 0.03 seconds
 
   finalizing NRLIB SOLRHX 
   Processing Solrhx for Browser database:
--->-->Solrhx(constructor): Not documented!!!!
--->-->Solrhx((solrhx ((Stream (Expression (Integer))) (Stream (Expression 
(Integer)))))): Not documented!!!!
--->-->Solrhx(): Missing Description
; compiling file 
"/home/hemmecke/backup/git/fricas-worksheets/SOLRHX.NRLIB/SOLRHX.lsp" (written 
10 OCT 2020 11:05:48 PM):

; wrote /home/hemmecke/backup/git/fricas-worksheets/SOLRHX.NRLIB/SOLRHX.fasl
; compilation finished in 0:00:00.029
------------------------------------------------------------------------
   Solrhx is now explicitly exposed in frame initial 
   Solrhx will be automatically loaded when needed from 
      /home/hemmecke/backup/git/fricas-worksheets/SOLRHX.NRLIB/SOLRHX

(20) -> subst(ee, v=z)

   (20)  a  - 1
          0
                                                    Type: Expression(Integer)
(21) -> s := solve(ee)

   (21)  []
                                    Type: List(Equation(Expression(Integer)))
(22) -> 

Reply via email to