- #1
kanima
- 7
- 0
Hi, there, I was wondering if anyone knew a good way to implement if-statements in recursion-theoretic terms. Basically, I've come to the understanding that primitive recursion is analogous to a for-loop and mu-recursion to more general while-loops, but is there in general a simple analog of an if-statement in recursion theory?
For example, suppose that given partial recursive functions [itex]g[/itex] and [itex]h[/itex] I had the following algorithm which takes [itex]x[/itex] as input.
if [itex]x < 50[/itex] then
How could I define a partial recursive function computing the above algorithm? What if the condition [itex]x < 50[/itex] were replaced by some more general recursive predicate [itex]R(x)[/itex]?
I suspect this shouldn't be so difficult but I am quite new to this subject. If this is the case, I would be quite glad if someone would share their knowledge me.
Thanks!
For example, suppose that given partial recursive functions [itex]g[/itex] and [itex]h[/itex] I had the following algorithm which takes [itex]x[/itex] as input.
if [itex]x < 50[/itex] then
return [itex]g(x)[/itex]
elsereturn [itex]h(x)[/itex]
How could I define a partial recursive function computing the above algorithm? What if the condition [itex]x < 50[/itex] were replaced by some more general recursive predicate [itex]R(x)[/itex]?
I suspect this shouldn't be so difficult but I am quite new to this subject. If this is the case, I would be quite glad if someone would share their knowledge me.
Thanks!