COMP 409
Homework 4 Solutions
Fall 2013
Problem 1
Recall the axioms and inference Rules of the Hilbert-Ackermann Deduction System:
Axiom 1: (p (q p)
Axiom 2: (p (q r) (p q ) (p r)
Modus Ponens: p,pq q
Substitution: [p]
The deduction for (p p) is: < 1
Homework 6 Sample Solutions
1.
Theorem 1. Satisability of existential equality formulas is NP-complete.
Proof. To show the NP-hardness, we show a reduction from propositional
satisability. Suppose we are given a propositional formula over the
propositions
COMP 409 - Assignment 1 Solutions
Fall 2013
1
Show that there are no formulas of length 2,3, or 6, but that
every other length is possible.
Let p, q and r be atomic propositions. Then p is a formula of length 1, (p)
is a formula of length 4, and (p q ) is
COMP 409
Fall 2013
Final Exam
Read these instructions carefully, twice!.
1. You may use: your textbook (Sch ning), your notes, material on the course web page.
o
2. You may not use: other books, other web sites, material from other people or other classes
COMP 409: Logic Homework 5
Note: The pages below refer to the text from the book by Enderton.
1. Exercises 1-6 on p. 78.
1. Translate into this language the English sentences listed below. If the English sentence is
ambiguous, you will need more than one
Lecture 10
September 27, 2012
1
Data Representation
Consider the problem of multiplying two polynomials (an xn +an1 xn1 +. . .+a0 )(bn xn +bn1 xn1 +
. . . + b0 ). The traditional method (i.e., multiplying the corresponding coecients for each index) takes
Lecture 9
September 25, 2012
1
Importance of SAT
Cook-Levin Theorem: SAT is NP-complete.
The reason why SAT is an important problem can be summarized as below:
1. A natural NP-Complete problem.
2. We can prove NP hardness of other problems by reducing SAT
Lecture 8
September 20 , 2012
1
Complexity Theory
We have seen that problems have varying hardness, but some problems have a
subproblem that is easily checkable. For example:
SAT (): Is a given formula satisable?
3-colorability: Is a given graph 3-color
COMP 409: Homework 2
Sample Solutions
Fall 2012
1
Propositional semantics
1. Implement a truth evaluator eval(, ), which evaluates whether a formula
holds for a truth assignment . Use the evaluator to answer the question.
The results are:
(I1 ) = (I1 ) =
COMP 409: Logic Homework Solutions
Fall 2013
1
NP-completeness
1. Reducing Exact Cover to SAT
To show that 3-cover is poly-reducible to SAT we need to dene a function f that
maps an instance (X, C ) of the Exact Cover problem to a propositional formula ,
Lecture 7
September 13, 2012
1
Satisability
1.1
Classication of Formulas
Remember the 2 classications of problems we have discussed in the past: Satisable and Valid. The Classication Problem is to determine whether a given
formula is valid and/or satisabl
Lecture 6
September 11, 2012
1
Review of Previous Material
1.1
Multiple Viewpoints of Semantics
Semantics is the relationship between formulas and truth values. Previously,
we gave three dierent but equivalent denitions for the formal semantics of
proposi
Lecture 5
September 6, 2012
1
1.1
Complexity Theory
Resource Consumption
Complexity theory, or more precisely, Computational Complexity theory, deals
with the resources required during some computation to solve a given problem.
The process of computing in
COMP 409
Assignment No. 1
Due date: Sept. 6, 2012
Note:
1. The submitted assignment needs to be typeset in LaTeX.
2. Teamwork: You are expected to complete this assignment in pairs. By signing your name
on the assignment you are asserting that the work su
COMP 409
Assignment No. 2
Due date: In class - Sept. 20, 2011
Note:
1. The submitted assignment needs to be typeset in LaTeX.
2. Teamwork: You are expected to complete this assignment in pairs. By signing your name
on the assignment you are asserting that
COMP 409 - Assignment 1 Solutions
Fall 2012
1
Show that there are no formulas of length 2,3, or 6, but that
every other length is possible.
Let p, q and r be atomic propositions. Then p is a formula of length 1, (p)
is a formula of length 4, and (p q ) is
Lecture 1
August 23, 2012
1
Logic in Computer Science
Historically logic developed within the domains of mathematics and philosophy,
but in this class we will concentrate on the application of logic in computer
science. Throughout the course we will make
Lecture 2
August 28, 2012
1
Review of Syntax
Our alphabet of symbols consists of:
PROP, a set of atomic propositions
, a unary connective, and cfw_, , , , a set of binary connectives.
( and ), left and right parenthesis.
Any string built from these sym
Lecture 3
August 30, 2012
1
Semantics of Propositional Logic
Every language has two aspects: syntax and semantics. While syntax deals
with the form or structure of the language, it is semantics that adds meaning to
the form. The words or expressions of th
Lecture 4
September 4, 2012
1
Lecture Overview
Recall the two levels of logic - syntax and semantics. While syntax deals with
the form or structure of the language, it is semantics that adds meaning to the
form.
There is a famous painting by the French pa
COMP 409
Logic in Computer Science
Fall 2012
http:/www.cs.rice.edu/vardi/comp409/
Background
Logic has been called the calculus of computer science. The argument is that logic plays
a fundamental role in computer science, similar to that played by calculu