I understand that there are generally-accepted algorithms for reducing a given boolean-logic expression to CNF or DNF. I've found a few websites about this sorta thing, but nothing that I can really use to build a Haskell program around it.
This isn't homework, nor am I asking for someone to write me code - I'm just looking for some kind of resource that I can follow to help me build my functions.
It seems to me that I have to define a datatype Exp
which deals with Or Exp Exp
, And Exp Exp
, etc., etc. and then build the standard 'rules' (De Morgan's, Modus Ponens, Modus Tollens, what have you) to use to repeatedly apply to to the Exp
until I reach a point where I'm not getting any further.
(As I've been playing around with Agda etc., I've tended to write everything in Haskell before translating it to Agda. So yeah, if you're more familiar with expressing anything in Agda, then I'm going to understand that too.)