On 3/16/25 16:42, Waldek Hebisch wrote:
%%% (3) -> position(k2)

    (3)  2048

Positions have gaps, that is deliberate to limit renumbering.

OK. But then I must have missed the place where these gaps are introduced. In fact, I do not quite get the ordering of the kernels.
I saw the triage function that is used for comparison of kernels.

    triage(k1, k2) ==
      height(k1)   ~= height(k2)   => B2Z(height(k1)   < height(k2))
      operator(k1) ~= operator(k2) => B2Z(operator(k1) < operator(k2))
      (n1 := #(argument k1)) ~= (n2 := #(argument k2)) => B2Z(n1 < n2)
      -- Handled by linear search earlier
      -- ((func := property(operator k1, SPECIALEQUAL)) case None) and
      --  (((func::None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0
      for x1 in argument(k1) for x2 in argument(k2) repeat
        x1 ~= x2 => return B2Z(smaller?(x1, x2))
      0

That seems to suggest that if the same kernels are introduced in two different sessions they would inserted into the cache array in the same order. Maybe not in the same position, but comparing the kernels with < should be the same in both sessions. (OK, except when "smaller?" behaves differently.)

BTW: Are you recompiling some domains?  More precisely, do you
get wrong results when you )LIB files that you recompiled
separately and avoid any operations that could clear kernel
cache?

The behaviour I experienced was not done with )lib. But in my original setup I started a fresh fricas, compiled my code then ran it. It used "trueEqual $ AN" with my seemingly wrongly constructed algebraic numbers and trueEqual crashed, because there appeared a sqrt(3) in the polynomial computed by "norm" which couldn't be retracted to Fraction(INT). Interestingly, when I afterwards ran the same code for the second time, it went through, giving even the right result.
I meanwhile know that compiling is dangerous for the cache.

Anyway, than you for your hint to Kernel(Expression INT). I wouldn't have seen this so easily. With that I can probably continue.

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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/37dbd04d-60cb-4790-aacf-c55a82a2ff10%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