Building Control Algorithms For State Space Search

Slides:



Advertisements
Similar presentations
Some Prolog Prolog is a logic programming language
Advertisements

Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
Problem Solving Well-formed predicate calculus expressions provide a means of describing objects and relations in a problem domain and inference rule.
CSC411Artificial Intelligence 1 Chapter 3 Structures and Strategies For Space State Search Contents Graph Theory Strategies for Space State Search Using.
Formal Description of a Problem
Part2 AI as Representation and Search
Structures and Strategies For Space State Search
CSC 423 ARTIFICIAL INTELLIGENCE
1 CS 385 Fall 2006 Chapter 6 Building Control Algorithms for State Space Search Read
Graphs and Trees This handout: Total degree of a graph Applications of Graphs.
State Spaces Introduction to Artificial Intelligence Dr. Robin Burke.
Control Algorithms 2 Chapter 6 Control Algorithms 2 Chapter 6 Production Systems.
State-Space Searches. State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Artificial Intelligence
Structures and Strategies for State Space Search
Control and Implementation of State Space Search
CSC411Artificial Intelligence1 Chapter 15 An Introduction to PROLOG Syntax for Predicate Calculus Abstract Data Types (ADTs) in PROLOG A Production System.
Machine Learning: Symbol-Based
Dr Eleni Mangina – COURSE: LOGIC PROGRAMMING (during a joint degree with Fudan University in Software Engineering) DEPT. OF COMPUTER SCIENCE UCD Problem.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
1 Chapter 3 Knowledge Representation. 2 Chapter 3 Contents l The need for a good representation l Semantic nets l Inheritance l Frames l Object oriented.
Artificial Intelligence
1 Control and Implementation of State Space Search 5 5.0Introduction 5.1Recursion-Based Search 5.2Pattern-directed Search 5.3Production Systems 5.4The.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Solving Problems by Searching
State-Space Searches.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
Chapter 10 Artificial Intelligence. © 2005 Pearson Addison-Wesley. All rights reserved 10-2 Chapter 10: Artificial Intelligence 10.1 Intelligence and.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
1 State Space of a Problem Lecture 03 ITS033 – Programming & Algorithms Asst. Prof.
Formal Description of a Problem In AI, we will formally define a problem as –a space of all possible configurations where each configuration is called.
Empirical Explorations with The Logical Theory Machine: A Case Study in Heuristics by Allen Newell, J. C. Shaw, & H. A. Simon by Allen Newell, J. C. Shaw,
Production Systems A production system is –a set of rules (if-then or condition-action statements) –working memory the current state of the problem solving,
KU NLP Structures and Strategies for State Space Search Depth-First and Breadth-First Search q A search algorithm must determine the order in which.
Module 1- Getting Started Tell me what to do Using sets of instructions…
Building Control Algorithms For State Space Search.
Chapter 2 Problems, Problem Spaces, and Search?
Knowledge and search, page 1 CSI 4106, Winter 2005 Knowledge and search Points Properties of knowledge  Completeness  Objectivity  Certainty  Formalizability.
Control Algorithms 1 Chapter 6 Control Algorithms 1 Chapter 6 Pattern Search.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Chapter 2 Problems, Problem Spaces, and Search?
Control Algorithms 2 Chapter 6 Control Algorithms 2 Chapter 6 Production Systems.
Logic Programming CSC 358/ Outline Pattern matching Unification Logic programming.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Ch. 13 Ch. 131 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (notes?) Dr. Carter Tiernan.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Intelligent Control Methods Lecture 4: Searching in State Space Slovak University of Technology Faculty of Material Science and Technology in Trnava.
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1 Solving Problems by Searching. 2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search.
KU NLP Artificial Intelligence1 Ch 14. An Introduction to Prolog q an Implementation of logic as a programming language(PROgramming in LOGig) q many interesting.
Knowledge Representation Fall 2013 COMP3710 Artificial Intelligence Computing Science Thompson Rivers University.
Search in State Spaces Problem solving as search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way.
Artificial Intelligence Midterm 고려대학교 컴퓨터학과 자연어처리 연구실 임 해 창.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Building Control Algorithms for State Space Search. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005.
ARTIFICIAL INTELLIGENCE
Knowledge Representation
The Decision-making Process
Problem solving by Searching
Some problems Cse-402 K3r20,k3r23.
4. Computational Problem Solving
Knowledge Representation
State-Space Searches.
State-Space Searches.
State-Space Searches.
Presentation transcript:

Building Control Algorithms For State Space Search Chapter 6 Building Control Algorithms For State Space Search Contents Recursion-Based Search Production Systems The Blackboard Architecture for Problem Solving CSC411 Artificial Intelligence

Artificial Intelligence Recursive Search Recursive search A recursive step: procedure calls itself A terminating condition Depth-first recursive search algorithm CSC411 Artificial Intelligence

Recursive Search with Global Variables Global variables : open and closed CSC411 Artificial Intelligence

Pattern-Driven Reasoning Problem: Given a set of assertions (predicate expressions) Determine whether a given goal is a logical consequence of the given set of assertions Solution Use unification to select the implications (rules) whose conclusions match the goal Unify the goal with the conclusion of the rule Apply the substitutions throughout the rule Transform the rule premise into a new subgoal If the subgoal matches a fact, terminate Otherwise recur on the subgoal Recursive algorithm – next page CSC411 Artificial Intelligence

Artificial Intelligence Pattern-driven Reasoning CSC411 Artificial Intelligence

