Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITCS 3153 Artificial Intelligence Lecture 12 Logical Agents Chapter 7 Lecture 12 Logical Agents Chapter 7.

Similar presentations


Presentation on theme: "ITCS 3153 Artificial Intelligence Lecture 12 Logical Agents Chapter 7 Lecture 12 Logical Agents Chapter 7."— Presentation transcript:

1 ITCS 3153 Artificial Intelligence Lecture 12 Logical Agents Chapter 7 Lecture 12 Logical Agents Chapter 7

2 Propositional Logic We’re still emphasizing Propositional Logic Very important question with this method Does knowledge base of propositional logic satisfy a particular proposition?Does knowledge base of propositional logic satisfy a particular proposition? –Can we generate some sequence of resolutions that prove a proposition is possible? We’re still emphasizing Propositional Logic Very important question with this method Does knowledge base of propositional logic satisfy a particular proposition?Does knowledge base of propositional logic satisfy a particular proposition? –Can we generate some sequence of resolutions that prove a proposition is possible?

3 Backtracking Another way (representation) for searching Problem to solve is in CNFProblem to solve is in CNF –Is Marvin a Martian given --- M == 1 (true)?  Marvin is green --- G=1  Marvin is little --- L=1  (little and green) implies Martian --- (L ^ G) => M ~(L^G) V M ~L V ~G V M = 1 –Proof by contradiction… are there true/false values for G, L, and M that are consistent with knowledge base and Marvin not being a Martian?  G ^ L ^ (~L V ~G V M) ^ ~M == 0? Another way (representation) for searching Problem to solve is in CNFProblem to solve is in CNF –Is Marvin a Martian given --- M == 1 (true)?  Marvin is green --- G=1  Marvin is little --- L=1  (little and green) implies Martian --- (L ^ G) => M ~(L^G) V M ~L V ~G V M = 1 –Proof by contradiction… are there true/false values for G, L, and M that are consistent with knowledge base and Marvin not being a Martian?  G ^ L ^ (~L V ~G V M) ^ ~M == 0? Make sure you understand this logic

4 Searching for variable values Want to find values such that: Randomly consider all true/false assignments to variables until we exhaust them all or find matchRandomly consider all true/false assignments to variables until we exhaust them all or find match –(G, L, M) = (1, 0, 0)… no = (0, 1, 0)… no = (0, 0, 0)… no = (1, 1, 0)… no Alternatively…Alternatively… Want to find values such that: Randomly consider all true/false assignments to variables until we exhaust them all or find matchRandomly consider all true/false assignments to variables until we exhaust them all or find match –(G, L, M) = (1, 0, 0)… no = (0, 1, 0)… no = (0, 0, 0)… no = (1, 1, 0)… no Alternatively…Alternatively… G ^ L ^ (~L V ~G V M) ^ ~M == 0

5 Searching for variable values Davis-Putnam Algorithm (DPLL) Search through possible assignments to (G, L, M) via depth first search (0, 0, 0) to (0, 0, 1) to (0, 1, 0)…Search through possible assignments to (G, L, M) via depth first search (0, 0, 0) to (0, 0, 1) to (0, 1, 0)… –Each clause of CNF must be true  Terminate consideration when clause evaluates to false –Use heuristics to reduce repeated computation of propositions  Early termination  Pure symbol heuristic  Unit clause heuristic Davis-Putnam Algorithm (DPLL) Search through possible assignments to (G, L, M) via depth first search (0, 0, 0) to (0, 0, 1) to (0, 1, 0)…Search through possible assignments to (G, L, M) via depth first search (0, 0, 0) to (0, 0, 1) to (0, 1, 0)… –Each clause of CNF must be true  Terminate consideration when clause evaluates to false –Use heuristics to reduce repeated computation of propositions  Early termination  Pure symbol heuristic  Unit clause heuristic G L M

6 Searching for variable values Other ways to find (G, L, M) assignments for: G ^ L ^ (~L V ~G V M) ^ ~M == 0 G ^ L ^ (~L V ~G V M) ^ ~M == 0 Simulated Annealing (WalkSAT) – –Start with initial guess (0, 1, 1) – –Evaluation metric is the number of clauses that evaluate to true – –Move “in direction” of guesses that cause more clauses to be true – –Many local mins, use lots of randomness Other ways to find (G, L, M) assignments for: G ^ L ^ (~L V ~G V M) ^ ~M == 0 G ^ L ^ (~L V ~G V M) ^ ~M == 0 Simulated Annealing (WalkSAT) – –Start with initial guess (0, 1, 1) – –Evaluation metric is the number of clauses that evaluate to true – –Move “in direction” of guesses that cause more clauses to be true – –Many local mins, use lots of randomness

