-- Generators for exercise 2 and 4 - By Michael {
formNProps :: Int -> Int -> Gen Form
formNProps maxProp 0 = liftM Prop (choose (1, maxProp))
formNProps maxProp n | n > 0 = oneof [liftM Prop (choose (1, maxProp)), liftM Neg subform,
liftM Cnj (vectorOf 2 subform), liftM Dsj (vectorOf 2 subform),
liftM2 Impl subform subform, liftM2 Equiv subform subform]
where subform = formNProps maxProp (n - 1)
You missed important test cases. Namely Dsj and Cnj with a list of variable length (the empty list included)
I have only looked at the quickCheck testing. The manually test random generation is difficult to follow, which all these cases.
Well done (=9)
You missed important test cases. Namely
DsjandCnjwith a list of variable length (the empty list included)I have only looked at the quickCheck testing. The manually test random generation is difficult to follow, which all these cases.
Well done (=9)