News for hackers. Stuff that matters.
Re:On Two Views of Computation in Computer Science by TelmoMenezes on Wednesday August 31, 2016 @04:30PM (#12401236)
Does a type exist such that it cannot be mapped to the set of natural numbers?
Re:On Two Views of Computation in Computer Science by tome on Wednesday August 31, 2016 @06:32PM (#12401973)
Sure, in Haskell 'IO ()' cannot be mapped to the set of natural numbers (within the language).

EDIT: In fact I'd guess any function type A -> B where A is infinite cannot be mapped to the naturals.

Re:On Two Views of Computation in Computer Science by catnaroek on Wednesday August 31, 2016 @04:33PM (#12401250)
You mean mapped one-to-one? Depends on your model of computation. For example, in the simply typed lambda calculus, equipped with a natural number type, as well as structural recursion on it (but not general recursion), `nat` and `nat -> nat` aren't isomorphic types.
Re:On Two Views of Computation in Computer Science by TelmoMenezes on Wednesday August 31, 2016 @06:01PM (#12401816)
Humm... But the set of Turing Machines is countably infinite, and a nat -> nat function is necessarily representable as a Turing Machine.
Re:On Two Views of Computation in Computer Science by catnaroek on Wednesday August 31, 2016 @07:27PM (#12402210)
Externally, in the metalanguage, you can count syntactically distinct terms, and, of course, the collection of terms that have type `nat -> nat` is countable.

Internally, in the lambda calculus itself, or a model of it, there are two caveats, however:

(0) Nothing guarantees that all internal inhabitants of a type are denotable by external pieces of syntax. For example, most real numbers are undefinable. (There are only countably many formulas over a finite alphabet, but uncountably many real numbers, ergo, most real numbers can't be “pinned down” using a formula. That doesn't prevent them from existing. The situation is exactly the same with a type like `nat -> nat`.)

(1) The right internal notion of equality isn't syntactic equality (which doesn't even make sense, for the reason stated above), but extensional equality.

If all of this sounds too strange, read more about model theory, Gödel's completeness theorem, and the Löwenheim-Skolem theorems.

Re:On Two Views of Computation in Computer Science by TelmoMenezes on Wednesday August 31, 2016 @09:08PM (#12402565)
Yes but the real number that cannot be pinned down using a formula can also not be pinned down using a computation, and we are talking of models of computation.
Re:On Two Views of Computation in Computer Science by catnaroek on Wednesday August 31, 2016 @10:35PM (#12402798)
> Yes but the real number that cannot be pinned down using a formula can also not be pinned down using a computation,

Undefinable real numbers exist, whether you can compute them or not.

> and we are talking of models of computation.

A theory of computation that rejects the existence of things that can't be computed is like a logic that rejects the existence of FALSE because it can't be proved. Where does the busy beaver function sit in your conceptual model?

Re:On Two Views of Computation in Computer Science by TelmoMenezes on Thursday September 01, 2016 @06:47AM (#12404261)
> Undefinable real numbers exist, whether you can compute them or not.

I agree with you, but as you probably know this is a deep ontological question. The meaning of something "existing" has been debated for many centuries, especially for cases such as this.

> A theory of computation that rejects the existence of things that can't be computed is like a logic that rejects the existence of FALSE because it can't be proved. Where does the busy beaver function sit in your conceptual model?

There is a difference between rejecting and classifying. I am not proposing a new computational model. Turing's model classifies the busy beaver function as non-computable. Correct?

I thought we were discussing Church-Turing. This assumes Turing Machines, and what they can compute. Of course you can break everything by assuming an imaginary machine that can compute functions that are not computable by Turing Machines...

Re:On Two Views of Computation in Computer Science by catnaroek on Thursday September 01, 2016 @07:49AM (#12404499)
> Turing's model classifies the busy beaver function as non-computable. Correct?

Yep.

> I thought we were discussing Church-Turing. This assumes Turing Machines, and what they can compute. Of course you can break everything by assuming an imaginary machine that can compute functions that are not computable by Turing Machines...

Turing never redefined the concept of “countable”, which belongs in set theory. If you had asked him what the cardinality is of the set of functions from the naturals to the naturals, he would've answered you “uncountable, of course”.

Re:On Two Views of Computation in Computer Science by itscomplex on Wednesday August 31, 2016 @09:44PM (#12402684)
It is not necessarily representable. By diagonalization, in fact, nat -> nat can be shown to be uncountably infinite. Intuitively, an example nat -> nat function that is uncomputable is ~Ld, the function that, given a natural index i into the diagonal of the table of Turing machines and their accepted strings, returns the opposite of whether machine i accepts string i. The output is then clearly equal to no Turing machine, since it differs in at least one position. In order to encode this function, an oracle is required. As such, nat -> nat uncountability can be shown to be central to proving Turing recognizability.
Re:On Two Views of Computation in Computer Science by TelmoMenezes on Thursday September 01, 2016 @06:38AM (#12404210)
Ok, that's a good point, but it is also true that functions requiring an oracle cannot also be represented in any Turing-complete programming language, right?

This seems trivial to prove: any function representable in any given programming language maps to a finite string of characters, and finite strings of characters maps to natural numbers.