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?(adsbygoogle = window.adsbygoogle || []).push({});

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]

else

return [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!

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Recursion-theoretic if-statements

**Physics Forums | Science Articles, Homework Help, Discussion**