7 WalkSAT termination How do you know when simulated annealing is done? No way to know with certainty that an answer is not possibleNo way to know with certainty that an answer is not possible –Could have been bad luck –Could be there really is no answer –Establish a max number of iterations and go with best answer to that point How do you know when simulated annealing is done? No way to know with certainty that an answer is not possibleNo way to know with certainty that an answer is not possible –Could have been bad luck –Could be there really is no answer –Establish a max number of iterations and go with best answer to that point

8 So how well do these work? Think about it this way 16 of 32 possible assignments are models (are satisfiable) for this sentence16 of 32 possible assignments are models (are satisfiable) for this sentence Therefore, 2 random guesses should find a solutionTherefore, 2 random guesses should find a solution WalkSAT and DPLL should work quicklyWalkSAT and DPLL should work quickly Think about it this way 16 of 32 possible assignments are models (are satisfiable) for this sentence16 of 32 possible assignments are models (are satisfiable) for this sentence Therefore, 2 random guesses should find a solutionTherefore, 2 random guesses should find a solution WalkSAT and DPLL should work quicklyWalkSAT and DPLL should work quickly

9 What about more clauses? If # symbols (variables) stays the same, but number of clauses increases More ways for an assignment to fail (on any one clause)More ways for an assignment to fail (on any one clause) More searching through possible assignments is neededMore searching through possible assignments is needed Let’s create a ratio, m/n, to measure #clauses / # symbolsLet’s create a ratio, m/n, to measure #clauses / # symbols We expect large m/n causes slower solutionWe expect large m/n causes slower solution If # symbols (variables) stays the same, but number of clauses increases More ways for an assignment to fail (on any one clause)More ways for an assignment to fail (on any one clause) More searching through possible assignments is neededMore searching through possible assignments is needed Let’s create a ratio, m/n, to measure #clauses / # symbolsLet’s create a ratio, m/n, to measure #clauses / # symbols We expect large m/n causes slower solutionWe expect large m/n causes slower solution

10 What about more clauses Higher m/n means fewer assignments will work If fewer assignments work it is harder for DPLL and WalkSAT If fewer assignments work it is harder for DPLL and WalkSAT Higher m/n means fewer assignments will work If fewer assignments work it is harder for DPLL and WalkSAT If fewer assignments work it is harder for DPLL and WalkSAT

11 Combining it all 4x4 Wumpus World The “physics” of the gameThe “physics” of the game – – At least one wumpus on boardAt least one wumpus on board – A most one wumpus on board (for any two squares, one is free)A most one wumpus on board (for any two squares, one is free) – n(n-1)/2 rules like: ~W 1,1 V ~W 1,2 Total of 155 sentences containing 64 distinct symbolsTotal of 155 sentences containing 64 distinct symbols 4x4 Wumpus World The “physics” of the gameThe “physics” of the game – – At least one wumpus on boardAt least one wumpus on board – A most one wumpus on board (for any two squares, one is free)A most one wumpus on board (for any two squares, one is free) – n(n-1)/2 rules like: ~W 1,1 V ~W 1,2 Total of 155 sentences containing 64 distinct symbolsTotal of 155 sentences containing 64 distinct symbols

12 Wumpus World Inefficiencies as world becomes large Knowledge base must expand if size of world expandsKnowledge base must expand if size of world expands Preferred to have sentences that apply to all squares We brought this subject up last weekWe brought this subject up last week Next chapter addresses this issueNext chapter addresses this issue Inefficiencies as world becomes large Knowledge base must expand if size of world expandsKnowledge base must expand if size of world expands Preferred to have sentences that apply to all squares We brought this subject up last weekWe brought this subject up last week Next chapter addresses this issueNext chapter addresses this issue


Download ppt "ITCS 3153 Artificial Intelligence Lecture 12 Logical Agents Chapter 7 Lecture 12 Logical Agents Chapter 7."

Similar presentations


Ads by Google