Lisp Truth Oracle: A Curious Tale of Type Theory, Curry-Howard Isomorphism, and call/cc

2025-06-14

This post attempts to write a "truth oracle" in Lisp—a program that determines the truth or falsehood of arbitrary mathematical statements. The author introduces the Curry-Howard isomorphism, explaining how logical proofs correspond to expressions in typed functional programming. Using Racket's call/cc function (isomorphic to Peirce's law), an attempt is made to implement a program isomorphic to the law of the excluded middle. Unexpectedly, the oracle always returns false until attempting to access an impossible type value, revealing the differences between classical and constructive logic, and the non-standard control flow of call/cc. Finally, the author uses a metaphor of a "devil's bargain" to explain this strange behavior, showcasing the time-travel-like mechanism behind call/cc.

Development type theory