Open BertLisser opened 7 years ago
arbitrarySizedForm :: Int -> Gen Form arbitrarySizedForm n | n <= 0 = do t <- arbitrary return (Prop t) | n > 0 = oneof [liftM Neg subForm, liftM Cnj subFormBracets, liftM Dsj subFormBracets, liftM2 Impl subForm subForm, liftM2 Equiv subForm subForm] where subForm = arbitrarySizedForm (n `div` 2) subFormBracets = listOf1 (arbitrarySizedForm (n `div` 4))
Better
arbitrarySizedForm :: Int -> Gen Form arbitrarySizedForm n | n <= 0 = do t <- arbitrary return (Prop t) | n > 0 = oneof [liftM Neg subForm, liftM Cnj subFormBracets, liftM Dsj subFormBracets, liftM2 Impl subForm subForm, liftM2 Equiv subForm subForm] where subForm = arbitrarySizedForm (n `div` 2) subFormBracets = listOf (arbitrarySizedForm (n `div` 4))
Empty list of arguments at Cnjand Dsj are allowed.
Cnj
Dsj
quickCheck (withMaxSuccess 10 prop_checkEquiv) quickCheck (withMaxSuccess 10 prop_checkCNF)
Better is
quickCheck (withMaxSize 5 prop_checkEquiv) quickCheck (withMaxSize 5 prop_checkCNF)
This generates more tests with smaller samples.
Well done! (=9)
Better
Empty list of arguments at
Cnj
andDsj
are allowed.Better is
This generates more tests with smaller samples.
Well done! (=9)