Professional Documents
Culture Documents
CNF and Resolution: Discrete Mathematics Andrei Bulatov
CNF and Resolution: Discrete Mathematics Andrei Bulatov
CNF and Resolution: Discrete Mathematics Andrei Bulatov
6-2
Previous Lecture
Rules of substitution Logic inference Inference and tautologies Rules of inference
6-3
Logic Puzzles
A prisoner must choose between two rooms each of which contains either a lady, or a tiger. If he chooses a room with a lady, he marries her, if he chooses a room with a tiger, he gets eaten by the tiger. he rooms have signs on them! I at least one of these rooms contains a lady II a tiger is in the other room
It is "nown that either both signs are true or both are false
6-4
6-5
-. 'p %( p premise
7-6
7-7
CNF Theorem
Theorem 4very statement is logically e%uivalent to a certain 2#3. Proof 's"etch( Let be a 'compound( statement. .tep ). 4+press all logic connectives in through negation, con1unction, and dis1unction. Let be the obtained statement. .tep *. 5sing DeMorgan6s laws move all the negations in to individual primitive statements. Let denote the updated statement .tep ,. 5sing distributive laws transform into a 2#3.
7-8
Example
3ind a 2#3 logically e%uivalent to .tep ). .tep *. .tep ,. 'p %( r 'p %( r 'p r( '% r( 'p %( r
7-9
ule of esolution
p% p r %r he corresponding tautology ''p %( 'p r(( '% r( 778asmine is s"iing or it is not snowing. It is snowing or Bart is playing hoc"ey.66 p $ 7it is snowing6 % $ 78asmine is s"iing6 r $ 7Bart is playing hoc"ey6 77 herefore, 8asmine is s"iing or Bart is playing hoc"ey66 % r is called resolvent
7-10
6-11
Logic Puzzles
A prisoner must choose between two rooms each of which contains either a lady, or a tiger. If he chooses a room with a lady, he marries her, if he chooses a room with a tiger, he gets eaten by the tiger. he rooms have signs on them! I at least one of these rooms contains a lady II a tiger is in the other room
It is "nown that either both signs are true or both are false 'p %( p, p 'p %(
7-12
Example
A lady and a tiger &remises! p 'p %(, 'p %( p #egation of the conclusion! 2lauses! p, p %, % Argument! p% % p p premise premise resolvent premise resolvent %
7-14
7-15
7-16
7+ is greater than y6 7+ is the mother of y6 7car + has colour y6 7+ divides y < @6 7+ sits between y and @6 7+ is a son of y and @6 contain * variables, binary predicates A'+,y(
7-17
*ssigning a +alue
:hen a variable is assigned a value, the predicates turns into a statement, whose truth value can be evaluated.
+B*
false true
false
7-18
&niverse
:e cannot assign a variable of a predicate A#C value. :e need to obtain a meaningful statementD 7+ is greater than ,6
*, > a cat a big red truc"
4very variable of a predicate is associated with a universe or universe of discourse, and its values are ta"en from this universe 7+ is greater than ,6 7+ is my brother6 7+ is an animal6 7car + has colour y6 + + + + y is a number is a human is a ;;; is a car is a colour
7-19
elational #ata,ases
A relational database is a collection of tables li"e
#o. ). #ame Bradley 2oleman .tudent ID .upervisor ,>)>)*, hesis title &etra Algebraic graph Berenbrin" theory
A table consists of a schema and an instance. A schema is a collection of attributes, where each attribute has an associated universe of possible values. An instance is a collection of rows, where each row is a mapping that associates with each attribute of the schema a value in its universe. 4very table is a predicate that is true on the rows of the instance and false otherwise.
7-20
-uantifiers
9ne way to obtain a statement from a predicate is to assign all its variables some values Another way to do that is to use e+pressions li"e 73or every E6 7 here is E such that E6 7A E can be found E6 7Any E is E6 74very man is mortal6 7 here is + such that + is greater than ,6 7 here is a person who is my father6 2 73or any x, x 0 F
%uantification
7-21
&niversal -uantifiers
Abbreviates constructions li"e 3or all E 3or any E 4very E 4ach E Asserts that a predicate is true for all values from the universe 74very man is mortal6 7All lions are fierce6 2 73or any x, x 0 F #otation! + &'+( means that for every value a from the universe &'a( is true
7-22
+ &'+( is false if and only if there is at least one value a from the universe such that &'a( is false .uch a value a is called a countere+ample hus to disprove that 74very man is mortal6 it suffices to recall the movie 7Gighlander6
7-23
Existential -uantifiers
Abbreviates constructions li"e 3or some E 3or at least one E here is E here e+ists E Asserts that a predicate is true for at least one value from the universe 7 here is a living "ing6 7.ome people are fierce6 2 7 here is x such that x 10 F #otation! + &'+( means that there is a value a from the universe such that &'a( is true
7-24
+ &'+( is false if and only if for all a from the universe &'a( is false Disproving an e+istential statement is difficultD
7-25
here is a countere+ample ? + &'+( 3or every value a from a value a from the universe the universe &'a( is true such that &'a( is false here is a value a from + &'+( the universe such that &'a( is true 3or all values a from the universe &'a( is false
9bserve that + &'+( is false if and only if + &'+( is true + &'+( is false if and only if + &'+( is true
7-26
Example
:hat is the negation of each of the following statements; .tatement All lions are fierce + &'+( 4veryone has two legs + &'+( #egation here is a peaceful lion here is a person having more than two legs, one leg, or no legs at all All people hate coffee here is a tiger in every room
.ome people li"e + &'+( coffee here is a lady in + &'+( one of these rooms '.ome rooms contain a lady(
7-27
.ome/or0
4+ercises from the Boo"! #o. ), *, -aci1, Ha'i,iv(, )*'vii,viii( 'page )>>$)>*(