Recursion-theoretic if-statements

  • Context: Graduate 
  • Thread starter Thread starter kanima
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the implementation of if-statements in the context of recursion theory, particularly focusing on how to define partial recursive functions that incorporate conditional logic. Participants explore the relationship between primitive recursion, mu-recursion, and the representation of conditional statements within these frameworks.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant inquires about defining an if-statement in recursion-theoretic terms, comparing primitive recursion to for-loops and mu-recursion to while-loops.
  • Another participant notes the differences in definitions of partial recursive functions between sources like Wikipedia and Wolfram, questioning the significance of these differences in the context of if-statements.
  • A later reply clarifies their understanding of partial recursive functions, aligning with Wikipedia's definition and asserting that these functions are equivalent to Turing-computable functions.
  • One participant proposes defining a function T(x) that returns 1 if x < 50 and 0 otherwise, suggesting that the desired function can be constructed using T(x) to implement the if-statement logic.
  • Another participant confirms that a recursive predicate can be understood as a recursive function yielding values of 0 or 1, indicating that the function f would be recursive if the predicate T is recursive.

Areas of Agreement / Disagreement

Participants express varying interpretations of the definitions of partial recursive functions and their implications for implementing conditional logic. There is no clear consensus on the best approach to represent if-statements in recursion theory, and multiple viewpoints remain on the significance of different definitions.

Contextual Notes

Participants reference different definitions of partial recursive functions, which may lead to varying interpretations of how to implement conditional logic. The discussion also touches on the computability of general recursive predicates, which remains somewhat ambiguous.

kanima
Messages
6
Reaction score
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 g and h I had the following algorithm which takes x as input.

if x &lt; 50 then
return g(x)​
else
return h(x)​

How could I define a partial recursive function computing the above algorithm? What if the condition x &lt; 50 were replaced by some more general recursive predicate R(x)?

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 news on Phys.org
I don't know the answer to your question, but it prompted me to look up "partial recursive function". I notice there a considerable difference between how it is defined on the Wikipedia (http://en.wikipedia.org/wiki/Computable_function) versus Wolfram (http://mathworld.wolfram.com/RecursiveFunction.html).

If we use the Wolfram definition, your question could be interpreted as asking how to write a function who definition has an "if ... then " clause as a series of equations. However, I'm not sure that question is significant if we are allowed to use "function symbols" in the equations unless there is some restriction on what functions can be represented by "function symbol". Is there something that says a "function symbol" cannot stand for a function (say on the non-negative integers) which is the list of pairs (x, f(x)) = { (1,0),(2,0),(3,1),(4,1),... }, which amounts to f(k) = 0 if k < 3 and f(k) = 1 otherwise.
 
Last edited by a moderator:
Sorry, I should have been more specific, especially because of the many guises this same subject appears in.

My definition of partial recursive function is more in line with the one given in the following wikipedia article:
http://en.wikipedia.org/wiki/Μ-recursive_function.

Wikipedia calls them partial \mu-recursive functions, and the https://www.amazon.com/dp/044450205X/?tag=pfamazon01-20I am following simply calls them partial recursive functions.

The class of functions defined in this way is equivalent to the class of those defined in the Wolfram link. This class of functions is also equivalent to the class of Turing-computable functions: functions whose values can be computed by some Turing machine.

It shouldn't be very difficult to implement conditional if-statements on Turing machines (since they're pretty natural models of computation). However, I am interested in seeing how a function computed by an algorithm with an if-statement can be built up from definition given in the wikipedia page on \mu-recursive functions.
 
Last edited by a moderator:
Perhaps the place to start is to find a function T(x) that returns 1 if x < 50 and returns 0 otherwise. Then the function you asked about is defined by f(x) = T(x)g(x) + (1-T(x))h(x).

What is a "general recursive predicate"? Is there a definition or theorem that says its evaluation (as true or false , or 1 or 0) is computable.
 
Yes, I believe you're right, and looks like the answer was quite simple after all. By a recursive predicate I did just mean a recursive function that could only give the values 0 or 1. So I guess the function f in your example would be recursive if the predicate T expressing the condition was recursive.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 54 ·
2
Replies
54
Views
7K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K