# CS607 Assignment 2 Solution and Discussion

• Assignment No. 02
Semester: Fall 2020
CS607: Artificial Intelligence
Total Marks: 20

Due Date:16-12-20

Instructions
It should be clear that your assignment will not get any credit if:
 The assignment is submitted after due date.
 The submitted assignment does not open or file is corrupt.
 Solution is copied from any other source.
Objective
The objective of this assignment is to;
 To learn creating graph from information.
 To learn how to convert the expression to conjunctive normal form.
Assignment

Question No. 1 Marks 10

Convert the following expression to conjunctive normal form, write all the equivalence rules that you will use to convert.

Question No. 2 Marks 10

Using deftemplate add a function with name “person” with slots name, age, degree and gpa. Then add fact of that person with your details.
Also write a rule with name “is-student-passed” where you will set condition on cgpa, if cgpa will be 3.5 or 3.7 then 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.

• Question No. 2 Marks 10
Using deftemplate add a function with name “person” with slots name, age, degree and gpa. Then add fact of that person with your details.
Also write a rule with name “is-student-passed” where you will set condition on cgpa, if cgpa will be 3.5 or 3.7 then 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.   • Question No. 1 Marks 10
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)

(a)
~((~p -> ~q) ∧ ~r) ≡ ~((~~p v ~q) ∧ ~r)         [definition]
≡ ~((p v ~q) ∧ ~r)                  [double negation]
≡ ~(p v ~q) ∧ ~~r                  [DeMorgan’s]
≡ ~(p v ~q) v r                         [double negation]
≡ (~p ∧ ~~q) v r                      [DeMorgan’s]
≡ (~p ∧ q) v r                            [double negation]
≡ (~p v r) ∧ (q v r)                   [distributive]

(b)
(p -> q) -> (~r ∧ q) ≡ ~(p -> q) v (~r ∧ q)     [definition]
≡ ~(~p v q) v (~r ∧ q)     [definition]
≡ (~~p ∧  q) v (~r ∧ q)    [DeMorgan’s]
≡ (p ∧ ~q) v (~r ∧ q)       [double negation]
≡ (~p v q) ∧ (r v ~q)       [complementation]

``````  2

3

2

1

1

1

23
• ## SOLVEDCS607 Assignment 2 Solution and Discussion CS607 - Artificial Intelligence • cs607 assignment 2 solution discussion fall 2019 • • zareen

5  | |