HeadlinesBriefing favicon HeadlinesBriefing.com

Logic for Programmers by Hillel Wayne

Hacker News •
×

Logic for Programmers by Hillel Wayne is a 227-page, 50,000-word guide to using logic to design, verify, and reason about software. The DRM-free ebook includes PDF and EPUB formats, with a print version on Amazon. All code samples are on GitHub.

Written for intermediate-to-advanced programmers, the book requires no math background beyond basic Boolean operators. Early chapters cover practical techniques like simplifying conditionals and ensuring API compatibility; later chapters explore formal verification, temporal logic, and constraint solving. Chapters are independent, so readers can skip irrelevant topics.

The table of contents spans a crash course in logic, refactoring, property testing, contracts, formal verification with Dafny, database theory, decision tables, Alloy specification, TLA+ system design, SMT solving, and Prolog. Appendices cover notation and advanced logic.

A sample explanation shows why Python’s `all([]) == True`: it preserves the identity property of `&&`, just as empty sum is 0 and `any([])` is False.