Artificial Intelligence Some Issues The order of assertions Logical connectives in the rule premises Logical negation CSC411 Artificial Intelligence

Artificial Intelligence CSC411 Artificial Intelligence

Artificial Intelligence CSC411 Artificial Intelligence

Artificial Intelligence A production system. Control loops until working memory pattern no longer matches the conditions of any productions. CSC411 Artificial Intelligence

Artificial Intelligence Trace of a simple production system. CSC411 Artificial Intelligence

The 8-puzzle as a production system CSC411 Artificial Intelligence

Artificial Intelligence The 8-puzzle searched by a production system with loop detection and depth-bound. CSC411 Artificial Intelligence

The Knight’s Tour Problem Problem: find a series of legal moves in which the knight lands on each square of the chessboard exactly once Legal moves of a chess knight. CSC411 Artificial Intelligence

Artificial Intelligence A 3 x 3 chessboard with move rules for the simplified knight tour problem. CSC411 Artificial Intelligence

Artificial Intelligence Production rules for the 3 x 3 knight problem. CSC411 Artificial Intelligence

Artificial Intelligence A production system solution to the 3 x 3 knight’s tour problem. CSC411 Artificial Intelligence

Artificial Intelligence Control Algorithms The general recursive path definition X path(X,X) X,Y[path(X,Y)  Z[move(X,Z)  path(Z,Y)]] The revised path definition to avoid infinite loop X,Y[path(X,Y)  Z[move(X,Z)  (been(Z))  assert(been(Z))  path(Z,Y)]] CSC411 Artificial Intelligence

Artificial Intelligence The recursive path algorithm as production system. CSC411 Artificial Intelligence

A Production System in Prolog Farmer, wolf, goat, and cabbage problem A farmer with his wolf, goat, and cabbage come to the edge of a river they wish to cross. There is a boat at the river’s edge, but, of course, only the farmer can row. The boat also can carry only two things, including the rower, at a time. If the wolf is ever left alone with the goat, the wolf will eat the goat; similarly if the goat is left alone with the cabbage, the goat will eat the cabbage. Devise a sequence of crossings of the river so that all four characters arrives safely on the other side of the river. Representation state(F, W, G, C) describes the location of Farmer, Wolf, Goat, and Cabbage Possible locations are e for east, w for west, bank Initial state is state(w, w, w, w) Goal state is state(e, e, e, e) Predicates opp(X, Y) indicates that X and y are opposite sides of the river Facts: opp(e, w). opp( w, e). CSC411 Artificial Intelligence

Artificial Intelligence Sample crossings for the farmer, wolf, goat, and cabbage problem. CSC411 Artificial Intelligence

Artificial Intelligence Portion of the state space graph of the farmer, wolf, goat, and cabbage problem, including unsafe states. CSC411 Artificial Intelligence

Artificial Intelligence Production Rules in Prolog Unsafe states unsafe(state(X, Y, Y, C)) :- opp(X, Y). unsafe(state(X, W, Y, Y)) :- opp(X, Y). Move rules move(state(X, X, G, C), state(Y, Y, G, C))) :- opp(X, Y), not(unsafe(state(Y, Y, G, C))), writelist([‘farms takes wolf’, Y, Y, G, C]). move(state(X, W, X, C), state(Y, W, Y, C)) :- opp(X, Y), not(unsafe(state(Y, W, Y, C))), writelist([‘farmers takes goat’, Y, W, Y,C]). move(state(X, W, G, X), state(Y, W, G, Y)) :- opp(X, Y), not(unsafe(state(Y, W, G, Y))), writelist(‘farmer takes cabbage’, Y, W, G, Y]). move(state(X, W, G, C), state(Y, W, G, C)) :-opp(X, Y), not(unsafe(state(Y, W, G, C))), writelist([‘farmer takes self’, Y, W, G, C]). move(state(F, W, G, C), state(F, W, G, C)) :- writelist([‘Backtrack from ‘, F, W, G, C]), fail. Path rules Path(Goal, Goal, Stack) :- write(‘Solution Path Is: ‘), nl, reverse_print_stack(Stack). Path(State, Goal, Stack) :- move(State, Next), not(member_stack(Next, Stack)), stack(Next, Stack, NewStack), path(Next, Goal, NewStack), !. Start rule Go(Start, Goal) :- empty_stack(EmptyStack), stack(Start, EmptyStack, Stack), path(Start, Goal, Stack). Question ?- go(state(w, w, w, w), state(e, e, e, e) CSC411 Artificial Intelligence

Artificial Intelligence Data-driven search in a production system. CSC411 Artificial Intelligence

Artificial Intelligence Goal-driven search in a production system. CSC411 Artificial Intelligence

Artificial Intelligence Bidirectional search missing in both directions, resulting in excessive search. CSC411 Artificial Intelligence

Artificial Intelligence Bidirectional search meeting in the middle, eliminating much of the space examined by unidirectional search. CSC411 Artificial Intelligence

Artificial Intelligence Major advantages of production systems for artificial intelligence Separation of Knowledge and Control A Natural Mapping onto State Space Search Modularity of Production Rules Pattern-Directed Control Opportunities for Heuristic Control of Search Tracing and Explanation Language Independence A Plausible Model of Human Problem-Solving CSC411 Artificial Intelligence

Extend production systems Separate productions into modules Blackboard architecture Extend production systems Separate productions into modules Each module is an agent -- knowledge source A single global structure -- blackboard CSC411 Artificial Intelligence