Logic in computer science

May 27, 2014 by Florian Aigner, Vienna University of Technology
Logic in computer science
A Turing machine built from Lego

All men are mortal. Socrates is a man. Therefore, Socrates is mortal. Logical arguments like this one have been studied since antiquity. In the last few decades, however, logic research has changed considerably: the computer sciences were born. The success of informatics would have been impossible without the groundwork provided by logicians – and, in turn, computer sciences keep posing new interesting questions, which can only be answered by formal logic. Informatics is not the modern-day successor of logic, both fields keep moving forward, hand in hand.

Calculating Logical Statements

Simple logical conclusions such as the famous syllogism about Socrates' mortality appear clear and simple to us. But is not just about formalizing the obvious. Just like in mathematics, logic allows us to construct arbitrarily complex equations, to do sophisticated calculations, to analyse the world.

Even before the first electronic calculating devices were built, research on the hypothetical possibilities of computers was done: in the 1930s, the mathematicians Alan Turing and Alonzo Church characterized the class of mathematical problems which can in principle be tackled. Turing put forward an intriguingly simple model for a calculating machine – the Turing machine: It moves on an infinitely long ribbon, reads numbers and changes it according to a given set of rules.

Such a machine can be built with mechanical gears or lego bricks. Although in practice such a machine is highly inefficient, one can show that in principle any conceivable computer calculation can be carried out by such a simple device. With the Turing machine it became possible to clearly define what "doing mathematical calculations" even means. Using this concept, Turing could show that some questions can never be answered by a computer: a computer program which reads other programs and then decides whether its calculations would ever come to a halt or go on forever is logically impossible.

Looking inward, looking outward

"Today, most of the research in logic is done by computer scientists, not by mathematicians", says Professor Helmut Veith from the Vienna University of Technology. Logic in has to fulfil several tasks. First of all, it is a tool with which can describe the world. Logic is used for databases or for creating artificial intelligence.

But logic does not only help a computer to view the world, it also offers the possibility of introspection: computer codes can check other computer codes and look for logical errors. "It is similar to the way we humans think", says Helmut Veith. "We think about the world around us, but we can also contemplate ourselves and our own mind."

Logic-based quality checks of computer codes (verification, model checking) play an important role for industry and the economy. When a user tests a program and finds that it works, this does not by all means guarantee that the program is free of errors. The crucial question is: does the code react correctly to any conceivable input, in any logically possible situation? This can only be determined by an automated program.

Such a reliable check is particularly important for security relevant code such as airplane controls. Logical checks are essential for the production of computer chips as well. Today, chips start out as a program, long before they are physically built. No human being could ever determine by hand whether the chip does indeed react correctly to any given situation. Computer programs carry out this task. With their logical checks, they ensure our safety.

Explore further: Study reveals details of logical circuits built using living slime molds

Related Stories

Kasparov versus Turing (w/ Video)

June 27, 2012

(Phys.org) -- For the first time in public, Mr. Kasparov played a match against Turing’s chess program live on stage at The University of Manchester’s Alan Turing Centenary Conference.

Mathematician sees artistic side to father of computer

February 23, 2012

This year a series of events around the world will celebrate the work of Alan Turing, the father of the modern computer, as the 100th anniversary of his birthday approaches on June 23. In a book chapter that will be published ...

Difficulty makes Candy Crush so addictive

March 13, 2014

It's been said that in a city, you're never more than two metres away from a rat. But it seems more likely that you're never more than two metres from someone playing the puzzle game Candy Crush Saga.

Recommended for you

Coffee-based colloids for direct solar absorption

March 22, 2019

Solar energy is one of the most promising resources to help reduce fossil fuel consumption and mitigate greenhouse gas emissions to power a sustainable future. Devices presently in use to convert solar energy into thermal ...

EPA adviser is promoting harmful ideas, scientists say

March 22, 2019

The Trump administration's reliance on industry-funded environmental specialists is again coming under fire, this time by researchers who say that Louis Anthony "Tony" Cox Jr., who leads a key Environmental Protection Agency ...


Please sign in to add a comment. Registration is free, and takes less than a minute. Read more

Click here to reset your password.
Sign in to get notified via email when new comments are made.