Lecture 2 - CS 2603 Applied Logic for Hardware and Software
Proofs Propositions and Calculuses
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
Software and hardware development
a tool for careful reasoning
Logic
Lecture 1 - CS 2603 Applied Logic for Hardware and Software
Learning Goals Lesson Plans and Logic
Professor of Computer Science University of Oklahoma EL 119 Page@OU.edu
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahom
CHAPTER 2
ALGORITHMS
AND
RECURSIONS
Data Structures Featuring C+ Sridhar Radhakrishnan
1
Algorithms and Recursions
Algorithm consists of a set of finite steps satisfying the following
conditions:
Input: Number and type of input values must be made
clear
Solutions courtesy of Brian Schrock. 1. (True /\ P) \/ Q) True is a WFF; P and Q are WFFs, therefore True /\ P is a WFF. Since (True /\ P) and Q are WFFs, (True/\P)\/Q is a WFF.
TRUE T T T T P F F T T Q F T F T True /\ P F F T T (True /\ P) \/ Q) F T
Homework 9 Solutions
Problem 1) AB=BA AB {x | x A x B} {x | x B x A} BA Problem 2) (A B) C = A (B C) (A B) C {x | (x A x B) x C} {x | x A (x B x C)} A (B C) Problem 3) A B = A B' A B' {x | x A x B'} {x | x A (x U x
Homework 8 Solutions
Problem 1) Proof of Thm{maxL}: Case 1: x >= y: max x y = x {max>} >= x {2nd grade arith} Case2: x < y max x y = y {max<} >x {Case 2 assumption} >= x {2nd grade arith} Proof of Thm{maxR}: similar to proof of maxL Proof of Thm{maxM
CS 2603 Applied Logic for Hardware and Software
Review of Propositional Calculus / Digital Circuits Natural Deduction, and Equation-based Reasoning
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
Truth Tables for
Lecture 19 - CS 2603 Applied Logic for Hardware and Software
Computation Time and the Big O
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
Exponentiation the slow way
pow b n = if n = 0 then 1 else b(pow b (n
Lecture 18 - CS 2603 Applied Logic for Hardware and Software
Strong Induction
Induction at a Discount or Bringing in the Cavalry to Prove P(n)
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
deal - a way to split
Lecture 17 - CS 2603 Applied Logic for Hardware and Software
Circuit Minimization
using Karnaugh maps
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
Boolean function - a special kind of predicate F(a, b) - two-v
Lecture 16 - CS 2603 Applied Logic for Hardware and Software
A Little Bit of Set Theory
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
What Is a Set?
Axiomatic approach
Postulate the existence of
Empty set -- a
CS 2603 Applied Logic for Hardware and Software
Review
Predicate Calculus, Inductive Definitions, Mathematical Induction, Sets, and Circuit Minimization
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
Circuit Min
CS 2603 - APPLIED LOGIC FOR HARDWARE AND SOFTWARE
Midterm Examination 2 Instructions 1 Sit in assigned seats only. Permitted materials at your workplace: pens/pencils, erasers, exam, blue-books. All other materials, including extra paper, must
Equations of Boolean Algebra
page 1
Equations of Boolean Algebra
page 2
From Fig 2.1, Hall & O'Donnell, Discrete Math with a Computer, Springer, 2000
Additional equations: (a b) b = b (a b) b = b (a b) c = (a c) (b c)
{ absorption} { ab
CS 2603 - APPLIED LOGIC FOR HARDWARE AND SOFTWARE
Midterm Examination 1
Sit in assigned seats only. Permitted materials at your workplace: pens/pencils, erasers, exam, blue-books. All other materials, including extra paper, must be checked at
Lecture 15 - CS 2603 Applied Logic for Hardware and Software
Patterns of Computation
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
Every Haskell Entity Has a Type
x, y, z : Integer
- this is a type spec, not an
Lecture 14 - CS 2603 Applied Logic for Hardware and Software
Induction and Mechanical Logic
CS2603 Applied Logic for Hardware and Software Rex Page University of Oklahoma
1
re v ie w
Additive Property of Concatenation
proven by the principle of
CS 2603 Applied Logic for Hardware and Software Homework 8 FAQ Due Mar 25, nefore class (bring your paper to class, and turn it in there) Late Homework will be not accepted Warning! Some of these problems have long, tedious, involved solutions. Even
Applied Logic Homework 5 Due Tuesday, Feb 19, 2:59pm (in class) Late Homework not accepted FAQ Special Rules for this assignment - Read before proceeding with your proofs 1. Use equational reasoning to prove that the following equations are valid. 2.
Homework 5 Solutions Thanks to Sean Lavelle for providing these solutions. Skip to #: 1 - 2 - 3 - 4 - 5 - 6 - 7 import Stdm impSelf = thmEq (Imp A A) TRUE {- Problem 1 -} -deMorgansLawAnd: (not(a and b) = (not a) or (not b) thm1 = (Not(A `And` B) `th
Homework 3 Solutions
These valid, and nicely formatted, proofs are provided courtesy of Rebekah Leslie and Matt Griffin
import Stdm cp = check_proof {- Problem 1 -} hwThm1 = Theorem [P, Q, R] (P `And` (Q `And` R) proofThm1 = (Assume P, (Assume Q, Ass