Hillel Wayne wrote Logic for Programmers because there were no good resources on logic aimed at programmers. With the book out, the remaining gap was the lack of good free ones — so he published its second chapter as a blog post. It covers predicates, implication, sets, and set quantifiers, using notation you can type on a normal keyboard.

The organising claim is that predicates are the bridge between how we describe systems in English and how we encode them in a language. Most of the examples are problems a developer has already met: a hardware requirement, a pull-request merge rule, a set of images with fields.

  • The worked example is a vendor claim that reads fine in English — “enough RAM and a fast CPU or a good graphics card.” Written as a predicate it becomes RAM && CPU || GPU, which has two readings that disagree on exactly the inputs where the buyer lacks RAM but has a GPU. A truth table makes the disagreement visible
  • Implication is not new machinery: P => Q is just !P || Q, meaning “check Q only if P.” It also expresses that one statement is stronger than another — crashing on input 0 implies a bug exists — and it composes transitively
  • Sets supply the types. c in Computer stops the predicate from being satisfied by a poodle with a good GPU. Subsets are the mathematical reading of subtyping: rectangle is a subtype of shape because the set of rectangles is a subset of the set of shapes
  • Quantifiers are some (at least one) and all (every). The PR-review rule is where it pays off: “all reviewers must approve” written naively demands approval from developers who never reviewed anything. The fix is implication — all d: ReviewedBy(pr, d) => Approved(pr, d), meaning each developer either approved it or never saw it
  • Vacuous truth is the edge case that forces both quantifiers. If nobody reviewed a pull request, “all reviewers approved” is true; “someone reviewed” is false. Over an empty set, all is always true and some is always false
  • He generalises to the ability-guarantee tradeoff: the more a language, format or tool can do, the fewer guarantees it gives. ASCII guarantees one byte per character, Unicode does not. Read-only file access guarantees a buggy program cannot overwrite your data, full access does not
  • Rewrite rules close it out as the simplification algebra — De Morgan, contrapositive, quantifier duality — with the distribution rules only holding for some-and-or, all-and-and. Even niche rules, he notes, are useful for refactoring code

It is a teaching chapter with exercises, so read it as one. The practical takeaway is narrow and real: writing requirements as predicates surfaces the disagreements that English hides, and the whole operator set fits on a keyboard.