I see the stack exhausted in sbcl 1.3.21 after a long time,
it happens in 'critBonD' of GroebnerInternalPackage.

That's a recursion function and not tail recursion, and stack
do get deeper than 20000 nested function calls.  I rewrite
it using loop, and the result returns in 800s, #(gb) is 8536.
(on 2.3GHz 6300HQ, and I was printing #(D))

diff --git a/src/algebra/gbintern.spad b/src/algebra/gbintern.spad
index 0003336b..d79579c8 100644
--- a/src/algebra/gbintern.spad
+++ b/src/algebra/gbintern.spad
@@ -196,11 +196,11 @@ GroebnerInternalPackage(Dom, Expon, VarSet,
Dpol) : T == C where
              --- erase elements in D fullfilling crit B

    critBonD(h : Dpol, D : List(critPair))==
-         empty?(D) => []
-         x := first(D)
-         critB(degree(h), x.lcmfij, degree(x.poli), degree(x.polj)) =>
-           critBonD(h, rest(D))
-         cons(x, critBonD(h, rest(D)))
+       res : List(critPair) := []
+       for x in D repeat
+         if not critB(degree(h), x.lcmfij, degree(x.poli), degree(x.polj)) then
+            res := cons(x, res)
+       reverse! res

              -----------------------------

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to