Presentation is loading. Please wait.

Presentation is loading. Please wait.

111 Artificial Intelligence CS 165A Thursday, November 15, 2007  Knowledge Representation (Ch 10) 1.

Similar presentations


Presentation on theme: "111 Artificial Intelligence CS 165A Thursday, November 15, 2007  Knowledge Representation (Ch 10) 1."— Presentation transcript:

1 111 Artificial Intelligence CS 165A Thursday, November 15, 2007  Knowledge Representation (Ch 10) 1

2 2 Notes HW assignments –HW#4 due Wednesday (11/21), HW#5 due 12/4 Schedule –Three weeks left –Knowledge representation (Ch. 10), probabilistic reasoning (Ch. 13, 14) –What else?  Planning  Perception (speech, language, vision)  Robotics  Examples of AI research and/or applications Precedence of AND, OR

3 3 Precedence of operators (logical connectives) Levels of precedence, evaluating left to right 1.  (NOT) 2.  (AND, conjunction) 3.  (OR, disjunction) 4.  (implies, conditional) 5.  (equivalence, biconditional) P   Q  R –(P  (  Q))  R P  Q  R –P  (Q  R) P  Q  R  S –P  ((Q  R)  S) Correction to 10/30 Lecture notes, slide #9

4 4 Forward and Backward Chaining Forward chaining –Data driven or data directed –New version of T ELL (KB, p)  Add the sentence p, then apply inference rules to the updated KB until no more rules apply (“chaining” – “chain reaction”) Backward chaining –Goal oriented –A SK (KB, q) –If S UBST ( , q) is in KB, return q' = S UBST ( , q) –Else, find implication sentences p  q then set p as a subgoals  Keep doing this, working “backwards”  If p is not in KB, look for r  p, then set r as a subgoal  Etc….. –Backward chaining is the basis for logic programming (e.g., Prolog) What form would you want your KB to be in to best support backward chaining?

5 5 Forward chaining example KB = { } 1.T ELL (KB, Buffalo(x)  Pig(y)  Outrun(x,y)) 2.T ELL (KB, Pig(x)  Slug(y)  Outrun(x,y)) 3.T ELL (KB, Outrun(x,y)  Outrun(y,z)  Outrun(x,z)) 4.T ELL (KB, Buffalo(Bob)) 5.T ELL (KB, Pig(Pat)) 6.T ELL (KB, Slug(Steve)) What happens at every step?

6 6 Backward chaining example KB: Pig(y)  Slug(z)  Faster(y,z) Slimy(z)  Creeps(z)  Slug(z) Pig(Pat) Slimy(Steve) Creeps(Steve) A SK (KB, Faster(Pat, Steve)) q Is q in KB? No So look for p  q

7 7 At this point we have… A powerful logic (FOL) in which we can express many or most things of interest Two powerful inference rules and their normal forms –Generalized Modus Ponens –Generalized Resolution  Both use unification Ways to convert any FOL sentences (a KB) into normal form (CNF or INF) Inference strategies: data-driven and goal-driven –Forward chaining –Backward chaining Search methods and a problem formulation method

8 8 We have AI, more or less We can now build rational agents that receive percepts, reason about their world and implicit goals, and act upon their world –Problem-solving agents We could also consider how to set goals and subgoals for our agents; how to construct and execute plans that achieve the agent’s goals –Planning agents  Not covering in this course

9 9 Applications of logical reasoning systems Logical reasoning systems often referred to as –Knowledge-based systems –Rule-based systems Two common kinds of reasoning systems –Expert systems –Production systems Knowledge-based systems Expert systems Production systems

10 10 Expert systems Expert system: a computer program embodying knowledge and ability of expert in task domain –Built with the help and guidance of human experts –Seek to perform as well as or better than human experts on specific tasks –Historically rule-based (but less so now – could be probabilistic) –Many in use in business, science, engineering, and the military –Basic underlying theory: Horn KBs with resolution refutation Some examples –Medical diagnosis (MYCIN) –Science (DENDRAL – chemical spectral analysis) –Mathematics theorem proving –Geological exploration –System repair –VLSI chip layout –Help desk –Computer system configuration –Chess

11 11 Production systems A production is a condition-action rule –An “if-then” rule: if condition then action is valid A production system is a knowledge-based system that uses productions to match the state of the KB with applicable actions –p  q  action 1 –r  action 2 Aspects of a production system –A DD (KB, p) with forward chaining –Match phase –Conflict resolution phase –Choice of action Perceive Reason Act

12 12 Production systems (cont.) Match phase: Which rules have left-hand sides (“conditions”) that match the KB? –Rules (productions) are stored separately from knowledge –May have heuristic rules for ordering rule application Conflict resolution phase: Which of the matching rules should be executed? –I.e., which applicable action should be taken? Notes –Examples of early system: R1 for configuring VAX 780s –Led to early versions of expert systems

