I've been using the following data structure for the representation of propositional logic in Haskell:
data Prop
= Pred String
| Not Prop
| And Prop Prop
| Or Prop Prop
| Impl Prop Prop
| Equiv Prop Prop
deriving (Eq, Ord)
Any comments on this structure are welcome.
However, now I want to extend my algoritms to handle FOL - predicate logic. What would be a good way of representing FOL in Haskell?
I've seen versions that are - pretty much - an extension of the above, and versions that are based on more classic context-free grammars. Is there any literature on this, that could be recommended?