CS607 Assignment no 02

Questions No. 01 10Marks
Convert the following expression to conjunctive normal form, write all the equivalence rules that you will use to convert.
a) ¬ ((¬p→¬q) ∧¬r)
b) (p → q)→(¬r ∧ q)

Solution:

a) ¬((¬p→¬q)∧¬r)
= ¬ ((¬¬p v ¬q) ˄ ¬r)
=¬ ((p ˅ ¬q) ˄ ¬r) - Double negation
=¬ (p ᴠ ¬q) ᴠ ¬¬r       - De Morgan’s law
             =¬ (p ᴠ ¬q) ᴠ r                       - Double negation
= (¬p ˄ ¬¬q) ᴠ r                    - De Morgan’s law
= (¬p ˄ q) ᴠ r                         - Double negation
= (¬p ᴠ r) ˄ (q ᴠ r)                - Distributive

b) (p → q)→(¬r ∧ q)
= ¬ (p → q) ᴠ (¬r ˄ q)              
= ¬ (¬p ᴠ q) ᴠ (¬r ˄ q)              - Definition
= (¬¬ p ˄ ¬q) ᴠ (¬r ˄ q)           - De Morgan’s law
= (p ˄ ¬q) ᴠ (¬r ˄ q)                 - Double negation
= (p ᴠ (¬r ˄ q)) ˄ (¬q ᴠ (¬r ˄ q))         - Distributive
= (p ᴠ ¬r) ˄ (p ˅ q) ˄(¬q ᴠ ¬r) ˄ (¬q ᴠ  q)        - Distributive
= (p ᴠ ¬r) ˄ (p ˅ q) ˄(¬q ᴠ ¬r) ˄ T              -Negation
= (p ᴠ ¬r) ˄ (p ˅ q) ˄(¬q ᴠ ¬r)                    - Identity


Question No. 2     
Using deftemplate add a function with the name “person” with slots name, age, degree, and GPA. Then add the fact of that person with your details.
Also, write a rule with the name “is-student-passed” where you will set a condition on CGPA, if CGPA will be 3.5 or 3.7 then the student will be passed. Write the code for this rule and run this rule.
Take screenshots of your CLIPS IDE window. If any student will send code on word or pdf file marks will be ZERO.

Solution:

 


                                


Comments

Popular posts from this blog

MGMT 627 Assignment Solution Idea

MGT501 - Human Resource Management Assignment No.1 Fall 2020

CS101 Assignment no 2