Set Theory & Logic Codexery

Rice's theorem

All non-trivial semantic properties of programs are undecidable.

Rice's theorem

Wikipedia / Wikimedia Commons

Rice's theorem is a fundamental result in computability theory, named after Henry Gordon Rice, who proved it in his 1951 doctoral dissertation at Syracuse University. The theorem states that all non-trivial semantic properties of programs are undecidable, meaning no algorithm can decide whether a given program exhibits a particular behavior unless that behavior is either true for all programs or false for all programs.

field
Computability theory
known_for
Rice's theorem
theorem_proved_in
1951
institution
Syracuse University

Lore & Background

Rice's theorem generalizes the undecidability of the halting problem. It asserts that it is impossible to decide a property of programs that depends only on the semantics (the program's behavior when run) and not on the syntax (how the program is written), unless the property is trivial—true of all programs or false of all programs. The theorem has far-reaching implications on the feasibility of static analysis of programs, implying that it is impossible to implement a tool that checks whether any given program is correct or even executes without error.

Reader's Guide

Rice's theorem establishes a theoretical bound on which types of static analysis can be performed automatically. It implies that one cannot algorithmically verify the absence of bugs in arbitrary programs, but this does not prevent certain types of bug prevention. For example, statically typed programming languages feature type systems that statically prevent type errors by inspecting source code syntax, not merely the hypothetical semantics. In software verification, one can require programs to be annotated with extra information (like type annotations) or written in restricted forms to make verification possible. Other workarounds include abstract interpretation, which catches many bugs without being complete, and model checking, which applies to finite-state programs but not Turing-complete languages. The theorem thus guides practical approaches to program analysis by clarifying what is theoretically impossible.

Did You Know?

More in Set Theory & Logic 1-19

Spotted an error? Know more?

This is a living reference — every entry is fact-audited, and reader corrections feed straight into our audit queue. Suggest an edit · See this site's audit record

Comments

Loading…
Open in the interactive codex →