paradox problem

2 views
Skip to first unread message

Franz Lehner

unread,
Nov 14, 2025, 5:59:23 AM (4 days ago) Nov 14
to fricas...@googlegroups.com
Dear all,

experimenting with fixed points of Taylor series I came across the package
ParadoxicalCombinatorsForStreams which is used heavily for various
functions in the library.

however attempting to solve the Catalan recurrence
g(z) = z + g(z)^2
I constantly get exhausted stacks:
********
)abbrev package PARADOX Paradox
Paradox(R : CommutativeRing) : Exports == Implementation where
STSOR ==> StreamTaylorSeriesOperations(R)
Exports ==> with
f:Stream R -> Stream R
Implementation ==> add
f(x) ==
x2 := (x * x)$STSOR
z := monom(1,1)$STSOR
(z + x2)$STSOR

********

(1) -> Y(f$Paradox INT)$ParadoxicalCombinatorsForStreams(INT)

INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution

>> System error:
Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.

PROCEED WITH CAUTION.

*****

manual iteration works.
where is my mistake?

Franz

Ralf Hemmecke

unread,
Nov 14, 2025, 7:28:22 AM (4 days ago) Nov 14
to fricas...@googlegroups.com
)abbrev package PARADOX Paradox
Paradox(R : CommutativeRing) : Exports == Implementation where
Exports ==> with
catalan: () -> Stream R
f: Stream R -> Stream R
Implementation ==> add
import from StreamTaylorSeriesOperations(R)
f(x: Stream R): Stream R == cons(1,x*x)
catalan(): Stream R == Y(f) $ParadoxicalCombinatorsForStreams(R)

Franz Lehner

unread,
Nov 14, 2025, 9:54:42 AM (3 days ago) Nov 14
to 'Ralf Hemmecke' via FriCAS - computer algebra system
On Fri, 14 Nov 2025, 'Ralf Hemmecke' via FriCAS - computer algebra system wrote:
> f(x: Stream R): Stream R == cons(1,x*x)
thanks, this gives an equivalent result,
but what exactly causes the other one to exhaust the stack?
a consequence of nonuniqueness of the solution?

Franz

Waldek Hebisch

unread,
Nov 14, 2025, 10:16:22 AM (3 days ago) Nov 14
to fricas...@googlegroups.com
I did not look at details, so I am not sure if this is the reason,
but you need to specify first (index 0) term of the series. AFAICS
Ralf's definition did this, yours did not. For index 0 term
you get equation

x0 = x0*x0

which is infinite recursion.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages