Presentation is loading. Please wait.

Presentation is loading. Please wait.

Midterm Review CMSC421 – Fall 2006. CH1 Summary: Intro AI Definitions: dimensions human/rational think/act Three Major Components of AI Algorithms Representation.

Similar presentations


Presentation on theme: "Midterm Review CMSC421 – Fall 2006. CH1 Summary: Intro AI Definitions: dimensions human/rational think/act Three Major Components of AI Algorithms Representation."— Presentation transcript:

1 Midterm Review CMSC421 – Fall 2006

2 CH1 Summary: Intro AI Definitions: dimensions human/rational think/act Three Major Components of AI Algorithms Representation Reasoning Learning What makes AI hard: Problem Formulation Computational Complexity

3 CH2 Summary: Intelligent Agents An agent perceives and acts in an environment, has an architecture, and is implemented by an agent program. Task environment – PEAS (Performance, Environment, Actuators, Sensors) The most challenging environments are inaccessible, nondeterministic, dynamic, and continuous. An ideal agent always chooses the action which maximizes its expected performance, given its percept sequence so far. An agent program maps from percept to action and updates internal state. Reflex agents respond immediately to percepts.  simple reflex agents  model-based reflex agents Goal-based agents act in order to achieve their goal(s). Utility-based agents maximize their own utility function. All agents can improve their performance through learning.

4 CH3 Summary: Problem Solving Problem Formulation: state space, initial state, successor function, goal test, path cost Search tree  state space Evaluation of strategies: completeness, optimality, time and space complexity Uninformed search strategies: breadth-first, depth-first, and variants Avoiding repeated states

5 CH4 Summary: Informed Search Heuristics Best-first Search Algorithms Greedy Search A*  Admissible heuristics Constructing Heuristic functions Local Search Algorithms

6 CH5 Summary: Constraint Satisfaction CSPs are a special kind of problem: states defined by values of a fixed set of variables, goal test defined by constraints on variable values Backtracking=depth-first search with one variable assigned per node Variable ordering and value selection heuristics help significantly Forward checking prevents assignments that lead to failure. Constraint propagation does additional work to constrain values and detect inconsistencies. The CSP representation allows analysis of problem structure. Tree structured CSPs can be solved in linear time. Local Search, e.g., min-conflicts, is often effective in practice.

7 CH 6 Summary: Adversarial Search Games illustrate several important points about AI Perfection is unattainable -> approximation Good idea what to think about what to think about Heuristics can help Problem Formulation: Game tree Minimax procedure Alpha-beta procedure

8 CH7 Summary: Logical Agents Knowledge-based agents Propositional and first-order logic Inference, validity, equivalence and satisfiability Reasoning patterns  Resolution  Forward/backward chaining

9 CH 8, 9 Summary: FOL Syntax - terms, WFF, quantifiers New Inference rules for quantifiers Unification Horn clauses - FC, BC Resolution Refutation Converting to clausal form

10 Constraint Satisfaction

11 Constraint Satisfaction Problem Set of variables {X 1, X 2, …, X n } Each variable X i has a domain D i of possible values Usually D i is discrete and finite Set of constraints {C 1, C 2, …, C p } Each constraint C k involves a subset of variables and specifies the allowable combinations of values of these variables Goal: Assign a value to every variable such that all constraints are satisfied

12 CSP as a Search Problem Initial state: empty assignment Successor function: a value is assigned to any unassigned variable, which does not conflict with the currently assigned variables Goal test: the assignment is complete Path cost: irrelevant

13 Questions 1. Which variable X should be assigned a value next? 1. Minimum Remaining Values/Most-constrained variable 2. In which order should its domain D be sorted? 1. least constrained value 3. How should constraints be propagated? 1. forward checking 2. arc consistency

14 Adversarial Search

15 Specific Setting Two-player, turn-taking, deterministic, fully observable, zero-sum, time-constrained game  State space  Initial state  Successor function: it tells which actions can be executed in each state and gives the successor state for each action  MAX’s and MIN’s actions alternate, with MAX playing first in the initial state  Terminal test: it tells if a state is terminal and, if yes, if it’s a win or a loss for MAX, or a draw  All states are fully observable

16 Choosing an Action: Basic Idea 1) Using the current state as the initial state, build the game tree uniformly to the maximal depth h (called horizon) feasible within the time limit 2) Evaluate the states of the leaf nodes 3) Back up the results from the leaves to the root and pick the best action assuming the worst from MIN  Minimax algorithm

17 Minimax Algorithm 1. Expand the game tree uniformly from the current state (where it is MAX’s turn to play) to depth h 2. Compute the evaluation function at every leaf of the tree 3. Back-up the values from the leaves to the root of the tree as follows: a. A MAX node gets the maximum of the evaluation of its successors b. A MIN node gets the minimum of the evaluation of its successors 4. Select the move toward a MIN node that has the largest backed-up value

18 Alpha-Beta Pruning  Explore the game tree to depth h in depth-first manner  Back up alpha and beta values whenever possible  Prune branches that can’t lead to changing the final decision

19 Example The beta value of a MIN node is an upper bound on the final backed-up value. It can never increase 1  = 1 2

20 Example  = 1 The alpha value of a MAX node is a lower bound on the final backed-up value. It can never decrease 1  = 1 2

21 Alpha-Beta Algorithm  Update the alpha/beta value of the parent of a node N when the search below N has been completed or discontinued  Discontinue the search below a MAX node N if its alpha value is  the beta value of a MIN ancestor of N  Discontinue the search below a MIN node N if its beta value is  the alpha value of a MAX ancestor of N

22 Logical Representations and Theorem Proving

23 A Small Knowledge Base 1. Battery-OK  Bulbs-OK  Headlights-Work 2. Battery-OK  Starter-OK   Empty-Gas-Tank  Engine-Starts 3. Engine-Starts   Flat-Tire  Car-OK 4. Starter-OK 5.  Empty-Gas-Tank 6.  Car-OK

24 Example 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire 10.  Engine-Starts  Car-OK 9,3 11.  Engine-Starts 10, 8 12.  Battery-OK   Starter-OK  Empty-Gas-Tank 11,2 13.  Starter-OK  Empty-Gas-Tank 12,5 14. Empty-Gas-Tank 13, 6 15. {} 14,7 negated goal

25 Following Material is Extra Extra bonus, Free! Not required for midterm

26 but sometimes just doing random resolutions doesn’t work so hot…. 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlights-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire 10.  Starter-OK  Empty-Gas-Tank  Engine-Starts 11.  Battery-OK  Empty-Gas-Tank  Engine-Starts 12.  Battery-OK   Starter-OK  Engine-Starts 13.  Engine-Starts  Flat-Tire 14.  Engine-Starts  Car-OK negated goal 2,5 2,6 2,7 3,8 3,9

27 Resolution Strategies There are several methods for reducing the search space of a resolution system. Unit preference attempts first to do resolutions where one of the sentences is a single literal. For example, resolving a single sentence (such as ) with the sentence provides a sentence which is shorter. The set of support method tries to identify a core set of sentences (set of support) that are used in all the resolutions. The tricky part is to select a small set of support. Input resolution tries to use one of the input sentences with some other sentence. Input resolution is not complete unless the knowledge base is in Horn form. Linear resolution is a generalization which allows us to have complete resolution always. The subsumption method eliminates all sentences which are subsumed by an existing sentence in the knowledge database.

28 Example (Set-of-Support) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire

29 Example (Set-of-Support) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire 10.  Engine-Starts  Car-OK 11.  Engine-Starts 12.  Battery-OK   Starter-OK  Empty-Gas-Tank 13.  Starter-OK  Empty-Gas-Tank 14. Empty-Gas-Tank 15. False Note the goal-directed flavor

30 Resolution Heuristics Shortest-clause heuristic: Generate a clause with the fewest literals first

31 Example (Shortest-Clause) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire

32 Example (Shortest-Clause) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire 10.  Engine-Starts  Car-OK 11.  Engine-Starts 12.  Bulbs-OK  Headlights-Work 13.  Battery-OK   Starter-OK  Empty-Gas-Tank 14.  Starter-OK  Empty-Gas-Tank 15. Empty-Gas-Tank 16. False

33 Resolution Heuristics Simplifications heuristics: Remove any clause containing two complementary literals (tautology) Remove any clause C that contains all the literals of another clause C’ If a symbol always appears with the same “sign”, remove all the clauses that contain it (pure symbol)

34 Example (Pure Literal) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlights-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire

35 Review: 2 Important Properties #1: If KB |- Q then KB |= Q If Q is derived from a set of sentences KB using a given set of rules of inference, then Q is entailed by KB. Hence, inference produces only real entailments, or any sentence that follows deductively from the premises is valid. #2: If KB |= Q then KB |- Q If Q is entailed by a set of sentences KB, then Q can be derived from KB using the rules of inference. Hence, inference produces all entailments, or all valid sentences can be proved from the premises.


Download ppt "Midterm Review CMSC421 – Fall 2006. CH1 Summary: Intro AI Definitions: dimensions human/rational think/act Three Major Components of AI Algorithms Representation."

Similar presentations


Ads by Google