Functional Problem Solving (CSC 151 2015S) : EBoards

CSC151.02 2015S, Class 15: Boolean Values and Predicate Procedures


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support (Afternoon Section)

Recommended, But no EC

Questions

Boolean values

Thinking About Boolean Functions

An Exercise

Create the implies function

              input/a
    =>     True    False
i
n  True    True    False
p
u  False   True    True
t
/
b

Solutions ...

List all the cases in which => holdsa

(define => (lambda (a b) (or (and a b) (and (not a) b) (and (not a) (not b)))))

A good strategy: Gives you long answers, but gives you an answer

Simplifying the answer: If b holds, we don't care about a

    (define =>
      (lambda (a b)
        (or b (and (not a) (not b)))))

Another approach: Just eliminate the falses

    (define =>
      (lambda (a b)
        (not (and a (not b)))))

Will we know whnat to do in the other cases?

New Question: How many different Boolean functions are there?