Assignment 5 - Solutions
Question 1 (5pt)
For the following program, if the program satises its specication for partial correctness, use program correctness techniques to show it is correct. If the program does not satisfy its specication,
provide a count
CS245 Assignment 1
Solutions
Question 1 (10pt)
1. p - I will go to school, q - I feel like sleeping
(p q)
2. p - Waterloo will win the football championship, q - Waterloo might win the hockey
(p) q)
or
p - Waterloo will win the football championship, q -
Assignment 3
Solutions
Question 1 (16pt)
Using the following predicate symbols and function symbols, translate the following sentences in
the language of predicate calculus.
The universe of discourse is the set of all people, exams and problems on exams.
Assignment 4 - Solutions
Question 1 (15pt)
Show the following for all well formed formulas and . Do not use soundness or completeness.
1. for every variable x not free in (that is, x F V (), |= x.,
2. |= x. in general,
3. if |= , then |= (x.) (x.),
Soluti
CS 245 Spring 2014
Assignment 1
Due Thursday, May 22, by 1:00pm,
in the drop box near MC 4065
Surname:
Circle time/tutorial for return
of your paper, or do not return:
Tue: 02:30 (TUT101)
01:30 (TUT102)
03:30 (TUT104)
Personal name:
ID #:
Wed:
08:30 (TUT1
CS 245 Spring 2014
Assignment 2
Due Thursday, June 5, by 1:00pm,
in the drop box near MC 4065
Surname:
Circle time/tutorial for return
of your paper, or do not return:
Tue: 02:30 (TUT101)
01:30 (TUT102)
03:30 (TUT104)
Personal name:
ID #:
Wed:
08:30 (TUT1
CS 245 Spring 2014
Assignment 5
Due Thursday, July 31, by 1:00pm,
in the drop box near MC 4065
Surname:
Circle oce hours in MC4065
for return of your paper, or do
not return:
Personal name:
Tue(Aug 5):
Wed(Aug 6):
Thu(Aug 7):
Fri(Aug 8):
2:00 - 3:00
11:00
CS 245 Spring 2014
Assignment 3
Due Thursday, July 3, by 1:00pm,
in the drop box near MC 4065
Surname:
Circle time/tutorial for return
of your paper, or do not return:
Tue: 02:30 (TUT101)
01:30 (TUT102)
03:30 (TUT104)
Personal name:
ID #:
Wed:
08:30 (TUT1
CS 245 Spring 2014
Assignment 4
Due Thursday, July 17, by 1:00pm,
in the drop box near MC 4065
Surname:
Circle time/tutorial for return
of your paper, or do not return:
Tue: 02:30 (TUT101)
01:30 (TUT102)
03:30 (TUT104)
Personal name:
ID #:
Wed:
08:30 (TUT
Assignment 2
Solutions
Question 1 (10pt)
Let be a set of formulas in LP . Prove that for every formula , |= if and only if cfw_ is
not satisable.
Solution:
Let |= , i.e. for any truth valuation t for which t = 1 implies t = 1. For the same truth
valuation