Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: The Ackermann Function

by Moron (Curate)
on Jun 20, 2006 at 13:35 UTC ( [id://556493]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to The Ackermann Function

The way I know is to make a finite state diagram, (see also finite state machine)- in this case the thread moves into three possible states controlled by the ifs in the subroutine, plus a 'final return' state and you would need to identify for each state what conditions result in movement between the states. The fact that branch three generates two calls - one that routes to branch two and one back to branch three means that a thread in state three cannot attain the 'final return' state for the example data. Use the possible data ranges to fill out the state transition table described in the link above to identify which boundary conditions lead to final exit and which not.

-M

Free your mind

Replies are listed 'Best First'.
Re^2: The Ackermann Function
by gjb (Vicar) on Jun 20, 2006 at 15:26 UTC

    I'm afraid this doesn't make sense to me. Are you suggesting that the Ackermann function should simply not be computed if the conditions for branch 3 hold? That would imply that one can only compute A(0, i) and A(i, 0), which is not particularly interesting.

    I may miss your point, but I'd be a bit surprised if FSMs would be useful in this context. Can you show us what you have in mind?

    Just my 2 cents, -gjb-

      Oh - I beg to differ - His Noodly Appendage, the FSM is relevent in EVERY context !

           "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://556493]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.