C SC 322 Midterm Review Materials
Propositional Logic
Know the operator precedence rules and the order of association.
Given a formula, know how to construct its truth table.
Example: Assignment 1,
SOLUTIONS 4
1. a) y represents the position of the leftmost 0.
b) The following answers are all correct:
x represents the position of the leftmost 1 where x > y
x represents the position of the left
SOLUTIONS 3
1. Here is one possible solution
a) xy (s(x) s(y ) (q (x, y ) r(x, y )
b) xy (s(x) s(y ) (q (x, y ) r(x, y ) x(s(x) y (s(y ) q (x, y ).
2. Here is one possible set of solutions
a) I = (Z+
SOLUTIONS 1
1. After applying rules (a)-(c) we have a three way tie with Chile, Morocco, and Turkey. According to the
regulations we need to look at the games played between those three teams to break
SOLUTIONS 2
Answers to the BONUS questions are available by request via email.
1. Code and output appear below.
flip(0,1).
% part i)
flip(1,0).
all0([]). all0([H|T]) :H = 0,
all0(T).
has0([H|T]) :( H=
C SC 322 Final Exam Review Materials
Refer to the Midterm Review Materials page for the testable material from the
of the material on the
nal exam will be from the
rst half of the course. Approximatel