Dear Waldek,

Basic question: How can I see what kernels are cached?

Explanation follows.

In some program I recursively traverse the operator/kernel/ratfun tree of an algebraic number and rebuild another algebraic number. I seemingly have a bug there, but cannot easily find it.

The lines

                    dbgPrint("csfX z", z)
                    dbgPrint("csfXxx", x)
                    t := z*x
                    dbgPrint("CSFX t", t)


gave me the following output

[:> , csfX z, sqrt(-1)*nthRoot(-1, 3)*sqrt(3)]
[:> , csfXxx, nthRoot(-sqrt(-1)*sqrt(3)+1, 3)]
[:> , CSFX t, 3*sqrt(-1)*nthRoot(-1, 3)]

The value of t is completely wrong.

In another place I see two algebraic numbers that print in my program as

-- aa:=(sqrt(-1)*nthRoot(-1, 3)*sqrt(3)+nthRoot(-1, 3))*nthRoot(-sqrt(-1)*sqrt(3)+1, 3)-2*nthRoot(2, 3) -- ab:=sqrt(-1)*nthRoot(-1, 3)*sqrt(3)*nthRoot(-sqrt(-1)*sqrt(3)+1, 3)+nthRoot(-1, 3)*nthRoot(-sqrt(-1)*sqrt(3)+1, 3)-2*nthRoot(2, 3)

with respective towers

-- ta:=[sqrt(-1),_
        nthRoot(-1, 3),_
        nthRoot(2, 3),_
        sqrt(3),_
        nthRoot(-sqrt(-1)*sqrt(3)+1, 3)]
-- tb:=[sqrt(-1),_
        nthRoot(-1, 3),_
        sqrt(3),_
        nthRoot(2, 3),_
        nthRoot(-sqrt(-1)*sqrt(3)+1, 3),_
        nthRoot(-sqrt(-1)*sqrt(3)+1, 3)]

The surprising fact for me is in this double entry in tb.
Entering ab and computing "tower ab" in the same session gives:

%%% (6) -> ab:=sqrt(-1)*nthRoot(-1, 3)*sqrt(3)*nthRoot(-sqrt(-1)*sqrt(3)+1, 3)+nthRoot(-1, 3)*nthRoot(-sqrt(-1)*sqrt(3)+1, 3)-2*nthRoot(2, 3)

                                    +----------------+
          +---+3+---+ +-+   3+---+ 3|   +---+ +-+          3+-+
   (6)  (\|- 1 \|- 1 \|3  + \|- 1 )\|- \|- 1 \|3  + 1  - 2 \|2
                              Type: AlgebraicNumber
%%% (7) -> tower ab

                                      +----------------+
          +---+  3+---+  3+-+   +-+  3|   +---+ +-+
   (7)  [\|- 1 , \|- 1 , \|2 , \|3 , \|- \|- 1 \|3  + 1 ]
                              Type: List(Kernel(AlgebraicNumber))

That is, no duplication of the last kernel.

Long story short... it seems that my program creates a kernel and the cache does not recognize that it is the same. In order to find exactly where this happens, I would like to know how I can look at the kernel cache from SPAD.

Thank you.
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 visit 
https://groups.google.com/d/msgid/fricas-devel/5743bf01-fd67-42d6-b854-0c47001cd23b%40hemmecke.org.
  • [fricas-devel] Kernel... 'Ralf Hemmecke' via FriCAS - computer algebra system
    • Re: [fricas-deve... Waldek Hebisch
      • Re: [fricas-... 'Ralf Hemmecke' via FriCAS - computer algebra system
        • Re: [fri... Waldek Hebisch
          • Re: ... 'Ralf Hemmecke' via FriCAS - computer algebra system
            • ... Waldek Hebisch
              • ... 'Ralf Hemmecke' via FriCAS - computer algebra system
          • Re: ... Waldek Hebisch
            • ... 'Ralf Hemmecke' via FriCAS - computer algebra system
              • ... Waldek Hebisch

Reply via email to