Computer Science 251

Discrete Structures II

this time,  it’s logical

 

INSTRUCTOR: Nathan Segerlind

EMAIL:  nsegerli@cs.pdx.edu

DAYS: Tuesdays and Thursdays

TIME:  10-11:50

PLACE:  SEH 108

OFFICE: FAB 120-07

OFFICE HOURS:  Tuesdays and Thursdays,  1:00pm to 2:00 pm, or by appointment

WEB SITE:  www.cs.pdx.edu/~nsegerli/cs251.html

 

TEXTBOOK:  Discrete Structures, Logic and Computability, by James L. Hein. Available at the PSU bookstore.

 

LAB BOOK:  Prolog Experiments in Discrete Mathematics, Logic, and Computability, by James L. Hein. Available at Smart Copies, or on-line here.

 

REVIEW SESSION:   Saturday 7 June 2pm to 4pm.  Fourth Avenue Building Room 150.  You have to use the Harrison Street entrance.  Bring your  questions.

 

MAJOR ANNOUNCEMENT:   Class will be canceled on Thursday 22 May.  I could not get a sub,  sorry.  The lecture will be made up, probably as a review session before the final.  There are two effects from this:  Homework 4 is due on Tuesday 27 May.  Midterm 2 is now on Thursday 29 May. 


SCHEDULE FOR EXAMINATIONS AND LAB BOOKS:

 The first midterm:    This will cover propositional logic:  Well-formed formulas,  tautologies and contingencies, proofs by substitution, Quine’s method, and formal proofs. Knowledge of the deduction theorem, soundness and completeness (what they say and why they matter).  Essentially, Chapter 6 of the Hein Book.     SOLUTIONS FOR MIDTERM 1.

The second midterm:  Thursday 29 May. The second midterm covers predicate logic,  that’s chapter 7.
 

Final Examination: The final exam is cumulative,  with an emphasis on material in Chapters 8, 9 and 10.

The first Prolog Lab:    Due on Thursday 1st May 2008, beginning of class.  PEDMLC: Sec2.5 Ex1,2,3, Sec3.1 Ex1,2,3, Sec4.1 Ex1,2,3,4,5

The second Prolog Lab:  Due on the day of the final exam, beginning of the exam period.  PEDMLC: Sec4.2 Ex1,2, Sec4.3 Ex1,3, Sec5.2 Ex1,2,3,4, Sec5.3 Ex5,6,7,8

 

ANNOUNCEMENTS

 

Welcome to CS 251!

There was a typographic error in earlier versions of this website:  The exercises for Homework Set One are from Hein’s text, Chapter 6 Section 2,  not from Chapter 4 Section 2. 

 


Graded Assignments: 

Assigned  April 3:     Hein 6.2, Exercises # 6, 7b, 8b, 9b, 10b, 11b, 12b, 9d   SOLUTIONS

Assigned April 15:   Hein 6.2 Exercises 11d 12f,  Hein 6.3 5bd 6bd   SOLUTIONS

Assigned May 1:  Hein 7.1 Exercises 11b, 12b, 16b  Hein 7.2 Exercises 1b, 3b, 4b  SOLUTIONS

Assigned May 15:  Hein 7.3  Exercises 1bdf, 3b, 6bd, 7bd.   SOLUTIONS

Assigned May 27:   due Thursday 5 June:  Hein 8.2 #3b, 4d, 8b, 10

Suggested Exercises:

Assigned  April 1:     Hein 6.2, Exercises # 1ac, 5, 9ace,  10aceg

Assigned  April 3:     Hein 6.2, Exercises # 7ace, 8aceg, 11ace, 12ace

Assigned  April 8:     Hein 6.3, Exercises # 1, 2, 3, 4, 5acegi, 6acegi, 7acegik

Assigned April 22:  Hein 7.1 Exercises # 3a, 4, 5ac, 7a, 8a, 9a, 11acde, 12aceg

Assigned May 1:  Hein 7.1 Exercises # 7a, 8a, 9a, 11acde, 16acegh,  Hein 7.2 Exercises # 1ace, 2ac, 3ac, 4ace

Assigned May 15:  Hein 7.3  Exercises 1ace, 2, 4, 6aceg, 7ace.

