Scala 3, but I have trust issues
summary
Implements a mirror function for a binary tree using a Scala 3 enum, verifies it with ad‑hoc main checks, handwritten unit tests, and property tests using ScalaCheck generators (default 100 random cases), then ported the function to Agda proof where the double-invert property is proven but requires explicit pattern matches and a congruence lemma to complete the proof. Reports what works (implementation, tests, formal proof) and practical limits: generator work, finite sampling, and manual proof effort.
AI-written summary · about
chapters (17)
- 0:00Introduction and background
- 1:03Problem demonstration with trees
- 3:11Modeling tree inversion in Scala 3
- 4:36Manual testing limitations
- 6:00Unit testing approach
- 8:52Introducing property testing
- 10:57Property testing strategies
- 15:57Transition to proof assistants
- 17:02Choosing Agda for proofs
- 18:10Translating Scala to Agda
- 19:34Program verification in Agda
- 23:29Type-level unit tests in Agda
- 24:13Proving code properties
- 27:05Pen-and-paper proofs
- 30:57Trust exercises and therapy
- 32:00Revisiting the original problem
- 32:41Key takeaways and conclusions
