Local Reasoning for Global Properties
The article discusses how local reasoning (examining individual components) can be used to verify global properties in complex systems, drawing on examples from programming languages and formal verification to illustrate the principles.
Background
- Laurie Tratt is a professor of programming language engineering at King's College London who writes a well-regarded technical blog.
- "Local reasoning" means understanding a piece of code in isolation without examining the entire program; "global properties" are system-wide guarantees (e.g. security, encapsulation, data integrity) that can be undermined by local changes.
- The post uses the **Expression Problem** (a classic software design dilemma: extending a program with new data types vs. new operations without modifying existing code) as a running example.
- Tratt argues that in practice, codebases are large and nobody holds the full program in their head, so languages/designs that let you reason locally are critical; he contrasts this with approaches that require global knowledge (e.g. many OOP or pattern-matching designs).
- The post is aimed at experienced programmers familiar with type systems, design patterns, and the trade-offs between functional and object-oriented styles.