Post Reply 
"Running non recursive evaluator"
06-14-2014, 06:03 PM
Post: #1
"Running non recursive evaluator"
This occurs whenever recursion depth goes beyond the "Recursive Function" parameter in the CAS Setting. The maximum limit for this parameter seems to be 100. That is not very deep for recursive algorithms, especially since the Prime does not seem to do tail recursion optimization. Here is a simple example:
Code:
(x,a)->BEGIN
  IF x=0 THEN RETURN(a); ELSE RETURN(f(x-1,x*a)); END;
END
Calling f(99,1) works but if I call this as f(100,1) then I get the warning message "Running non recursive evaluator", which requires a click to exit (and seems to be much slower). Is there a way to do deeper recursion? Ideally, the limit should be much higher or even unbounded (with run-time error for stack overflow), but I would be content to have tail recursion!

PS, the typo "Rescursive Evaluation" in CAS Settings is still there in the new firmware.
Find all posts by this user
Quote this message in a reply
06-14-2014, 06:43 PM
Post: #2
RE: "Running non recursive evaluator"
I don't know any portable way to check for stack overflow in C. That's the reason for the max recursive eval parameter. Initially, you got a runtime error if the max number of recursive calls was reached, later I implemented a non-recursive evaluator (with dynamic allocation of the space required to make recursive calls), you don't get an error anymore, but it's slower, therefore the warning remains.
By the way, you should not consider the CAS programming language like a traditional programming language designed by CS people for large projects. Like for many other CAS, it's just a scripting language to make easily small programming extensions (say up to about 1000 lines of code on a PC). Large CAS development should be done in C++ on a PC/Mac with libgiac.
Find all posts by this user
Quote this message in a reply
11-07-2016, 03:11 AM
Post: #3
RE: "Running non recursive evaluator"
After upgrading to the latest software version, running any of my cas programs shows "Running non recursive evaluator" After "enter'' I may get a result, but not always. I have not been able to figure out why this is happening. Does anyone know? Thanks.
Find all posts by this user
Quote this message in a reply
11-07-2016, 01:42 PM (This post was last modified: 11-07-2016 01:47 PM by cclinus.)
Post: #4
RE: "Running non recursive evaluator"
Hi Alberto,

In CAS Setting mode Page 2.
Try to set Recursive Function to 100.
(Max is 100 already, So it may not help Peter's problem)
But it solve my problem.

   
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)