Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge...

14
Forward Chaining Systems • also known as Production Systems • commonly used for Expert Systems • knowledge based must consist of facts and rules (Horn clauses, extended with retraction) • will describe the Rete Algorithm – representation of concepts as network or graph

Transcript of Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge...

Page 1: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Forward Chaining Systems

• also known as Production Systems

• commonly used for Expert Systems

• knowledge based must consist of facts and rules (Horn clauses, extended with retraction)

• will describe the Rete Algorithm– representation of concepts as network or

graph

Page 2: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Rete Algorithm• create a network where nodes

represent ground literals (predicates with concrete arguments)

• rules link antecedents to consequent• rules can create new nodes• start by activating nodes

corresponding to facts• each iteration, determine which rules

can fire• pick one and modify network• run until quiescence• produces all the consequences of the

facts

Page 3: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Example Rete Network

Page 4: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Conflict Resolution

• What happens when 2 rules can fire that have opposite effects? e.g assert(P) and retract(P)?– assign numeric priorities to rules – highest

wins– can retract antecedents of other rules

Page 5: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Examples in JESS(deffacts trouble_shooting

(car_problem (name ignition_key) (status on))

(car_problem (name engine) (status wont_start))

(car_problem (name headlights) (status work)) )

(defrule rule1

(car_problem (name ignition_key) (status on))

(car_problem (name engine) (status wont_start)

(car_problem (name battery) (status OK))

=>

assert (car_problem (name starter) (status faulty))) )

(defrule rule2

(car_problem (name headlights) (status work))

=>

assert (car_problem (name battery) (status OK)) )

ignition_key: onstarter: faulty

engine: wont_start

headlights: work battery: OK

(defrule library-rule-1 (book (name ?X) (status late) (borrower ?Y)) (borrower (name ?Y) (address ?Z)) => (send-late-notice ?X ?Y ?Z))

Page 6: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

• Implementations– ACT, SOAR – cognitive models, simulate retrieval

from long-term/short-term memory, activation by association, activation decay

– CLIPS – C-based developed at NASA– JESS – Java-based, popular

• Subsumption Architecture (Rodney Brooks)– intelligent behavior in robots can be produced in a

decentralized way by a lot simple rules interacting– divide behaviors into lower-level basic survival

behaviors that have higher priority, and higher-level goal-directed behaviors

– example: 6-legged robot ants learning to walk

Page 7: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Description Logics

• Theorem: entailment FOL is undecidable• theorem provers like resolution might take a long time to

find a proof• Goal: knowledge representation system in which

inference is more efficient than FOL• solution: restrict expressiveness (e.g. eliminate

disjunction and negation)– remember: proofs with Horn-clauses are linear-time

• will describe several DL systems– see Ch. 1 of Handbook of Description Logics for overview, link

posted on web

• focus on defining taxonomy of concepts• currently popular for web applications (“Semantic Web”)

Page 8: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Concept Description Syntax

• see fig 12.7 (p. 456) in book• T-box – terminological, concept definitions

Concept ::= Thing | ConceptName | AND(Concept...) | All(RoleName,Concept) | AtLeast(Int,RoleName) | AtMost(Int,RoleName) | Fills(RoleName,Individual) | OneOf(Individual...)

– Bachelor = AND(Adult,Male,Unmarried)– MotorCycle = AND(vehicle,AtMost(2,wheels))– HonorStudent ALL(Fills(Grade,A),Fills(ClassTaken,Class))

• A-box – assertional, describe individuals– Male(bob), Fills(sister(bob),sue)

Page 9: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Family of DL languages

• described in Ch. 2 of Handbook of DL

AL family

ALCN: full existential quantification full negation full number restriction

a person who has at most onechild, or 3 or more children includinga daughter

Page 10: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Examples

Page 11: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Inference

• subsumption: is CD?• reduce to satisfiability

– C∩D? is the “bottom” or NULL concept, nothing is in this

set• classification: find all subset relationships in

hierarchy• tableau algorithms

– make model by expanding and re-writing concept definitions, or detect failure

• PSPACE-complete for ALCN

Page 12: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

Semantic Web• OWL - Web Ontology

– extend data in XML with inference rules (written in RDF)

– SHOIQN semantics– for example, if web page A is annotated with

<student> <name>Joe Smith</name> <advisor>Dr. Hank Walker</advisor> <institution>TAMU</institution></student>

• then should be able to infer that Dr. Walker is a faculty member at TAMU

Page 13: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,

• Implementations– old: CLASSIC, KL-ONE, LOOM– modern: Protege

• Applications– medical records

• SNOMED ontology – describes terms for symptoms, diseases, procedures, anatomy, etc.

– Dublin Core• for information retrieval/media archiving• describes books, journals, thesis, authors, publishers, ISBN,

revisions, affiliations, conferences...

Page 14: Forward Chaining Systems also known as Production Systems commonly used for Expert Systems knowledge based must consist of facts and rules (Horn clauses,