10

Every time I think I get what Rice's theorem means, I find a counterexample to confuse myself. Maybe someone can tell me where I'm thinking wrong.

Lets take some non-trivial property of the set of computable functions, for example let $L = \{ f : \mathbb{N} \to \mathbb{N} \;|\; \text{f is a computable and total function} \}$. Obviously, $L$ is countably infinite and there's also a countably infinite number of computable functions not in $L$.

Now lets consider a turing complete programming language over of a finite set of instructions $\Sigma$ and the set of syntactically correct programs $P \subseteq \Sigma^*$, with $|P| = |\mathbb{N}|$. If I can choose the semantics of my language as I please, I may also number the programs as I please and so it should be possible to design a programming language where some subset of the programs computes exactly some arbitrary subset of the computable functions, as long as the cardinality matches. For example, let $P_{pal} = \{ w \in \Sigma^* \;|\; w\text{ is a palindrome} \}$, and each program $p \in P_{pal}$ compute a total function. Since $|P_{pal}| = |L|$, such a language should exist.

However, $isPalindrome(w)$ is obviously turing-computable and since $isPalindrome(w) \iff isTotal(w)$, we would thus have a program which decides the non-trivial property $L$, which is not possible according to Rice's theorem.

Where is the error in my deduction? Does this mean there is no programming language where each palindromic program (or rather of any computable structure) computes exactly the total functions (or rather any set of computable functions)? This really perplexes me.

Raphael
  • 73,212
  • 30
  • 182
  • 400
Stefan Lutz
  • 545
  • 5
  • 14

4 Answers4

6

What you forget is that all the mappings you use have to be computable. When you state that matching cardinalities ensure the existence of a mapping, that may be true, but the mapping is unlikely to be computable, precisely because that would let you get a contradiction with Rice theorem. In computability (at least for what I know of it), everything is either finite or countably infinite. So existence of mappings is usually not an issue. The problem is whether it is a computable one.

To say it differently, there is certainly a mapping (actually uncountably many) that associates precisely palindromic words with total computable functions. But, given such a palindrom $w$, which the mapping associates with a function $f_w$ there is no way you can actually use such a mapping to get the result of applying $f_w$ to some argument. You mapping does not give you any way of identifying the function or computing with it. Your language has non computable semantics.

babou
  • 19,645
  • 43
  • 77
2

I may also number the programs as I please and so it should be possible to design a programming language where some subset of the programs computes exactly some arbitrary subset of the computable functions, as long as the cardinality matches.

For some sets of functions, that works; not for others. But a new programming language is a new numbering of some programs, and that is not what Rice's theorem talks about.

For the purpose of Rice's theorem, we consider only Gödel enumerations of all partial recursive functions, and then it only states something about index sets, that is sets of all indices in that enumeration of functions in the given set.

That does not cover all sets of indices; and that's good, because there certainly are plenty of decidable properties of programs. See also here.

Raphael
  • 73,212
  • 30
  • 182
  • 400
2

Not every enumeration of programs is "acceptable", since not every enumeration would allow you to effectively compute the function associated with the program from the index of the program. In other words, you would not have universal machines (utm property). The second property that is usually required to "accept" the enumeration is the smn property: you need to be able to compute the index of program instances in a uniform and effective way.

It is possible to prove (Roger's equivalence theorem) that any pair of enumerations enjoying utm and smn are recursively isomorphic, that is to say that you have an effective way to translate programs beteween the two enumerations. This makes your theory enumeration-independent.

This is already enough to stress the relevance of utm and smn, the two basic theorems of the "abstract" approach to computability.

Roger's theorem is presented as an exercise (sic!) in his book Theory of Recursive functions and effective computability (exercise 2-10, pag 41). But the proof is not very hard, indeed.

Andrea Asperti
  • 504
  • 4
  • 10
1

I found this interesting paper by Udi Boker and Nachum Dershowitz which adresses the problem I had, among other things. In the introduction, they state that (emphasis mine)

What does one mean by saying that “$f$ is computable”? One most likely means that there is a Turing machine $M$, such that $M$ computes $f$, using some string representation of the domain $D$. But what are the allowed string representations? Obviously, allowing an arbitrary representation (any injection from $D$ to $\Sigma^*$) is problematic – it will make any decision function “computable”. For example, by permuting the domain of machine codes, the halting function can morph into the simple parity function [...]

and further

Another approach is to allow only “natural” or “effective” representations. However, in the context of defining computability, one is obliged to resort to a vague and undefined notion of “naturalness” or of “effectiveness”, thereby defeating the very purpose of characterizing computability.

which explains what babou referred to as "computable semantics". The paper also contains this quote from Michael Rescorla:

I will suggest that purported conceptual analyses involving Church’s thesis generate a subtle yet ineliminable circularity: they characterize the intuitive notion of computability by invoking the intuitive notion of computability [...] We endow the syntax with a primitive semantics. I submit that [...] we must demand that the semantic correlation between syntactic entities and non-syntactic entities itself be computable. But then the proposed analysis does not illuminate computability non-circularly.

So according to the authors, the common formal definition of a computable function relies on the informal intuition on what computability means, which explains what puzzled me about gödel numberings.

Stefan Lutz
  • 545
  • 5
  • 14