We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exerc. 2
-- Assignment 2 (30 minutes) testParse :: Form -> Bool testParse form = show (head $ parse $ show form) == show form
can be simplified in
testParse :: Form -> Bool testParse form = head $ parse $ show form) == form
Exerc. 4 -- Generator createCnj :: Form -> Form -> Form createCnj first second = Cnj [first, second] createDsj :: Form -> Form -> Form createDsj first second = Dsj [first, second] formGen :: Int -> Gen Form formGen n | n <= 0 = fmap Prop (choose (1,200)) | n > 5 = formGen 5 | otherwise = oneof [ fmap Neg (formGen (n - 1)), -- Negation liftM2 createDsj (formGen (n-1) ) (formGen (n-2)), -- Disjunctive liftM2 createCnj (formGen (n-1) ) (formGen (n-2)), -- Conjunctive liftM2 Impl (formGen (n - 1)) (formGen (n - 2)), -- Implication liftM2 Equiv (formGen (n - 1)) (formGen (n - 2))] -- Equivalence
too restricted. Cnj and Dsj with 0 or 1 arguments must be generated too.
Cnj
Dsj
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Exerc. 2
can be simplified in
too restricted.
Cnj
andDsj
with 0 or 1 arguments must be generated too.The text was updated successfully, but these errors were encountered: