Question
[Haskell] Translating Logical Statements Translate the following statements into a logical statement using (forall, exists, and, or, imp, not). Then translate the statement into a
[Haskell] Translating Logical Statements
Translate the following statements into a logical statement using (forall, exists, and, or, imp, not). Then translate the statement into a Haskell variable which can be determined if true or not based on Q.
Given a set of numbers Q = {1, 2, 3, 4, 5, 6, 7, 8} ** will be used for all statements **
Example:
"Every number that's greater than 2 is greater than 1"
Logical Statement: forall n, (n > 2) imp (n > 1)
var = and [(n > 2) <= (n > 1) | n <- Q] ** each var should either return true or false when using Haskell interpreter **
1.) Every number is either greater than 1 or less than 2
Logical Statement:
var =
2.) Every two numbers are comparable with <= (i.e., either one is <=
-- the other or vice-versa)
Logical Statement:
var =
3.) There is an odd number greater than 4
Logical Statement:
var =
4.) There are two odd numbers that add up to 10
Logical Statement:
var =
5.) For every even number, there is a greater odd number
Logical Statement:
var =
6.)There are two odd numbers that add up to 6
Logical Statement:
var =
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started