Write code that will output a logically equivalent clause
or clauses, given a sentence of the form M --> N, where M
is a pure conjunction or disjunction and N is also a pure conjunction
or disjunction. The output in CNF should be equivalent to M --> N.
There are 4 cases like the ones below:
(1) (a AND b AND c) --> (m OR n)
(2) (a AND b AND c) --> (m AND n)
(3) (a OR b OR c) --> (m OR n)
(4) (a OR b OR c) --> (m AND n)
First your code should check which case does the input belong to
and do the right thing. You can write 4 auxiliary functions for these
4 cases.
Can I get some help with this? Can someone point me in the right
direction? Pseudocode will help
·············@gmail.com writes:
> Write code that will output a logically equivalent clause
> or clauses, given a sentence of the form M --> N, where M
> is a pure conjunction or disjunction and N is also a pure conjunction
> or disjunction. The output in CNF should be equivalent to M --> N.
>
> There are 4 cases like the ones below:
>
> (1) (a AND b AND c) --> (m OR n)
> (2) (a AND b AND c) --> (m AND n)
> (3) (a OR b OR c) --> (m OR n)
> (4) (a OR b OR c) --> (m AND n)
>
> First your code should check which case does the input belong to
> and do the right thing. You can write 4 auxiliary functions for these
> 4 cases.
>
> Can I get some help with this? Can someone point me in the right
> direction? Pseudocode will help
You have two problems.
1)What should the code actually do?
2)How do you code it?
You must solve 1 first. Handcrank some small examples eg
turn a --> b into conjuctive normal form, and work up
(a and b) --> c, a --> (b or c)
Coding might turn out to be the easy part :-)
Alan Crowe
Edinburgh
Scotland