# What is the natural language of computers mathematics or logic? [closed]

I was reading about the history of computers where i came by machine code

A Machine code or machine language is a set of instructions executed directly by a computer's central processing unit (CPU). Each instruction performs a very specific task, such as a load, a jump, or an ALU operation on a unit of data in a CPU register or memory.

The computer here does logical operations like load or jump steps using the machine code.

A general-purpose device that can be programmed to carry out a set of arithmetic or logical operations automatically.

This means from the machine code the computer can perform logical or arithmetic operations, but which principle computers are based on the logical principle or the mathematical principle ?

What can be said also as the natural language of a computer ?

====

 both answers solved my problem.

====

• I don't think this question is answerable. It's like asking, "Is a car based on fuel or on wheels?" It's a false dichotomy to assume that it must be "based on" exactly one of these things and, even if it were based on exactly one, what difference would it make to anything? Oct 12 '15 at 11:15
• For my money, the Curry-Howard correspondence is a pretty good argument that lambda calculus is the most "natural" language, in the sense that unlike Java, any sufficiently advanced culture will probably discover it. Moreover, the connection to logic (Gentzen-style systems) and mathematics (category theory) is fairly direct. See Phil Wadler's talk for an introduction: youtube.com/watch?v=IOiZatlZtGU Oct 12 '15 at 11:22
• Actually it will make a big difference, suppose we have a machine based on mathematical principles where the input is just numbers, by somehow you can encode mathematical equations {like quadratic} or functions as numbers and if the encoding process is correct then the machine will show the answer of the encoded equation but if we said machines are based on logic then what kind of language would you encode the equation to ?
– ABD
Oct 12 '15 at 11:27
• BTW, I don't think there is any such thing as "a machine code". This is an error in the article. Oct 12 '15 at 13:46
• Logic is (a part of the) "mathematical language" Oct 12 '15 at 14:24

There is really no such thing as a natural language for computers. Natural language is a concept from linguistics, and pertains mostly to humans (and perhaps also to some animals).

The corresponding concept for computers is machine language or native code, which is what the computing core of the computer (the CPU) runs. Machine codes consists of various instructions, some of which perform arithmetic and logical operations. Others are in charge of control flow, of memory access, and so on.

Related to machine language is assembly code, which is a readable representation of machine code. While machine code consists of bytes, assembly code consists of textual symbols. (Assembly code also usually contains some features which make it a barebones programming language.)

• Ok i got your point, but if i was able to build a machine that encodes all the instructions {arthemitic or logical operations} to numbers and then the instructions are executed correctly by also using numbers, this would imply that mathematical principles were used in the whole process right? ==> "Check my comment up for information"
– ABD
Oct 12 '15 at 11:42
• No. It is completely meaningless to say that mathematical principles are used in any kind of process. It's an empty phrase. All computers are based on "mathematical principles", "physical principles", "chemical principles", "electrical engineering principles", and more. Oct 12 '15 at 11:49

(Digital) computers are based on logic. Mathematics can express more than logic can, but computers cannot express everything that mathematics does. For instance, mathematics is allowed to make claims such as axiom of choice, i.e. a claim that no matter whether the elements of a set are finite sets, infinite sets or uncountably infinite etc, there is a procedure to select all elements from those sets in some order.

Mathematicians just assume that that's true and move on to prove other theorems. Logicians shrug and silently point out that that's just not something you can prove using logic. In other words, mathematics may assume existence of some true facts in this world, which it isn't able to prove. Logic doesn't.

Digital computers "speak" logic in the sense that whatever algorithm you write, it must be constructible. Mathematics can live happily with functions it cannot construct. More so, computers are also limited in the sense of what functions they can compute, and that would be very imprecisely speaking equivalent to some predicate logic with limited notions of quantification and recursion. This is while mathematics has no problems accommodating functions like busy-beaver and other non-computable functions.

There was a movement in mathematics in the 60's when mathematicians tried to reduce it to only constructable proofs (aka constructivism), but most mathematicians today don't subscribe to this paradigm.

Bottom line: digital computers are a proper subset of logic, but it's hard to give a precise placement in the taxonomy of logics. Somewhere between predicate and first-order logics, with (probably) some extra-logical predicates.

• Intuitionism dates from the 20s or earlier. Oct 12 '15 at 20:49
• @YuvalFilmus of course. I probably should've said something like "it was close to be mainstream" (although it never was) in the 60's. Here's Yury Gurevich' recollection of his experience with constructivism research.microsoft.com/en-us/um/people/gurevich/Opera/123.pdf (around page 10) from that time. This may not be true of European or American mathematics of the time though... Oct 12 '15 at 22:45