13 13 Limitations of formal logic Formal logic sometimes doesn’t perform well in the real world –“brittle” if have (hidden) contradiction in KB –Most categories have fuzzy boundaries –Most rules have exceptions –Cause/effect is usually not completely straightforward Examples: –Modus ponens and science –Medical diagnosis Issues: –Handling of arbitrary logical expressions –Complex semantics –Uncertainty –Computational efficiency –Human interaction P  Q Q If a patient has the flu, the patient will have a fever. The patient has a fever. What can be concluded? Answer: Logically, nothing

14 14 Logic and uncertainty For example, consider the rule “Raining(t)  WetGrass(t)” –Is this always true  Can [T,F] be applicable in real world?  What if it’s not raining? –We’d rather know the full relationship between Raining and WetGrass FOL deals with all, not all, some, none –The real world is not so simple Complexity is often manifested as uncertainty –Rather than a very large number of rules that cover every case, we may have a few rules that capture most of the cases –This may be a result of ignorance or laziness We need ways to reason about or in the presence of uncertainty [coming soon, Ch. 13 and 14]

15 15 Knowledge We’ve also mostly finessed the issues regarding what knowledge to represent and how –What is the domain of objects? –How do we represent more complex knowledge than simple predicates? –We can describe object properties and relations between objects, but how to describe actions, situations, and events? –What if the state of the world changes? –Can we reason about categories of objects? Chapter 10 raises these kinds of issues under the topic of knowledge representation

16 16 Thursday quiz Give an English description of the following sentence in FOL using situation calculus:  x, s Studying(x, s)  Failed(x, Result(TakeTest, s))

17 17 Knowledge engineering The process of knowledge base construction (either special-purpose or general-purpose KBs) is called knowledge engineering The knowledge engineering process: –Identify the task –Assemble the relevant knowledge –Decide on a vocabulary of predicated, functions, and constants –Encode general knowledge about the domain –Encode a description of the specific problem instance –Pose queries to the inference procedure and get answers –Debug the knowledge base See the electronic circuits domain example in Section 8.4

18 18 Ontological engineering Ontology – a theory of the nature of being or existence –What exists, what can be known (in a particular domain)? Ontological engineering builds a formal ontology for a particular domain –Defines categories and their relations (e.g., inheritance)  Taxonomy of categories and subcategories –Defines/limits what can possibly be stated, and reasoned about, in the domain Would like to reason about actions, events, and situations –Need a way to efficiently consider time, or time sequences

19 19 Reification Category  Object –Can represent basketballs using the predicate Basketball(x) or by reifying the category as an object, Basketballs  Member (x, Basketballs) –Object x is a member of the category Basketballs  Subset(Basketballs, Balls) –Basketballs is a subcategory of Balls –Class properties apply to specific class objects  x must be spherical, must bounce, etc. –“isa” (member or subclass) relationship  subcategory isa category

20 20 Semantic networks A semantic network is a directed graph consisting of –Vertices – representing concepts –Edges – representing semantic relations between the concepts “Visual logic”

21 21 The Frame Problem The frame problem is the problem of expressing a dynamic domain in logic without explicitly specifying which conditions are not affected by an action –If the light is on at time t 1, do we have to explicitly say it’s on at time t 2 ? –This can become very burdensome.... The frame problem can be addressed (partially) with –Including situations (S i ) that describe the state of the environment at particular points in time  S 0  S 1  S 2 ...  Doesn’t have to represent equally spaced units of time –Representing the results of actions from S i to S j –Having an ontology of time

22 22 Situation Calculus – actions, events “Situation Calculus” is a way of describing change over time in first-order logic –Fluents: Functions or predicates that can vary over time have an extra argument, S i (the situation argument)  Predicate(args, S i )  Location of an agent, aliveness, changing properties,... –The Result function is used to represent change from one situation to another resulting from an action (or action sequence)  Result(GoForward, S i ) = S j  “S j is the situation that results from the action GoForward applied to situation S i  Result() indicates the relationship between situations

23 23 Situation Calculus Represents the world in different “situations” and the relationship between situations

24 24 Situation Calculus Represents the world in different “situations” and the relationship between situations

25 25 Examples How would you interpret the following sentences in First- Order Logic using situation calculus?  x, s Studying(x, s)  Failed(x, Result(TakeTest, s))  x, s TurnedOn(x, s)  LightSwitch(x)  TurnedOff(x, Result(FlipSwitch, s)) If you’re studying and then you take the test, you will fail. (or) Studying a subject implies that you will fail the test for that subject. If you flip the light switch when it is turned on, it will then be turned off.


Download ppt "111 Artificial Intelligence CS 165A Thursday, November 15, 2007  Knowledge Representation (Ch 10) 1."

Similar presentations


Ads by Google