I don't know anything about the Scala compiler. A few years ago I needed a CNF Converter and I ripped their Logic Module.
(performant CNF Converter are harder to find than SAT Solver)
Fabrice Le Fessant, Luc Maranget, Optimizing Pattern-Matching ICFP'2001 http://pauillac.inria.fr/~maranget/papers/opat/