Download Recall... Venn Diagrams Disjunctive normal form Disjunctive normal

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of logic wikipedia , lookup

Model theory wikipedia , lookup

Mathematical logic wikipedia , lookup

Quantum logic wikipedia , lookup

Catuṣkoṭi wikipedia , lookup

Modal logic wikipedia , lookup

Law of thought wikipedia , lookup

List of first-order theories wikipedia , lookup

Propositional calculus wikipedia , lookup

Propositional formula wikipedia , lookup

Natural deduction wikipedia , lookup

Intuitionistic logic wikipedia , lookup

Interpretation (logic) wikipedia , lookup

Laws of Form wikipedia , lookup

Canonical normal form wikipedia , lookup

Transcript
Recall... Venn Diagrams
We finished Tuesday’s class with a look at the relationship between
CS304/CS310
Mathematical and Logical
Aspects of Computing
conjunction, disjunction and negation in logic, and
intersection, union and compliment in set theory.
Lecture 4: Functional
Completeness and
Normal Forms
This was realised by examining Venn Diagrams. As a further example,
let’s look at how we can express the following logical equivalence using a
Venn diagram:
a ↔ b ≡ (a → b) ∧ (b → a).
Friday,
14th Sep 2012
Today’s topics:
1
Venn diagrams (again)
2
(Disjunctive) normal
form
3
Functional completeness
CS304 — Lecture 4: Functional Completeness and Normal Forms
1/8
Disjunctive normal form
CS304 — Lecture 4: Functional Completeness and Normal Forms
Disjunctive normal form
So far we have been able to describe every Boolean Expression in terms
of a logic table (equivalently: given an interpretation for all possible
assignments). This begs the question:
Method for constructing the Disjunctive Normal Form of a logic table
1
Does every logic table have a Boolean expression?
2
This can be answered (in the affirmative) is using something called
disjunctive normal form (DNF). First some definitions:
For each row (i.e., assignment) with output (i.e., interpretation) of
T, write down the formula that uses only AND and NOT and has
interpretation T only for that assignment.
Write down the disjunction of these formulae (i.e., using “OR”).
Example: Write the Boolean formula, defined by the following table, in
DNF.
A normal form of a Boolean expression uses only the operators:
{∧, ∨, ¬}.
A literal is an atom or its negation.
Disjunctive Normal Form (DNF) is the disjunction of conjunction
of literals, and is the topic to today’s lecture.
Conjunctive Normal Form (CNF) is the conjunction or disjunction
of literals, and will feature (a lot) later in this course.
a
F
F
F
F
T
T
T
T
Examples:
CS304 — Lecture 4: Functional Completeness and Normal Forms
2/8
3/8
b
F
F
T
T
F
F
T
T
c
F
T
F
T
F
T
F
T
E
T
F
F
T
F
T
F
F
CS304 — Lecture 4: Functional Completeness and Normal Forms
4/8
Disjunctive normal form
Functionally Complete
Example: Write the following Boolean Expression in DNF:
a → b ∧ b → c).
Definition
A set of Boolean operators is said to be functionally complete if it can be
used to express all possible Boolean expressions.
Proposition
The set {∧, ∨, ¬} is functionally complete.
Proof: [take notes...]
Example: Write the following Boolean Expression in CNF:
a ⊕ b ∧ ¬c.
CS304 — Lecture 4: Functional Completeness and Normal Forms
However, this is not the only possible functionally complete set. We can
use de Morgan’s laws to show that both the sets {∧, ¬} and {∨, ¬} are
functionally complete. [take notes...]
5/8
Functionally Complete
CS304 — Lecture 4: Functional Completeness and Normal Forms
6/8
Functionally Complete
Exercises
Somewhat remarkably, there is an even smaller set that is functionally
complete, and it consists of just the NAND gate: {↑}.
1. For each of the following expressions, state if they are in DNF, CNF or
neither:
(a)
(b)
(c)
(d)
(e)
(a ∧ ¬b) ∨ (c ∧ ¬a)
a ∧ (b ∨ c)
a ∧ ¬(b ∨ c)
a ∧ (¬b ∧ ¬c)
¬a ∨ b
2. Express the following in DNF:
(a) (a → b) ∨ (b → ¬a)
(b) (a ∨ b ∨ c) ∧ (¬b ∨ ¬c)
3. Show that the set {↓} is functionally complete.
4. Is the set {∧, ∨} functionally complete? Explain your answer.
5. Show that
`
`(p ⊕ q) ⊕ q) ≡ p
(p ↔ q) ↔ q) ≡ p
6. Show that the unary operator ¬ cannot be constructed using ∧ and ∨.
CS304 — Lecture 4: Functional Completeness and Normal Forms
7/8
CS304 — Lecture 4: Functional Completeness and Normal Forms
8/8