Assigned May 27:   Hein 8.2 # 1, 2ab, 3a, 4abc, 7, 8ac, 9, 11

Other Handouts:
Syllabus.

Prolog Lab Manual.

Material Covered to Date

April 1:   Motivating applications from artificial intelligence, planning, hardware and software verification, foundations of mathematics.  Propositional connectives and well-formed formulsas (henceforth "propositional formulas" or "Boolean formulas"). Example of a "selector".  Interpretation of formulas as Boolean functions.  Truth tables.  Tautologies, contradictions, contingencies and satisfiable formulas.  Propositional identities, in particular: DeMorgan's law and the distributive rule.

April 3:  Commonly used identities in propositional logic.  Proving tautologies by “rewriting” with known identities.  Proving tautologies by Quine’s method of reasoning by cases.  Disjunctive normal form and conjunctive normal form.  Converting a truth table into DNF and converting a truth table into CNF.

April 8:  Axioms and inference rules. Formal proofs of tautologies by the direct (conditional proof) and indirect (proof by contradiction) methods. Many examples.

April 10: A sample Frege system.  A discussion of why negation and implication form a complete set of connectives.  A proof of “A implies A” in the sample Frege system. Discussion of the deduction principle and its connection with the conditional proof method.  Proof of the deduction principle.  Example of the deduction principle transformation carried out on a sample proof.

April 15:   Soundness, and a proof that the class’s Frege system is sound (“induction on derivation length”).  Completeness and most of the proof that the Frege system is complete (“induction on the construction of the formula”).

April 17:  A discussion of the careful management of hypotheses used to prevent “unsafe” applications of the conditional proof and indirect proof methods.  Several examples.  A discussion of the CNF satisfiability problem, and an example of coding a planning problem (fox, chicken, grain crossing) as a CNF satisfiability problem.

April 22: Discussion of the midterm.  Introduction to predicate logic - it's more expressive than propositional logic.  First-order languages, terms, well-formed formulas.  Examples in arithmetic, set theory and relational databases.  Free and bound variable,  scoping rules for quantifiers and bound variables.

April 24:  The first midterm.

April 29:  Substituting a term for a free variable of a first-order formula.  Interpretations of a first-order language.  Evaluating a first-order formula in an interpretation.  Valid formulas,  satisfiable formulas. 

May 1:  Standard equivalences for first-order formulas (negation, distribution of universal quantifiers over ANDs, renaming bound variables, distribution of existential quantifiers over Ors, interchanging variable order for adjacent quantifiers of the same type).  IMPORTANT EXAMPLES OF MISAPPLICATIONS:  You cannot distribute a universal quantifier across an OR, nor can you distribute an existential quantifier across an AND.  You cannot switch variable order for two quantifiers that are separated by another quantifier of the opposite type.    Proofs of identities by “validity arguments”.

May 6:  Passing quantifiers over subformulas in which the bound variable does not appear freely.  Prenex normal forms.  The universal instantiation rule.

May 8:  Review of universal instantiation, especially the notion of "t can be freely substituted for x in A".  The proof that this rule is sound. First we reviewed interpretations, syntax versus semantics and adopted a more standard notation than that used by the book.  Then,  we did the big old induction-on-the-construction proofs that the universal instantiation rule is sound.

 
May 13:   More quantifier rules:  Universal generalization,  existential instantiation, existential generalization.  Examples of first-order proofs.

May 15:   Discussion of the first midterm.  Examples of first-order proofs.  A discussion of first-order theories,  and some discussion of motivations (foundations of mathematics,  program verification).  The first-order theory of equality.  A formal proof in arithmetic.

May 20:    A formal proof in arithmetic.  Hoare logic for assignments,  composition, the strengthening of preconditions and the weakening of postconditions.

May 22:  Class cancelled.

May 27:  More Hoare program logic:  Conditional statements,  while loops and loop invariants.  Discussion of the material to be on midterm 2.

June 3:  Discussion of automatic theorem proving.  Frame work of: conversion to clausal form,  application of the resolution rule with unification.   Details for resolution and conversion to clausal form performed.

June 5:  Discussion of a program correctness example using a while loop.  Unification and most general unifiers, the unification algorithm.