Question
write a Prolog program that transforms a given propositional formula into conjunc- tive normal form. In this, follow the example program given in Section 2.9
write a Prolog program that transforms a given propositional formula into conjunc- tive normal form. In this, follow the example program given in Section 2.9 of Fittings book, which shows a program to transform a propositional formula into disjunctive normal form. In your program, you need to define the unary operator neg and the binary operators and, or, imp, revimp, uparrow, downarrow, notimp, and notrevimp, which denote the eight aforemen- tioned primary connectives (see Table 2.1 in the book). Also reuse the predicates conjunctive/1, disjunctive/1 that recognise - and -formulas, and the predicates components/3 and component/2 that split formulas into their components (see Table 2.2 in the book). The interface of this part of the program should be a predicate clauseform(X,Y), where Y is the conjunctive normal form of the formula X. For example, for the query ?- clauseform(a imp b, Y)., the result should be Y=[[neg a, b]], and for the query ?- clauseform(neg(a uparrow b), Y), the result should be Y=[[a],[b]].
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