NewsCrawler.org

Why writing correct software is hard, and why math alone won't help

Computer Programs
Hilbert's tomb
The Church-Turing Thesis
Alternating Bit Protocol (ProB)
Image: pron.github.io

The essay is an extended version of a talk its author gave at the Curry On conference, and it asks why writing correct programs is hard. The author collects in one place results from computability theory and complexity theory on the essential difficulty of producing correct software. The motivation was online claims that correctness is easy to achieve with the right tools, while the author argues that correctness has a significant cost that cannot be avoided.

The text starts from David Hilbert's program to formalize all of mathematics. Kurt Gödel's incompleteness results demolished its first two pillars, and in 1936 Church and Turing proved the halting theorem[1], which states that no algorithm can decide whether a given program ever terminates. Related results follow: no program can decide whether another program ever reaches a given state, and Rice's theorem[2] states that no algorithm can decide any non-trivial property of the partial functions programs compute, such as whether a program's output is always the square of its input.

The author considers the most interesting corollary of the halting theorem to be the Busy Beaver theorem[3]. It concerns the function f(n), the maximum number of steps a halting Turing machine[4] with n control states may take before halting, and the text proves that this function is non-computable. The author presents it as a quantitative measure of how hard it is to analyze programs.

Read the original pron.github.ioDiscussion

Discussion

Commenters mostly argue that correctness must first be defined, since a formal specification can itself be wrong and is not worth writing for most software. Some say the theorems matter little for real-world programs, and others accuse the author of misstating Rice's theorem and Gödel's result.

Sources

  • Ron Pressler

    Writing correct software is hard and math alone won’t help us (2016)

    183 comments

  • KRGeekNews KO

    올바른 소프트웨어를 작성하기 어려운 이유

    1 point1 comment

Published: First seen: Читать по-русски

Open as a page