Truth, deduction, computation; lecture 5
-
Upload
vlad-patryshev -
Category
Education
-
view
209 -
download
3
description
Transcript of Truth, deduction, computation; lecture 5
Truth, Deduction, ComputationLecture 5Boolean Logic
Vlad PatryshevSCU2013
Earlier we had…
<atomic formula> ::= <predicate>(<arguments>)<arguments> ::= <term>|<arguments>,<term>
Now let’s build formulas out of atomic formulas!
Negation
● not(a)● !a● ~a● a● ¬a
P ¬P
TRUE FALSE
FALSE TRUE
¬¬¬Cube(c) is the same as ¬Cube(c)¬¬Cube(c) is the same as Cube(c)?
Notation:a ≠ b means ¬(a = b)
(Chapter 3)
Negation
● not(a)● !a● ~a● a● ¬a
P ¬P
TRUE FALSE
FALSE TRUE
¬¬¬Cube(c) is the same as ¬Cube(c)¬¬Cube(c) is the same as Cube(c)? ...it depends...
Notation:a ≠ b means ¬(a = b)
Well...
Negation Rules
● If P is a sentence, so is ¬P
● A sentence that is either atomic
or a negation of atomic is called
literal
Conjunction
● a and b● a ∧ b● a & b● a && b
Well...
P Q P ∧ Q
TRUE TRUE TRUE
TRUE FALSE FALSE
FALSE TRUE FALSE
FALSE FALSE FALSEExamples:
● Tet(f) ∧ Small(f)● ¬(Tet(f) ∧ ¬Large(f)● if (1 < a && a < 1) alert(“ouch”)
Disjunction
● a or b● a v b● a | b● a || b
Well...
P Q P v Q
TRUE TRUE TRUE
TRUE FALSE TRUE
FALSE TRUE TRUE
FALSE FALSE TRUEExamples:
● Tet(f) v Small(f)● ¬(Tet(f) v ¬Large(f)● if (0 < a || a < 0) alert(“good”)● Dead(AshwathamaTheHuman) or Dead(AshwathamaTheElephant)
Conjunction and Disjunction Rules
● If P and Q are sentences, so is P∧Q
● If P and Q are sentences, so is PvQ
Need Parentheses
● Home(max) v Home(claire) ∧ Happy(carl)
● ¬ Home(max) v ¬ Home(claire) ∧ Happy(carl)
Avoid Ambiguity (remember Yudhisthira)
Associativity Rules (or are they laws?)
● ((P ∧ Q) ∧ R) <=> (P ∧ (Q ∧ R))
● ((P v Q) v R) <=> (P v (Q v R))
Actually… we have two monoids!
Commutativity Rules
● P ∧ Q <=> Q ∧ P
● P v Q <=> Q v P
We have two commutative monoids!
Idempotence Rules
● P ∧ P <=> P
● P v P <=> P
We have two commutative idempotent monoids!
(we are closer to sets than we thought)
Logical Formulas, formally
<formula> ::= <atomic formula>
<formula> ::= ¬<formula>
<formula> ::= (<formula>)
<formula> ::= <formula>v<formula>
<formula> ::= <formula>∧<formula>
Some More Laws
● Double Negation: ¬¬P ⇔ P
● DeMorgan: ¬(P ∧ Q) ⇔ ¬P v ¬Q● DeMorgan: ¬(P v Q) ⇔ ¬P ∧ ¬Q
Philosophy on Page 94
“it is necessarily the case that S” - what’s the difference with just S?
If a formula depends on entities, it’s called “Truth-functional”
And if it is always (constant) true, it can be considered as “not truth-functional”... see next
(Chapter 4)
More definitions
Logical Truth - “logically necessary sentences” -
consequences that follow from an empty list of premises
Logical Possibility - “logically possible sentences” -
sentences which negation cannot be proven for a given
collection of entities and rules (example in Tarsky World)
Tautology (from Greek ταυτολογία) is a formula which is
true in every possible interpretation. [wikipedia] That is, it
will be true, whatever the argument entities.
Truth Tables
S = ..A1..A
2...A
n.. e.g. ¬(¬A
1vA
3)∧A
2
Is S a tautology?
A1
A2
A3 S
T T T FT T F FT F T F............
Referencecolumns
Truth Tables, example
Big Picture by Example
Tet(a)v¬Tet(a)
a = a ∧ b = b
Small(a) v Medium(a) v Large(a)
Cube(a) ∧ Larger(a,b)
Specific for Tarski’s World
Logical Necessities (can be proved)
Tautologies(actually we don’t need no Tets here:)
TT-possible
Equivalence of sentences
Two sentences are...
Tautologically equivalent if they take the same values in truth tables.
E.g. ¬(A∧B) and ¬A v ¬B
Logically equivalent if each can be deduced from another.
E.g. a=b and b=a
Example from the book
if (!((A || B) && !C) println(“completely satisfied”)if ((!A && !B) || C) println(“absolutely satisfied”)
Consequence of sentences
Remember lecture 5?
A is a tautological consequence of B if in the truth table every time B is true, A is true.
E.g. A∧B yields AvB
A is a logical consequence of B if we can build a proof
E.g. a=b∧с=b yields c=a
Try 4.24
Try 4.24
Never mind, FITCH has Taut Con
Remember the Laws?
● Double Negation: ¬¬P ⇔ P
● DeMorgan: ¬(P ∧ Q) ⇔ ¬P v ¬Q● DeMorgan: ¬(P v Q) ⇔ ¬P ∧ ¬Q
Pushing Negation Around
Will use the lawsE.g.
¬(Cube(a) ∧ ¬¬Small(a))
¬(Cube(a) ∧ Small(a))
¬Cube(a) v ¬Small(a)
Hmm… wait… who said it is legal?!...
We use Substitution!
P ⇔ Q
S(P) - contains P somewhere insidethenS(P) ⇔ S(Q)
Kind of obvious for tautological equivalence, but… We’ll get back to it later
Normalization. Step 1. Negation
NNF, Negation Normal Form
all negations by atomic formulas. (remember “literal”?)
E.g. ¬¬¬(¬A v ¬(B∧C) v D) ⇔
¬(¬A v ¬(B∧C) v D) ⇔
A ∧ (B∧C) ∧ ¬D)
Remember, we have...
● associativity● commutativity● idempotence
Together with de Morgan laws, they do miracles
We can simplify expressions.
Simplifying Logical Sentence
(A v B) ∧ C ∧ (¬(¬B ∧ ¬A) v B) ⇔
(A v B) ∧ C ∧ ((¬¬B v ¬¬A) v B) ⇔
(A v B) ∧ C ∧ ((B v A) v B) ⇔
(A v B) ∧ C ∧ (B v A v B) ⇔
(A v B) ∧ C ∧ (A v B v B) ⇔
(A v B) ∧ C ∧ (A v B) ⇔
(A v B) ∧ (A v B) ∧ C ⇔
(A v B) ∧ C
That’s it for today