ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Ontology Model and OWL
STANLEY WANG
SOLUTION ARCHITECT, TECH LEAD
@SWANG68
http://www.linkedin.com/in/stanley-wang-a2b143b
Web Ontology Language (OWL)
? OWL is based on Description Logics knowledge representation
formalism;
? W3C standard recommendation in 2004;
? OWL is a richer vocabulary description language for describing
properties and classes;
? Layered on top of RDF & RDFS and has a rich set of constructs;
? Explicitly represents meaning of terms in vocabularies and the
relationships between those terms
? Supports inference;
OWL is a language for defining Ontologies Model and their
associated Knowledge Bases
Components of an OWL Ontology
? Individuals
? Classes
? Properties
Research
Methods in IT
Philippines
Clement
Acosta
Advanced
Accounting
Kenya
UK
isCitizenOf
hasColleague
hasWritten
Employee
Publication
Country
The Three Species of OWL
? OWL-Full
? No restrictions on how/where language constructs can be used.
? Full union of OWL and RDF Schema and not decidable.
? OWL-DL
? Restricted version to FOL fragment of OWL-Full.
? Corresponds to a description logic.
? Certain restrictions on how/where language constructs can be used
in order to guarantee decidability.
? OWL-Lite
? A subset of OWL-DL.
? Simplest and easiest to implement of the three species.
Tools to build Ontologies exists e.g. ±Ê°ù´Ç³Ù¨¦²µ¨¦
Separate layers have been defined balancing expressibility vs.
implementability (OWL Lite, OWL DL, OWL Full)
Automated reasoning over ontologies that are written in OWL-Lite and OWL-DL.
Example
? There are two types of animals, Male and Female.
<rdfs:Class rdf:ID="Male">
<rdfs:subClassOf rdf:resource="#Animal"/>
</rdfs:Class>
? The subClassOf element asserts that its subject - Male - is a
subclass of its object -- the resource identified by #Animal.
<rdfs:Class rdf:ID="Female">
<rdfs:subClassOf rdf:resource="#Animal"/>
<owl:disjointWith rdf:resource="#Male"/>
</rdfs:Class>
? Some animals are Female, too, but nothing can be both
Male and Female (in this ontology) because these two
classes are disjoint (using the disjointWith tag).
OWL Features
? Class
¨C Person superclass
¨C Man, Woman subclasses
? Properties
¨C isWifeOf, isHusbandOf
? Property characteristics, restrictions
¨C inverseOf
¨C domain
¨C range
¨C Cardinality
? Class expressions
¨C disjointWith
? Symmetric: if P(x, y) then P(y, x)
? Transitive: if P(x,y) and P(y,z) then P(x, z)
? Functional: if P(x,y) and P(x,z) then y=z
? InverseOf: if P1(x,y) then P2(y,x)
? InverseFunctional: if P(y,x) and P(z,x) then y=z
? allValuesFrom: P(x,y) and y=allValuesFrom(C)
? someValuesFrom: P(x,y) and y=someValuesFrom(C)
? hasValue: P(x,y) and y=hasValue(v)
? cardinality: cardinality(P) = N
? minCardinality: minCardinality(P) = N
? maxCardinality: maxCardinality(P) = N
? equivalentProperty: P1 = P2
? intersectionOf: C = intersectionOf(C1, C2, ¡­)
? unionOf: C = unionOf(C1, C2, ¡­)
? complementOf: C = complementOf(C1)
? oneOf: C = one of(v1, v2, ¡­)
? equivalentClass: C1 = C2
? disjointWith: C1 != C2
? sameIndividualAs: I1 = I2
? differentFrom: I1 != I2
? AllDifferent: I1 != I2, I1 != I3, I2 != I3, ¡­
? Thing: I1, I2, ¡­
All In One on OWL
Legend:
Properties are indicated by: P, P1,
P2, etc
Specific classes are indicated by:
x, y, z
Generic classes are indicated by:
C, C1, C2
Values are indicated by: v, v1, v2
Instance documents are indicated
by: I1, I2, I3, etc.
A number is indicated by: N
P(x,y) is read as: ¡°property P
relates x to y¡±
OWL Example
? Woman ¡Ô Person ? Female
? Man ¡Ô Person ? ?Woman
? Mother ¡Ô Woman ? ?hasChild.Person
? Father ¡Ô Man ? ?hasChild.Person
? Parent ¡Ô Father ? Mother
? Grandmother ¡Ô Mother ? ?hasChild.Parent
We can further infer (though not explicitly stated):
? Grandmother ? Person
Grandmother ? Man ? Woman
etc.
OWL Example in ±Ê°ù´Ç³Ù¨¦²µ¨¦
OWL Example in ±Ê°ù´Ç³Ù¨¦²µ¨¦
11
Rules
? OWL DL and OWL Lite are based on Description Logic; there
are things that DL cannot express
o Attempts to combine ontologies and rules include RuleML, SWRL,
cwm, etc.
? There is also an increasing number of rule-based systems
that want to interchange rules
? The W3C Rule Interchange Format Working Group is
focused on this area
Trust & Rules
? Claims can be verified if there is supporting evidence
from another (trusted) source
¨C Only believe that someone is a professor at a
university if the university also claims that person
is a professor, and the university is on a list I trust.
believe(c1) :- claims(x, c1) ^ predicate(c1, professorAt) ^
arg1(c1, x) ^ arg2(c1, y) ^ claims(c2, y) ^
predicate(c2, professorAt) ^ arg1(c2, x) ^
arg2(c2, y) ^ AccreditedUniversity(y)
AcknowledgedUniversity(u) :- link-from(¡°http://www.cs.umd.edu/university-list¡±,u)
Notice this one
Rules on top of Semantic Web
(¡°Metasemantics¡±)
?????????????
Ïðîäóêöèîííû?
ïðàâèë? ïðàâèë?
Âðåìåííû?
ïðàâèë?
Ñåìàíòè÷åñêè?
Ñåìàíòè÷åñêà
ñåòü
1
2
3
5
4
10
11 8
9
6
7
R T
S
P
M
Production
Rules
Temporal
Rules
Semantic
Rules
Semantic
Web
Metasemantics
State of a Semantic Net
)A,L,(AP)A,L,(AP=S(t) qnmt
0=)qA,nL,m(AtP
qn,m,
jkit
1=)jA,kL,i(AtP
kj,i,
??
??
?
?? )A,L,P(A)A,L,P(A=S(t) 221211 )A,L,P(A)A,L,P(A 342232 ?
A1 A
A2
3
L1
L
L
L
2
3
4
P = P(A ,L ,A )1 1 1 2 P = P(A ,L ,A )2 1 2 2
P = P(A ,L ,A )3 2 3 2 P = P(A ,L ,A )4 2 4 3
4321 PPPP=S(t) ???
Production Rules
kii PTHEN)IF(S:R
kjj PTHEN)IF(S:R
iki SP=S ?
jkj SP=S ?
.PTHEN))PP(PP(IF:R 243121 ???
A1 A
A2
3
L1
L
L
3
4
A1 A
A2
3
L1
L
L
L
2
3
4
,*)ii LP(*,=P
Production-Based Reasoning
Initial state
State after n
transformations
Set of Production
Rules
S(t0) S(t0+n¡¤¦Ó)
Example (Model Description)
1. Mary will love John if he loves her and if he is not abusing Pete.
2. Pete will consider Mary as his friend if she is not in love with John.
3. Pete will not consider Mary as his friend if she is in love with John who is
abusing him.
4. John will stop loving Mary if she does not love him or she is a friend of Pete.
5. Mary will stop loving John if he is abusing Pete.
6. John being in bad mood will abuse Pete.
7. John gets rid of bad mood if Mary loves him or if she is not a friend of Pete.
8. John will fall in a bad mood if he loves Mary and she does not love him or
vice versa.
9. John will stop abusing Pete if he (John) does not love Mary any more or if she
is not a friend of Pete.
Example (Formalised Rules)
R : IF (P P P ) THEN P1 1 4 2 2? ? ;
R : IF (P P ) THEN P2 2 3 3? ;
R : IF (P P P ) THEN P3 2 4 3 3? ? ;
R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ;
R : IF (P P ) THEN P5 2 4 2? ;
R : IF (P P ) THEN P6 5 4 4? ;
R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ;
R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ;
R : IF ((P P ) P ) THEN P9 1 3 4 4? ? .
1. Mary will love John if he loves her and if he
is not abusing Pete.
2. Pete will consider Mary as his friend if she is
not in love with John.
3. Pete will not consider Mary as his friend if
she is in love with John who is abusing him.
4. John will stop loving Mary if she does not
love him or she is a friend of Pete.
5. Mary will stop loving John if he is abusing
Pete.
6. John being in bad mood will abuse Pete.
7. John gets rid of bad mood if Mary loves
him or if she is not a friend of Pete.
8. John will fall in a bad mood if he loves Mary
and she does not love him or vice versa.
9. John will stop abusing Pete if he (John) does
not love Mary any more or if she is not a friend
of Pete.
P1 = P(A1, L1, A2) - John loves Mary;
P2 = P(A2, L1, A1) - Mary loves John;
P3 = P(A3, L2, A2) - Pete has a friend Mary;
P4 = P(A1, L3, A3) - John is abusing Pete;
P5 = P(A1, L4, A1) - John has a bad mood.
Example (Reasoning, 1-st step)
John Mary
Pete
to love
to have a friend
543210 PPPPP=)S(t ????
R : IF (P P P ) THEN P1 1 4 2 2? ? ;
R : IF (P P ) THEN P2 2 3 3? ;
R : IF (P P P ) THEN P3 2 4 3 3? ? ;
R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ;
R : IF (P P ) THEN P5 2 4 2? ;
R : IF (P P ) THEN P6 5 4 4? ;
R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ;
R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ;
R : IF ((P P ) P ) THEN P9 1 3 4 4? ? .
543210 PPPPP=)S(t ??????
Example (Reasoning, 2-nd step)
John Mary
Pete
to love
to have a friend
R : IF (P P P ) THEN P1 1 4 2 2? ? ;
R : IF (P P ) THEN P2 2 3 3? ;
R : IF (P P P ) THEN P3 2 4 3 3? ? ;
R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ;
R : IF (P P ) THEN P5 2 4 2? ;
R : IF (P P ) THEN P6 5 4 4? ;
R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ;
R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ;
R : IF ((P P ) P ) THEN P9 1 3 4 4? ? .
543210 PPPPP=)S(t ??????
543210 PPPPP=)S(t ?????? ?2
to have a bad mood
Example (Reasoning, 3-rd step)
John Mary
Pete
to love
to have a friend
R : IF (P P P ) THEN P1 1 4 2 2? ? ;
R : IF (P P ) THEN P2 2 3 3? ;
R : IF (P P P ) THEN P3 2 4 3 3? ? ;
R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ;
R : IF (P P ) THEN P5 2 4 2? ;
R : IF (P P ) THEN P6 5 4 4? ;
R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ;
R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ;
R : IF ((P P ) P ) THEN P9 1 3 4 4? ? .
543210 PPPPP=)S(t ?????? ?2
to abuse
543210 PPPPP=)S(t ?????? ?3
Example (reasoning, 4-th step)
John Mary
Pete
R : IF (P P P ) THEN P1 1 4 2 2? ? ;
R : IF (P P ) THEN P2 2 3 3? ;
R : IF (P P P ) THEN P3 2 4 3 3? ? ;
R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ;
R : IF (P P ) THEN P5 2 4 2? ;
R : IF (P P ) THEN P6 5 4 4? ;
R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ;
R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ;
R : IF ((P P ) P ) THEN P9 1 3 4 4? ? .
543210 PPPPP=)S(t ?????? ?3
to have a bad mood
543210 PPPPP=)S(t ?????? ?4
Example (Reasoning, 5-th step)
John Mary
Pete
R : IF (P P P ) THEN P1 1 4 2 2? ? ;
R : IF (P P ) THEN P2 2 3 3? ;
R : IF (P P P ) THEN P3 2 4 3 3? ? ;
R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ;
R : IF (P P ) THEN P5 2 4 2? ;
R : IF (P P ) THEN P6 5 4 4? ;
R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ;
R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ;
R : IF ((P P ) P ) THEN P9 1 3 4 4? ? .
543210 PPPPP=)S(t ?????? ?4
543210 PPPPP=)S(t ?????? ?5
to abuse to have a friend
Example (Reasoning, Reaching terminal state)
John Mary
Pete
R : IF (P P P ) THEN P1 1 4 2 2? ? ;
R : IF (P P ) THEN P2 2 3 3? ;
R : IF (P P P ) THEN P3 2 4 3 3? ? ;
R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ;
R : IF (P P ) THEN P5 2 4 2? ;
R : IF (P P ) THEN P6 5 4 4? ;
R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ;
R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ;
R : IF ((P P ) P ) THEN P9 1 3 4 4? ? .
543210 PPPPP=)S(t ?????? ?5
to have a friend
terminal state
Example (Asynchronous Reasoning Tree)
54321 PPPPP ????
R : IF (P P P ) THEN P1 1 4 2 2? ? ;
R : IF (P P ) THEN P2 2 3 3? ;
R : IF (P P P ) THEN P3 2 4 3 3? ? ;
R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ;
R : IF (P P ) THEN P5 2 4 2? ;
R : IF (P P ) THEN P6 5 4 4? ;
R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ;
R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ;
R : IF ((P P ) P ) THEN P9 1 3 4 4? ? .
54321 PPPPP ????
54321 PPPPP ???? 54321 PPPPP ????
R1
R4
R8
54321 PPPPP ????
R4
R1
54321 PPPPP ????
R6
54321 PPPPP ????54321 PPPPP ????
R4
54321 PPPPP ????
R8
R4 R6
54321 PPPPP ????
R4
54321 PPPPP ????
R6
54321 PPPPP ????R9
54321 PPPPP ????
R5
R3
R7
54321 PPPPP ???? 54321 PPPPP ????54321 PPPPP ????
R5
R9 R7
R3
54321 PPPPP ????
R5
R8
R9
R2
54321 PPPPP ????
R7
54321 PPPPP ????
R9
54321 PPPPP ????
R6 R7R5
R8
R9
R9
54321 PPPPP ????
R9 R2
R2
R6
R7
R9
R2
R8

More Related Content

Ontology model and owl

  • 1. Ontology Model and OWL STANLEY WANG SOLUTION ARCHITECT, TECH LEAD @SWANG68 http://www.linkedin.com/in/stanley-wang-a2b143b
  • 2. Web Ontology Language (OWL) ? OWL is based on Description Logics knowledge representation formalism; ? W3C standard recommendation in 2004; ? OWL is a richer vocabulary description language for describing properties and classes; ? Layered on top of RDF & RDFS and has a rich set of constructs; ? Explicitly represents meaning of terms in vocabularies and the relationships between those terms ? Supports inference; OWL is a language for defining Ontologies Model and their associated Knowledge Bases
  • 3. Components of an OWL Ontology ? Individuals ? Classes ? Properties Research Methods in IT Philippines Clement Acosta Advanced Accounting Kenya UK isCitizenOf hasColleague hasWritten Employee Publication Country
  • 4. The Three Species of OWL ? OWL-Full ? No restrictions on how/where language constructs can be used. ? Full union of OWL and RDF Schema and not decidable. ? OWL-DL ? Restricted version to FOL fragment of OWL-Full. ? Corresponds to a description logic. ? Certain restrictions on how/where language constructs can be used in order to guarantee decidability. ? OWL-Lite ? A subset of OWL-DL. ? Simplest and easiest to implement of the three species. Tools to build Ontologies exists e.g. ±Ê°ù´Ç³Ù¨¦²µ¨¦ Separate layers have been defined balancing expressibility vs. implementability (OWL Lite, OWL DL, OWL Full) Automated reasoning over ontologies that are written in OWL-Lite and OWL-DL.
  • 5. Example ? There are two types of animals, Male and Female. <rdfs:Class rdf:ID="Male"> <rdfs:subClassOf rdf:resource="#Animal"/> </rdfs:Class> ? The subClassOf element asserts that its subject - Male - is a subclass of its object -- the resource identified by #Animal. <rdfs:Class rdf:ID="Female"> <rdfs:subClassOf rdf:resource="#Animal"/> <owl:disjointWith rdf:resource="#Male"/> </rdfs:Class> ? Some animals are Female, too, but nothing can be both Male and Female (in this ontology) because these two classes are disjoint (using the disjointWith tag).
  • 6. OWL Features ? Class ¨C Person superclass ¨C Man, Woman subclasses ? Properties ¨C isWifeOf, isHusbandOf ? Property characteristics, restrictions ¨C inverseOf ¨C domain ¨C range ¨C Cardinality ? Class expressions ¨C disjointWith
  • 7. ? Symmetric: if P(x, y) then P(y, x) ? Transitive: if P(x,y) and P(y,z) then P(x, z) ? Functional: if P(x,y) and P(x,z) then y=z ? InverseOf: if P1(x,y) then P2(y,x) ? InverseFunctional: if P(y,x) and P(z,x) then y=z ? allValuesFrom: P(x,y) and y=allValuesFrom(C) ? someValuesFrom: P(x,y) and y=someValuesFrom(C) ? hasValue: P(x,y) and y=hasValue(v) ? cardinality: cardinality(P) = N ? minCardinality: minCardinality(P) = N ? maxCardinality: maxCardinality(P) = N ? equivalentProperty: P1 = P2 ? intersectionOf: C = intersectionOf(C1, C2, ¡­) ? unionOf: C = unionOf(C1, C2, ¡­) ? complementOf: C = complementOf(C1) ? oneOf: C = one of(v1, v2, ¡­) ? equivalentClass: C1 = C2 ? disjointWith: C1 != C2 ? sameIndividualAs: I1 = I2 ? differentFrom: I1 != I2 ? AllDifferent: I1 != I2, I1 != I3, I2 != I3, ¡­ ? Thing: I1, I2, ¡­ All In One on OWL Legend: Properties are indicated by: P, P1, P2, etc Specific classes are indicated by: x, y, z Generic classes are indicated by: C, C1, C2 Values are indicated by: v, v1, v2 Instance documents are indicated by: I1, I2, I3, etc. A number is indicated by: N P(x,y) is read as: ¡°property P relates x to y¡±
  • 8. OWL Example ? Woman ¡Ô Person ? Female ? Man ¡Ô Person ? ?Woman ? Mother ¡Ô Woman ? ?hasChild.Person ? Father ¡Ô Man ? ?hasChild.Person ? Parent ¡Ô Father ? Mother ? Grandmother ¡Ô Mother ? ?hasChild.Parent We can further infer (though not explicitly stated): ? Grandmother ? Person Grandmother ? Man ? Woman etc.
  • 9. OWL Example in ±Ê°ù´Ç³Ù¨¦²µ¨¦
  • 10. OWL Example in ±Ê°ù´Ç³Ù¨¦²µ¨¦
  • 11. 11 Rules ? OWL DL and OWL Lite are based on Description Logic; there are things that DL cannot express o Attempts to combine ontologies and rules include RuleML, SWRL, cwm, etc. ? There is also an increasing number of rule-based systems that want to interchange rules ? The W3C Rule Interchange Format Working Group is focused on this area
  • 12. Trust & Rules ? Claims can be verified if there is supporting evidence from another (trusted) source ¨C Only believe that someone is a professor at a university if the university also claims that person is a professor, and the university is on a list I trust. believe(c1) :- claims(x, c1) ^ predicate(c1, professorAt) ^ arg1(c1, x) ^ arg2(c1, y) ^ claims(c2, y) ^ predicate(c2, professorAt) ^ arg1(c2, x) ^ arg2(c2, y) ^ AccreditedUniversity(y) AcknowledgedUniversity(u) :- link-from(¡°http://www.cs.umd.edu/university-list¡±,u) Notice this one
  • 13. Rules on top of Semantic Web (¡°Metasemantics¡±) ????????????? Ïðîäóêöèîííû? ïðàâèë? ïðàâèë? Âðåìåííû? ïðàâèë? Ñåìàíòè÷åñêè? Ñåìàíòè÷åñêà ñåòü 1 2 3 5 4 10 11 8 9 6 7 R T S P M Production Rules Temporal Rules Semantic Rules Semantic Web Metasemantics
  • 14. State of a Semantic Net )A,L,(AP)A,L,(AP=S(t) qnmt 0=)qA,nL,m(AtP qn,m, jkit 1=)jA,kL,i(AtP kj,i, ?? ?? ? ?? )A,L,P(A)A,L,P(A=S(t) 221211 )A,L,P(A)A,L,P(A 342232 ? A1 A A2 3 L1 L L L 2 3 4 P = P(A ,L ,A )1 1 1 2 P = P(A ,L ,A )2 1 2 2 P = P(A ,L ,A )3 2 3 2 P = P(A ,L ,A )4 2 4 3 4321 PPPP=S(t) ???
  • 15. Production Rules kii PTHEN)IF(S:R kjj PTHEN)IF(S:R iki SP=S ? jkj SP=S ? .PTHEN))PP(PP(IF:R 243121 ??? A1 A A2 3 L1 L L 3 4 A1 A A2 3 L1 L L L 2 3 4 ,*)ii LP(*,=P
  • 16. Production-Based Reasoning Initial state State after n transformations Set of Production Rules S(t0) S(t0+n¡¤¦Ó)
  • 17. Example (Model Description) 1. Mary will love John if he loves her and if he is not abusing Pete. 2. Pete will consider Mary as his friend if she is not in love with John. 3. Pete will not consider Mary as his friend if she is in love with John who is abusing him. 4. John will stop loving Mary if she does not love him or she is a friend of Pete. 5. Mary will stop loving John if he is abusing Pete. 6. John being in bad mood will abuse Pete. 7. John gets rid of bad mood if Mary loves him or if she is not a friend of Pete. 8. John will fall in a bad mood if he loves Mary and she does not love him or vice versa. 9. John will stop abusing Pete if he (John) does not love Mary any more or if she is not a friend of Pete.
  • 18. Example (Formalised Rules) R : IF (P P P ) THEN P1 1 4 2 2? ? ; R : IF (P P ) THEN P2 2 3 3? ; R : IF (P P P ) THEN P3 2 4 3 3? ? ; R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ; R : IF (P P ) THEN P5 2 4 2? ; R : IF (P P ) THEN P6 5 4 4? ; R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ; R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ; R : IF ((P P ) P ) THEN P9 1 3 4 4? ? . 1. Mary will love John if he loves her and if he is not abusing Pete. 2. Pete will consider Mary as his friend if she is not in love with John. 3. Pete will not consider Mary as his friend if she is in love with John who is abusing him. 4. John will stop loving Mary if she does not love him or she is a friend of Pete. 5. Mary will stop loving John if he is abusing Pete. 6. John being in bad mood will abuse Pete. 7. John gets rid of bad mood if Mary loves him or if she is not a friend of Pete. 8. John will fall in a bad mood if he loves Mary and she does not love him or vice versa. 9. John will stop abusing Pete if he (John) does not love Mary any more or if she is not a friend of Pete. P1 = P(A1, L1, A2) - John loves Mary; P2 = P(A2, L1, A1) - Mary loves John; P3 = P(A3, L2, A2) - Pete has a friend Mary; P4 = P(A1, L3, A3) - John is abusing Pete; P5 = P(A1, L4, A1) - John has a bad mood.
  • 19. Example (Reasoning, 1-st step) John Mary Pete to love to have a friend 543210 PPPPP=)S(t ???? R : IF (P P P ) THEN P1 1 4 2 2? ? ; R : IF (P P ) THEN P2 2 3 3? ; R : IF (P P P ) THEN P3 2 4 3 3? ? ; R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ; R : IF (P P ) THEN P5 2 4 2? ; R : IF (P P ) THEN P6 5 4 4? ; R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ; R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ; R : IF ((P P ) P ) THEN P9 1 3 4 4? ? . 543210 PPPPP=)S(t ??????
  • 20. Example (Reasoning, 2-nd step) John Mary Pete to love to have a friend R : IF (P P P ) THEN P1 1 4 2 2? ? ; R : IF (P P ) THEN P2 2 3 3? ; R : IF (P P P ) THEN P3 2 4 3 3? ? ; R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ; R : IF (P P ) THEN P5 2 4 2? ; R : IF (P P ) THEN P6 5 4 4? ; R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ; R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ; R : IF ((P P ) P ) THEN P9 1 3 4 4? ? . 543210 PPPPP=)S(t ?????? 543210 PPPPP=)S(t ?????? ?2 to have a bad mood
  • 21. Example (Reasoning, 3-rd step) John Mary Pete to love to have a friend R : IF (P P P ) THEN P1 1 4 2 2? ? ; R : IF (P P ) THEN P2 2 3 3? ; R : IF (P P P ) THEN P3 2 4 3 3? ? ; R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ; R : IF (P P ) THEN P5 2 4 2? ; R : IF (P P ) THEN P6 5 4 4? ; R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ; R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ; R : IF ((P P ) P ) THEN P9 1 3 4 4? ? . 543210 PPPPP=)S(t ?????? ?2 to abuse 543210 PPPPP=)S(t ?????? ?3
  • 22. Example (reasoning, 4-th step) John Mary Pete R : IF (P P P ) THEN P1 1 4 2 2? ? ; R : IF (P P ) THEN P2 2 3 3? ; R : IF (P P P ) THEN P3 2 4 3 3? ? ; R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ; R : IF (P P ) THEN P5 2 4 2? ; R : IF (P P ) THEN P6 5 4 4? ; R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ; R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ; R : IF ((P P ) P ) THEN P9 1 3 4 4? ? . 543210 PPPPP=)S(t ?????? ?3 to have a bad mood 543210 PPPPP=)S(t ?????? ?4
  • 23. Example (Reasoning, 5-th step) John Mary Pete R : IF (P P P ) THEN P1 1 4 2 2? ? ; R : IF (P P ) THEN P2 2 3 3? ; R : IF (P P P ) THEN P3 2 4 3 3? ? ; R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ; R : IF (P P ) THEN P5 2 4 2? ; R : IF (P P ) THEN P6 5 4 4? ; R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ; R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ; R : IF ((P P ) P ) THEN P9 1 3 4 4? ? . 543210 PPPPP=)S(t ?????? ?4 543210 PPPPP=)S(t ?????? ?5 to abuse to have a friend
  • 24. Example (Reasoning, Reaching terminal state) John Mary Pete R : IF (P P P ) THEN P1 1 4 2 2? ? ; R : IF (P P ) THEN P2 2 3 3? ; R : IF (P P P ) THEN P3 2 4 3 3? ? ; R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ; R : IF (P P ) THEN P5 2 4 2? ; R : IF (P P ) THEN P6 5 4 4? ; R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ; R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ; R : IF ((P P ) P ) THEN P9 1 3 4 4? ? . 543210 PPPPP=)S(t ?????? ?5 to have a friend terminal state
  • 25. Example (Asynchronous Reasoning Tree) 54321 PPPPP ???? R : IF (P P P ) THEN P1 1 4 2 2? ? ; R : IF (P P ) THEN P2 2 3 3? ; R : IF (P P P ) THEN P3 2 4 3 3? ? ; R : IF ((P P ) P ) THEN P4 3 2 1 1? ? ; R : IF (P P ) THEN P5 2 4 2? ; R : IF (P P ) THEN P6 5 4 4? ; R : IF ((P P ) P ) THEN P7 2 3 5 5? ? ; R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5? ? ? ? ; R : IF ((P P ) P ) THEN P9 1 3 4 4? ? . 54321 PPPPP ???? 54321 PPPPP ???? 54321 PPPPP ???? R1 R4 R8 54321 PPPPP ???? R4 R1 54321 PPPPP ???? R6 54321 PPPPP ????54321 PPPPP ???? R4 54321 PPPPP ???? R8 R4 R6 54321 PPPPP ???? R4 54321 PPPPP ???? R6 54321 PPPPP ????R9 54321 PPPPP ???? R5 R3 R7 54321 PPPPP ???? 54321 PPPPP ????54321 PPPPP ???? R5 R9 R7 R3 54321 PPPPP ???? R5 R8 R9 R2 54321 PPPPP ???? R7 54321 PPPPP ???? R9 54321 PPPPP ???? R6 R7R5 R8 R9 R9 54321 PPPPP ???? R9 R2 R2 R6 R7 R9 R2 R8