csc411artificial intelligence1 chapter 8 strong method problem solving contents expert system...
TRANSCRIPT
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 11
Chapter 8
Strong Method Problem Solving
Contents
Expert System TechnologyRule-Based Expert SystemsModel-Based, Case-Based and Hybrid SystemsPlanning
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 22
Expert SystemsExpert SystemsKnowledge intensive methodKnowledge intensive methodExpert systems take advantage of Expert systems take advantage of expertise of human domain expertsexpertise of human domain expertsHuman expertise as heuristicsHuman expertise as heuristics– Support inspection of reasoning processes, Support inspection of reasoning processes,
presenting intermediate steps and answering presenting intermediate steps and answering questions about the solution processquestions about the solution process
– Allow easy modification in adding and deleting Allow easy modification in adding and deleting skills from KBskills from KB
– Reason heuristically, using knowledge to get Reason heuristically, using knowledge to get useful solutionsuseful solutions
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 33
Expert System FeaturesExpert System FeaturesRich KB and easy modificationRich KB and easy modificationOpen reasoning process Open reasoning process Explanation of reasoningExplanation of reasoningExploratory prototypingExploratory prototypingHeuristic reasoning (problem-solving)Heuristic reasoning (problem-solving)Wide range applicationsWide range applications– Interpretation – from raw data to conclusionInterpretation – from raw data to conclusion– Prediction – weatherPrediction – weather– Diagnosis – medical, mechanicalDiagnosis – medical, mechanical– Design – CAD, CivilDesign – CAD, Civil– Planning – scheduling, RobotPlanning – scheduling, Robot– Monitoring – Inspector Monitoring – Inspector – Instruction – CAE, online learningInstruction – CAE, online learning– Control – production line controlControl – production line control
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 44
Architecture of a typical expert system for a particular problem domain.
Architecture of Expert SystemsArchitecture of Expert Systems
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 55
Modules of Expert SystemsModules of Expert SystemsUser interface User interface – simplify communication and hide much of the simplify communication and hide much of the
complexity, such as the internal structure of the complexity, such as the internal structure of the knowledge baseknowledge base
Knowledge baseKnowledge base– Domain knowledgeDomain knowledge– General knowledge and case-specific informationGeneral knowledge and case-specific information– Optional KB editorOptional KB editor
Inference engineInference engine– Reasoning mechanism to apply the knowledge to the Reasoning mechanism to apply the knowledge to the
solution of problemssolution of problems– E.g. recognize-act control cycle in production systemsE.g. recognize-act control cycle in production systems
Explanation subsystemExplanation subsystem– Allow the program to explain its reasoning to the user, to Allow the program to explain its reasoning to the user, to
justify the conclusionjustify the conclusion– Respond to why and how queriesRespond to why and how queries
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 66
Separation Knowledge Base from Separation Knowledge Base from Inference EngineInference Engine
Represent knowledge in a more Represent knowledge in a more natural fashionnatural fashionBuilders can focus on capturing and Builders can focus on capturing and organizing domain knowledgeorganizing domain knowledgeModularization, easy to maintain – Modularization, easy to maintain – modification, addition, removal, etc modification, addition, removal, etc Build expert system shell that can be Build expert system shell that can be provided with different domain provided with different domain knowledge to form different ESknowledge to form different ES
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 77
1. The need for the solution justifies the cost and effort of building an expert system.
2. Human expertise is not available in all situations where it is needed.
3. The problem may be solved using symbolic reasoning.4. The problem domain is well structured and does not
require commonsense reasoning.5. The problem may not be solved using traditional
computing methods.6. Cooperative and articulate experts exist.7. The problem is of proper size and scope.
Guidelines to determine whether a problem is appropriate for expert system solution:
Selecting Problems for ESSelecting Problems for ES
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 88
Roles in Building ESRoles in Building ESKnowledge engineer
– AI language and representation expert– Select software and hardware, acquire and
organize knowledge in specific form
Domain expert– Professionals– Provide knowledge of application area
End user– Specify requirement and constraintsSpecify requirement and constraints– Test and verify the productTest and verify the product
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 99
ES Exploratory Development CycleES Exploratory Development Cycle
ES ProgrammingES Programming– Prototyping Prototyping
developmentdevelopment– Unlimited Unlimited
maintenance maintenance
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1010
Knowledge AcquisitionKnowledge Acquisition
Acquire expertise (domain Acquire expertise (domain knowledge) from domain expertsknowledge) from domain experts
Characteristics of domain expertiseCharacteristics of domain expertise– Inaccessible -- Perceptible but non-Inaccessible -- Perceptible but non-
describable describable – Free formatFree format– Vague, imprecise, and biasVague, imprecise, and bias– Dynamic (change)Dynamic (change)
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1111
Knowledge EngineeringKnowledge EngineeringEngineering Engineering processprocess– Knowledge Knowledge
acquisitionacquisition– Knowledge Knowledge
representationrepresentation– System System
implementationimplementation– System System
maintenance maintenance
Conceptual Model Conceptual Model – Intermediate Intermediate
representation of representation of domain domain knowledge, like knowledge, like ER diagram in DB ER diagram in DB design design
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1212
Rule-Based Expert SystemsRule-Based Expert SystemsFeaturesFeatures– Knowledge base organized as a set of Knowledge base organized as a set of if … then …if … then … rules rules– Lead to the ES architectureLead to the ES architecture– Natural Natural – Widely usedWidely used
Production system vs. Rule-based ESProduction system vs. Rule-based ES– Similarity: both use rulesSimilarity: both use rules– Production system is a special case of rule-based Production system is a special case of rule-based
systems: production systems: production Condition Condition Action Action can be can be considered as considered as if Condition then Actionif Condition then Action
– Differences: Production systems implement graph Differences: Production systems implement graph search with either goal-driven or data-driven strategy, search with either goal-driven or data-driven strategy, while rule-based ES implements logic reasoningwhile rule-based ES implements logic reasoning
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1313
A small expert system for analysis of automotive problems.
Rule 1:if the engine is getting gas, and the engine will turn over,then the problem is spark plugs.
Rule 2:If the engine does not turn over, and the lights do not come onthen the problem is battery or
cables.
Rule 3:If the engine does not turn over, and the lights do come onthen the problem is the starter motor.
Rule 4:If there is gas in the fuel tank, and there is gas in the carburetorthen the engine is getting gas.
A Production SystemA Production System
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1414
Goal-Driven Problem SolvingGoal-Driven Problem Solving
1. The production system at the start
2. The production system after Rule 1 has fired.
3. The system after Rule 4 has fired.
Note the stack-based approach to goal reduction
Depth-first search
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1515
The and/or graph searched in the car diagnosis example, with the conclusion of Rule 4 matching the first premise of Rule 1.
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1616
1. The production system at the start.
2. The production system after evaluating the first premise of Rule 2, which then fails.
3. The data-driven production system after considering Rule 4, beginning its second pass through the rules.
Breadth-first search
Data-Driven Problem SolvingData-Driven Problem Solving
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1717
The search graph as described by the contents of working memory (WM) for the data-driven breadth-first search of the rule set
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1818
Explanations in ESExplanations in ESTwo general questions to be answered by Two general questions to be answered by rule-based ESs: Why and Howrule-based ESs: Why and HowExplanation in goal-driven reasoningExplanation in goal-driven reasoning– Why Why
When the system asks the user for information and When the system asks the user for information and the user responds “why to ask”the user responds “why to ask”The answer is the current ruleThe answer is the current rule
– How How When the system conclude a solution and the user When the system conclude a solution and the user asks “how to conclude” asks “how to conclude” The answer is the sequence of rules that have been The answer is the sequence of rules that have been usedused
Explanation in data-driven reasoningExplanation in data-driven reasoning– Less-focused on searchLess-focused on search– Limited explanation Limited explanation
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 1919
Explanation in Goal-Driven ReasoningExplanation in Goal-Driven Reasoning
The following dialogue begins with the computer asking the user about the goals present in working memory.
Gas in fuel tank?YesGas in carburetor?YesEngine will turn over?Why It has been established that:1. The engine is getting gas, 2. The engine will turn over,Then the problem is the spark plugs. How the engine is getting gas This follows from rule 4:ifgas in fuel tank, andgas in carburetorthenengine is getting gas.gas in fuel tank was given by the usergas in carburetor was given by the user
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2020
PlanningPlanningFind a sequence of actions to accomplish Find a sequence of actions to accomplish some specific tasksome specific taskKnowledge intensiveKnowledge intensive– Organize pieces of knowledge and partial plans Organize pieces of knowledge and partial plans
into a solution procedureinto a solution procedure
ApplicationsApplications– RoboticsRobotics– Expert systems in reasoning about events Expert systems in reasoning about events
occurring over timeoccurring over time– Process control, monitorProcess control, monitor– Natural language understanding where Natural language understanding where
discussing plans, goals, and intentionsdiscussing plans, goals, and intentions
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2121
RoboticsRoboticsA plan is a set of atomic actionsA plan is a set of atomic actionsAtomic actions are domain-dependentAtomic actions are domain-dependentBlock world robot Block world robot – atomic actions may beatomic actions may be
Pick up object aPick up object aGo to location xGo to location x
– Task: go get block a from room bTask: go get block a from room b– A plan:A plan:
Put down whatever is now heldPut down whatever is now heldGo to room bGo to room bGo over to block aGo over to block aPick up block aPick up block aLeave room bLeave room bReturn to original locationReturn to original location
Planning is to search through a space of possible Planning is to search through a space of possible actions to find the sequence necessary to actions to find the sequence necessary to accomplish the task accomplish the task
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2222
Issues of PlanningIssues of PlanningState description of the worldState description of the world– Possible statesPossible states– Atomic actionsAtomic actions– Effect of actions on the worldEffect of actions on the world
State transitionState transition– Which part changedWhich part changed– Which part unchangedWhich part unchanged– Frame problem: specification of exactly what is changed Frame problem: specification of exactly what is changed
by performing an action on the worldby performing an action on the world
Generating, saving, optimizing plansGenerating, saving, optimizing plansGeneralizing planGeneralizing planRecovering from unexpected plan failureRecovering from unexpected plan failureMaintaining consistency between the world and Maintaining consistency between the world and the system internal model of the worldthe system internal model of the world
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2323
The Blocks WorldThe Blocks WorldThe blocks world consists of 5 blocks, 1 table, and 1 gripper (hand).
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2424
Atomic ActionsAtomic ActionsGoto(X, Y, Z) Goto(X, Y, Z) – go to location (x, y, z)go to location (x, y, z)– This location might be implicit in pickup(W) where block W has location (X, This location might be implicit in pickup(W) where block W has location (X,
Y, Z)Y, Z)Pickup(W) Pickup(W) – pickup and hold block W from the current locationpickup and hold block W from the current location– The block is clear on top, the gripper is empty, and the location of block W The block is clear on top, the gripper is empty, and the location of block W
is knownis knownPutdown(W)Putdown(W)– place W at the current location on the table place W at the current location on the table – W must be heldW must be held– Record the new location for W.Record the new location for W.
Stack(U, V) Stack(U, V) – place U on top of Vplace U on top of V– The gripper must be holding U, and V is clear on topThe gripper must be holding U, and V is clear on top
Unstack(U, V) Unstack(U, V) – remove U from the top of Vremove U from the top of V– U must be clear of other blocks, V must have U on top of it, and the gripper U must be clear of other blocks, V must have U on top of it, and the gripper
must be emptymust be empty
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2525
State RepresentationState RepresentationA set of predicates and predicate relationshipsA set of predicates and predicate relationshipslocation(W, X, Y, Z): block W is at (X, Y, Z)on(X, Y): block X is immediately on top of block Yclear(X): block X has nothing on top of itgripping(X): the robot arm is holding block Xgripping(): the gripper is emptyontable(W): block W is on the table
Initial state
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2626
A number of truth relations or rules for performance are created for the clear (X), ontable (X), and gripping( ).
Rules can be interpreted either logically or procedurally. Consider the first rule.– Logic interpretation: If block X is clear, there does not
exist any block Y such that Y is on top of X Initial state– Procedural interpretation: to clear X, go and remove any
state Y that might be on top of X
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2727
Rules to operate on states and produce new states:
A (B C) means that A produces B when C is trueConsider Rule 4:– For all blocks X, pickup(X) means gripping(X) if the hand
is empty (gripping nothing) and X is clear.
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2828
Frame rules (axioms) to describe what predicates are not changed by rule applications and thus carried over the new states
These two rules say:– ontable is not affected by the stack and unstack operators
May have other frame axioms such as: – on and clear are affected by stack and unstack operators
only when that particular on relation is unstacked or when a clear relation is stacked
– Thus, on(b, a) is not affected by unstacked(c, d)
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 2929
New StateNew State
Operators and frame axioms define a state space
New state by applying the unstack operator and the frame axioms to the nine predicates of the initial state: STATE 1
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 3030
Summarization on PlanningSummarization on PlanningPlanning may be seen as a state space Planning may be seen as a state space searchsearch
New states are produced by general New states are produced by general operators such as stack and unstack plus operators such as stack and unstack plus frame rulesframe rules
The techniques of graph search may be The techniques of graph search may be applied to find a path from the start state applied to find a path from the start state to the goal state. The operators on this to the goal state. The operators on this path constitute a planpath constitute a plan
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 3131
Portion of the state space for blocks world
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 3232
STRIPSSTRIPSSTRIPS – Stanford Research Institute STRIPS – Stanford Research Institute Planning System (now SRI International)Planning System (now SRI International)Drove the SHAKEY robot (1970s)Drove the SHAKEY robot (1970s)Addresses:Addresses:– Efficiently represent and implement the Efficiently represent and implement the
operations of a planneroperations of a planner– Resolve conflicting subgoalsResolve conflicting subgoals– Provide a learning model: save and generalize Provide a learning model: save and generalize
successful plans as macro operators for the successful plans as macro operators for the future usefuture use
Data structure: triangle tables for Data structure: triangle tables for organizing and store macro operationsorganizing and store macro operations
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 3333
Triangle TablesTriangle TablesData structure for organizing sequence of actions, Data structure for organizing sequence of actions, including potentially incompatible subgoalsincluding potentially incompatible subgoalsRelates the pre-conditions to post-conditions Relates the pre-conditions to post-conditions (combined add and delete lists)(combined add and delete lists)Used to determine when a macro operator could Used to determine when a macro operator could be used be used – A macro operator is a sequence of primitive operations A macro operator is a sequence of primitive operations
that perform a subgoalthat perform a subgoal– the problem of conflicting subgoals within macro actions the problem of conflicting subgoals within macro actions
by representing the global interaction of sequences of by representing the global interaction of sequences of operationsoperations
Save macro operators and reuse them in the Save macro operators and reuse them in the future planefuture plane– Reuse macro operators to solve the problem of Reuse macro operators to solve the problem of
conflicting subgoalsconflicting subgoals
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 3434
STRIPS on Blocks WorldSTRIPS on Blocks WorldFour operators Four operators pickup, putdown, stack, and unstack Precodition-Add-Delete approach – P – Precoditions that must be met for the operator– A – Add list to add states that are the result of the operator– D – Delete list to delete items that are removed from a state or
create the new state when the operator is applied
CSC411CSC411 Artificial IntelligenceArtificial Intelligence 3535
Initial state Goal state
• Consider the following goal. on(b,a)Consider the following goal. on(b,a)on(a,c) is part of the goal. on(a,c) is part of the goal. On(b, a) is true in both states, but must be undone.On(b, a) is true in both states, but must be undone.
• If the planner has developed a plan for the subgoal of the form If the planner has developed a plan for the subgoal of the form stack(X, Y)stack(X, Y)stack(Y, Z), it does not need to break the goal into stack(Y, Z), it does not need to break the goal into subgoals and avoids the complicationssubgoals and avoids the complications