Reminder: We dene H semantics operations and as follows a b = maxcfw_a, b, a b = mincfw_a, b.
The Truth Tables for Implication and Negation are: H-Implication F T F T F F T T T T T T
H Negation F T F T F
QUESTION 1 is such that
Practice Midterm 2 SOLUTIONS
Remark This problem is taken straight from the BOOK and your exercises solutions! I write the
solution to spare your time!
Let S = (Lcfw_, , A1, A2, A3, M P ) be a proof system with the following
Remark This question is designed to check if you understand the notion of completeness, monotonicity, application of Deduction Theorem and use of some basic tautologies.
Consider any proof system S,
S = (L
Finite Automata and Regular Expressions (20 points)
(a) (10 points) Draw a 4-state DFA over the alphabet = cfw_a, b that accepts the language
consisting of strings with an even number of a (this includes zero a), or an odd number of b.
Practice Midterm 1 SOLUTIONS
Write the following natural language statement:
One likes to play bridge, or from the fact that the weather is good we conclude
the following: one does not like to play bridge or one likes not to
CS 164 Programming Languages and Compilers Handout 21
1. Regular Expressions (20 points)
a Man 0 eratin s stems re uire user asswords conform to certain rules to reduce the odds
y p g y q p
that an attacker can guess a password. Consider the following rul
:= load 0(b)
:= load 0(d)
:= 2 * a
e := e + f
e := e + c
b := b + 4
d := d - 4
b = d
Chapters 10, 11, 12 Read and learn all examples and exercises in the chapters as well! QUESTION 1 Let GL be the Gentzen style proof system for classical logic dened in chapter 11. Prove, by constructing a proper decomposition tree that
EXERCISE 11 SOLUTIONS
Chapters 10, 11, 12 Read and learn all examples and exercises in the chapters as well! QUESTION 1 Use the (complete) proof system GL from chapter 11 to prove that |= (a b) (a b). Solution By completeness theorem for GL we have
QUESTION 1 Give a denition and an example of a default reasoning. Default reasoning is a reasoning in which it is allowed to draw plausible inferences from less-thenconclusive evidence in the absence of information to the contr
Local Optimizations (20 points)
All operations in this question are on integer values. You may ignore arithmetic overow issues.
a) Apply common sub-expression elimination to the basic block below and write the nal version
of the changed instructions in
5 points 1. The following five functions
< a 12,
are plotted at right.
Label each function in the graph.
: ax *P
rzfl L>fh1s "rt 'c4 o"fu
a-t-t f-Lu q- ^Ytq,
o'da-*' f^-tfe' fhe^,! t so : e