[SOLVED] CS CS262 Logic and Verification test 2

$25

File Name: CS_CS262_Logic_and_Verification_test_2.zip
File Size: 357.96 KB

5/5 - (1 vote)

CS262 Logic and Verification test 2
UNIVERSITY OF WARWICK Class Test
Logic and Verification
Time allowed: 45 minutes Answer all questions.

Copyright By Assignmentchef assignmentchef

Write your answers into the provided boxes. Use additional white paper for inter- mediate calculations. These will be ignored by the marker.
Enter your University Registration Number (library card number) in the space below.
University Registration Number
Do not write below this line
8 8 8 14 12

1. Compute the truth table for the following Boolean function:
f (x, y, z) = ((x y) (x (z y))). [8]
x y z TTT TTF TFT TFF FTT FTF FFT FFF
2. Draw the parse tree for the function f from before. [8]
3. What is the conjunctive normal form of the function g(x, y, z) = (x y z) (xyz)(xyz)(xyz)(xyz)(xyz)? Hint: Consider the truth table of this function. [8]

4. Consider the following tableau proof for (x (y (z w))) (x y):
0. ((x(y(zw)))(xy)) 1. x(y(zw))
4. y(zw)
5. y 8. z w
7.y 9. z 12. w
10.x 13. x 11.y 14. y
Annotate this proof, by writing one line for each application of an expansion rule, in the correct order. In each line, write the name of the rule, the number of the tree node to which this rule applies, and the number(s) of the tree node(s) that the rule creates. An example of such a line would be
-expansion on 3 creates 7 and 12.
Step Rule i
iv v vi vii
5. Consider the following Prolog program:
g(c,d(e)).
f(X,Y):-X>=2, T is X-1, f(T,Z), Y is Z*X. What is the result of each of the following queries?
[7 2 = 14]
?- g(a,b).
?- g(X,d(e)).
?- g(c,d(Z)).
?- f(1,X).
?- f(1,X),X>3.
?- f(4,X).
[6 2 = 12]

CS: assignmentchef QQ: 1823890830 Email: [email protected]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS CS262 Logic and Verification test 2
$25