{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

3401_W12_assignment1_sol

# 3401_W12_assignment1_sol - Page:1 SC/CSE34013. 1(8marks) A...

This preview shows pages 1–3. Sign up to view the full content.

York University CSE 3401 Winter 2012 Page: 1 York University Department of Computer Science and Engineering SC/CSE 3401 3.00 – Functional and Logic Programming Solutions to assignment 1 1) (8 marks) Consider the following formulae: ) ( : : ) ( : r p q C r q B r q p A a) Using truth tables, which of the above formulae is satisfiable? b) Which of the above formulae is a contradiction? c) Which of the following sets are satisfiable? i. {A, B} ii. {B, C} iii. {A, B, C} d) Which of the above sets i iii are inconsistent? Explain your answers. Answer. Showing state values true as 1 and false as 0, the truth tables for formula A, B, and C is: p q r r q A: ) ( r q p B: r q q r p C: ) ( r p q 1 0 0 0 0 1 1 1 0 0 2 0 0 1 1 1 0 1 1 1 3 0 1 0 1 1 0 0 0 0 4 0 1 1 1 1 1 0 1 0 5 1 0 0 0 0 1 1 1 1 6 1 0 1 1 1 0 1 1 1 7 1 1 0 1 1 0 0 1 0 8 1 1 1 1 1 1 0 1 0 a) All 3 formulae, A, B, and C, are satisfiable since there is at least one row which makes them true. For example row 1 shows a state which makes formula A true. Row 4 is a possible state that can make formula B true. Row 5 is a possible state than can make formula C true. b) None of the 3 formula A, B, or C is a contradiction, since all of them are satisfiable. c) For the sets: i. {A,B} is satisfiable. There exists a state (for example row 1) that makes both formulae true. ii. {B, C} is satisfiable. There exists a state (row 5) that makes both formulae true. iii. {A, B, C} is not satisfiable. There is no state that can make all three formulae true.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document