Artificial Intelligence Knowledge Representation Propositional Representation
E N D
Presentation Transcript
Lecture 5 Artificial IntelligenceKnowledge RepresentationPropositional Representation
Reasoning method of resolution
Reasoning methods of Resolution • Forward Reasoning • Backward Reasoning
Backward Reasoning • The steps required to prove propositional with Backward Reasoning method:- 1- Convert all propositional sentences to CNF and Clauses Form. 2-Negate the Goal and constructs clauses for this proposal. 3-Select the proposed clauses and one of the other clauses as parents.
Backward Reasoning 4-Solve the parents with each other and put the result in new clause. 5-Solve the new clauses with one of the other clauses. 6-Reapet step(5) until reach to the empty. A- if you reach to the empty clauses then the goal is proved. B- if you does not reach to the empty clauses then the goal is not proved.
Forward Reasoning • The steps required to prove propositional with Forward Reasoning method:- 1- Convert all propositional sentences to CNF and Clauses Form. 2-Select two clauses to solve them with each other. 3-Solve the two selected clauses and put the result in new clause.
Forward Reasoning 4-Solve the new clauses with one of the other clauses. 6-Reapet step(4) until reach to the Goal. A- if you reach to the clauses Goal then the goal is proved. B- if you does not reach to the clauses Goal then the goal is not proved.
Forward Reasoning • From facts to conclusions • Given • s1: p • s2: q, • s3: p q r Rewrite in clausal form: Goal: r ; s3 =( p q r) • s1 resolve with s3 = q r (s4) • s2 resolve with s4 = r • Generally used for processing sensory information.
Backwards Reasoning: • From Negative of Goal to data • Given • s1: p, • s2: q, • s3: p q r • Goal: r ; negate the goal s4 = r • Rewrite s3 in clausal form: s3 = ( p q r) • Resolve s4 with s3 = p q (s5) • Resolve s5 with s2 = p (s6) • Resolve s6 with s1 = empty. r is true. • From Negative of Goal to data • Given • s1: p, • s2: q, • s3: p q r • Goal: s4 = r Rewrite in clausal form: s3 = ( p q r) • Resolve s4 with s3 = p q (s5) • Resolve s5 with s2 = p (s6) • Resolve s6 with s1 = empty. r is true. state1
Example Suppose our knowledge base consists of the rules S T (P R) And the facts S T R And I need to prove P 1.Using resolution
S1 S2 S5S3 S6S4 P Forward chaining or Forward Reasoning • S1=S T (P R) • S2=S • S3=T • S4=R • And I need to prove P Convert to CNF (S1) (S T )(P R) S T (P R) S T P R S1= S T P R (CNF) S1 with S2 S5= T P R S5 resolve with S3 S6=P R S6 resolve with S4 P Then P is proved
S1 S5 S6S2 S7S3 S8S4 empty Backward chaining or Backward Reasoning S1=S T (P R) S2=S S3=T S4=R And I need to prove P Convert to CNF S1= S T P R (CNF) Add S5= P S5 with S1 S6= S T R S6 with S2 S7= T R S7 with S3 S8= R S8 with S4 Infer empty Thenpis proved