SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
1
Reasoning with Graphs
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
2
Backward Chaining
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
3
ksession.insert( new Location("Office", "House") );
ksession.insert( new Location("Kitchen", "House") );
ksession.insert( new Location("Knife", "Kitchen") );
ksession.insert( new Location("Cheese", "Kitchen") );
ksession.insert( new Location("Desk", "Office") );
ksession.insert( new Location("Chair", "Office") );
ksession.insert( new Location("Computer", "Desk") );
ksession.insert( new Location("Draw", "Desk") );
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
4
rule "go" salience 10
when
$s : String( )
then
System.out.println( $s );
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
5
rule "go1"
when
String( this == "go1" )
isContainedIn("Office", "House"; )
then
System.out.println( "office is in the house" );
end
rule "go" salience 10
when
$s : String( )
then
System.out.println( $s );
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
6
rule "go1"
when
String( this == "go1" )
isContainedIn("Office", "House"; )
then
System.out.println( "office is in the house" );
end
rule "go" salience 10
when
$s : String( )
then
System.out.println( $s );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
7
rule "go1"
when
String( this == "go1" )
isContainedIn("Office", "House"; )
then
System.out.println( "office is in the house" );
end
rule "go" salience 10
when
$s : String( )
then
System.out.println( $s );
end
ksession.insert( "go1" );
ksession.fireAllRules();
---
go1
office is in the house
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
8
rule "go1"
when
String( this == "go1" )
isContainedIn("Office", "House"; )
then
System.out.println( "office is in the house" );
end
rule "go" salience 10
when
$s : String( )
then
System.out.println( $s );
end
ksession.insert( "go1" );
ksession.fireAllRules();
---
go1
office is in the house
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
isContainedIn(x==Office, y==House)
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
9
rule "go1"
when
String( this == "go1" )
isContainedIn("Office", "House"; )
then
System.out.println( "office is in the house" );
end
rule "go" salience 10
when
$s : String( )
then
System.out.println( $s );
end
ksession.insert( "go1" );
ksession.fireAllRules();
---
go1
office is in the house
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Location(x==Office, y==House)
isContainedIn(x==Office, y==House)
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
10
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
11
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
12
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
13
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
isContainedIn(x==Draw, y==House)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
14
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Location(z==Office, y==House)
isContainedIn(x==Draw, y==House)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
15
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Location(z==Office, y==House)
isContainedIn(x==Draw, z==Office)
isContainedIn(x==Draw, y==House)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
16
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Location(z==Office, y==House)
isContainedIn(x==Draw, z==Office)
Location(z==Kitchen, y==House)
isContainedIn(x==Draw, z==Kitchen)
isContainedIn(x==Draw, y==House)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
17
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
isContainedIn(x==Draw, y==Office)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
18
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Location(z==Desk, y==Office)
isContainedIn(x==Draw, y==Office)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
19
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Location(z==Desk, y==Office)
isContainedIn(x==Draw, z==Desk)
isContainedIn(x==Draw, y==Office)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
20
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
isContainedIn(x==Draw, y==Desk)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
21
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
Location(x==Draw, y==Desk)
isContainedIn(x==Draw, y==Desk)
ksession.insert( "go2" );
ksession.fireAllRules();
---
go2
Draw in the House
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
22
rule "go3"
when
String( this == "go3" )
isContainedIn("Key", "Office"; )
then
System.out.println( "Key in the Office" );
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
23
rule "go3"
when
String( this == "go3" )
isContainedIn("Key", "Office"; )
then
System.out.println( "Key in the Office" );
end
ksession.insert( "go3" );
ksession.fireAllRules();
---
go3
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
24
rule "go3"
when
String( this == "go3" )
isContainedIn("Key", "Office"; )
then
System.out.println( "Key in the Office" );
end
ksession.insert( "go3" );
ksession.fireAllRules();
---
go3
ksession.insert( new Location("Key", "Draw") );
ksession.fireAllRules();
---
Key in the Office
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
25
rule "go4"
when
String( this == "go4" )
isContainedIn(thing, "Office"; )
then
System.out.println( "thing " + thing + " is in the Office" );
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
26
rule "go4"
when
String( this == "go4" )
isContainedIn(thing, "Office"; )
then
System.out.println( "thing " + thing + " is in the Office" );
end
Out Var
(unbound)
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
27
rule "go4"
when
String( this == "go4" )
isContainedIn(thing, "Office"; )
then
System.out.println( "thing " + thing + " is in the Office" );
end
ksession.insert( "go4" );
ksession.fireAllRules();
---
go4
thing Key is in the Office
thing Computer is in the Office
thing Draw is in the Office
thing Desk is in the Office
thing Chair is in the Office
Out Var
(unbound)
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
28
rule "go5"
when
String( this == "go5" )
isContainedIn(thing, location; )
then
System.out.println( "thing " + thing + " is in " + location );
end
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
29
rule "go5"
when
String( this == "go5" )
isContainedIn(thing, location; )
then
System.out.println( "thing " + thing + " is in " + location );
end
Out Var
(unbound)
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
30
rule "go5"
when
String( this == "go5" )
isContainedIn(thing, location; )
then
System.out.println( "thing " + thing + " is in " + location );
end
Out Var
(unbound)
Out Var
(unbound)
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13
Backward Chaining
31
rule "go5"
when
String( this == "go5" )
isContainedIn(thing, location; )
then
System.out.println( "thing " + thing + " is in " + location );
end
ksession.insert( "go5" );
ksession.fireAllRules();
---
go5
thing Knife is in House
thing Cheese is in House
thing Key is in House
thing Computer is in House
thing Draw is in House
thing Desk is in House
thing Chair is in House
thing Key is in Office
thing Computer is in Office
thing Draw is in Office
thing Key is in Desk
thing Office is in House
Out Var
(unbound)
Out Var
(unbound)
thing Computer is in Desk
thing Knife is in Kitchen
thing Cheese is in Kitchen
thing Kitchen is in House
thing Key is in Draw
thing Draw is in Desk
thing Desk is in Office
thing Chair is in Office
House
Location("Office",
"House ")
Location("Kitchen",
"House")
Location("Desk",
"Office")
Location("Chair",
"Office")
Location("Computer",
"Desk")
Location("Draw",
"Desk")
Location("Knife",
"Kitchen")
Location("Cheese",
"Kitchen")
Location("Key",
"Draw")
Tuesday, 2 July 13

Weitere ähnliche Inhalte

Mehr von Mark Proctor

Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationMark Proctor
 
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Mark Proctor
 
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Mark Proctor
 
Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016Mark Proctor
 
Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Mark Proctor
 
RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning Mark Proctor
 
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsRed Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsMark Proctor
 
Classic Games Development with Drools
Classic Games Development with DroolsClassic Games Development with Drools
Classic Games Development with DroolsMark Proctor
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Mark Proctor
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 OverviewMark Proctor
 
Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)Mark Proctor
 
UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)Mark Proctor
 
What's new in Drools 6 - London JBUG 2013
What's new in Drools 6 - London JBUG 2013What's new in Drools 6 - London JBUG 2013
What's new in Drools 6 - London JBUG 2013Mark Proctor
 
Property Reactive RuleML 2013
Property Reactive RuleML 2013Property Reactive RuleML 2013
Property Reactive RuleML 2013Mark Proctor
 
Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Mark Proctor
 
Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Mark Proctor
 
UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)Mark Proctor
 
UberFire (JudCon 2013)
UberFire (JudCon 2013)UberFire (JudCon 2013)
UberFire (JudCon 2013)Mark Proctor
 
Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)Mark Proctor
 
Games development with the Drools rule engine
Games development with the Drools rule engineGames development with the Drools rule engine
Games development with the Drools rule engineMark Proctor
 

Mehr von Mark Proctor (20)

Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentation
 
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
 
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
 
Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016
 
Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016
 
RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning
 
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsRed Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
 
Classic Games Development with Drools
Classic Games Development with DroolsClassic Games Development with Drools
Classic Games Development with Drools
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 Overview
 
Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)
 
UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)
 
What's new in Drools 6 - London JBUG 2013
What's new in Drools 6 - London JBUG 2013What's new in Drools 6 - London JBUG 2013
What's new in Drools 6 - London JBUG 2013
 
Property Reactive RuleML 2013
Property Reactive RuleML 2013Property Reactive RuleML 2013
Property Reactive RuleML 2013
 
Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)
 
Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)
 
UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)
 
UberFire (JudCon 2013)
UberFire (JudCon 2013)UberFire (JudCon 2013)
UberFire (JudCon 2013)
 
Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)Drools 6.0 (Red Hat Summit 2013)
Drools 6.0 (Red Hat Summit 2013)
 
Games development with the Drools rule engine
Games development with the Drools rule engineGames development with the Drools rule engine
Games development with the Drools rule engine
 

Kürzlich hochgeladen

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 

Kürzlich hochgeladen (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 

Reactive Transitive Closures with Drools (Backward Chaining)

  • 1. 1 Reasoning with Graphs House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 2. 2 Backward Chaining query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 3. Backward Chaining 3 ksession.insert( new Location("Office", "House") ); ksession.insert( new Location("Kitchen", "House") ); ksession.insert( new Location("Knife", "Kitchen") ); ksession.insert( new Location("Cheese", "Kitchen") ); ksession.insert( new Location("Desk", "Office") ); ksession.insert( new Location("Chair", "Office") ); ksession.insert( new Location("Computer", "Desk") ); ksession.insert( new Location("Draw", "Desk") ); House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 4. Backward Chaining 4 rule "go" salience 10 when $s : String( ) then System.out.println( $s ); end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 5. Backward Chaining 5 rule "go1" when String( this == "go1" ) isContainedIn("Office", "House"; ) then System.out.println( "office is in the house" ); end rule "go" salience 10 when $s : String( ) then System.out.println( $s ); end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 6. Backward Chaining 6 rule "go1" when String( this == "go1" ) isContainedIn("Office", "House"; ) then System.out.println( "office is in the house" ); end rule "go" salience 10 when $s : String( ) then System.out.println( $s ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 7. Backward Chaining 7 rule "go1" when String( this == "go1" ) isContainedIn("Office", "House"; ) then System.out.println( "office is in the house" ); end rule "go" salience 10 when $s : String( ) then System.out.println( $s ); end ksession.insert( "go1" ); ksession.fireAllRules(); --- go1 office is in the house query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 8. Backward Chaining 8 rule "go1" when String( this == "go1" ) isContainedIn("Office", "House"; ) then System.out.println( "office is in the house" ); end rule "go" salience 10 when $s : String( ) then System.out.println( $s ); end ksession.insert( "go1" ); ksession.fireAllRules(); --- go1 office is in the house query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end isContainedIn(x==Office, y==House) House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 9. Backward Chaining 9 rule "go1" when String( this == "go1" ) isContainedIn("Office", "House"; ) then System.out.println( "office is in the house" ); end rule "go" salience 10 when $s : String( ) then System.out.println( $s ); end ksession.insert( "go1" ); ksession.fireAllRules(); --- go1 office is in the house query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Location(x==Office, y==House) isContainedIn(x==Office, y==House) House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 10. Backward Chaining 10 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 11. Backward Chaining 11 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 12. Backward Chaining 12 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 13. Backward Chaining 13 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end isContainedIn(x==Draw, y==House) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 14. Backward Chaining 14 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Location(z==Office, y==House) isContainedIn(x==Draw, y==House) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 15. Backward Chaining 15 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Location(z==Office, y==House) isContainedIn(x==Draw, z==Office) isContainedIn(x==Draw, y==House) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 16. Backward Chaining 16 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Location(z==Office, y==House) isContainedIn(x==Draw, z==Office) Location(z==Kitchen, y==House) isContainedIn(x==Draw, z==Kitchen) isContainedIn(x==Draw, y==House) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 17. Backward Chaining 17 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end isContainedIn(x==Draw, y==Office) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 18. Backward Chaining 18 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Location(z==Desk, y==Office) isContainedIn(x==Draw, y==Office) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 19. Backward Chaining 19 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Location(z==Desk, y==Office) isContainedIn(x==Draw, z==Desk) isContainedIn(x==Draw, y==Office) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 20. Backward Chaining 20 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end isContainedIn(x==Draw, y==Desk) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 21. Backward Chaining 21 rule "go2" when String( this == "go2" ) isContainedIn("Draw", "House"; ) then System.out.println( "Draw in the House" ); end query isContainedIn( String x, String y ) Location( x, y; ) or ( Location( z, y; ) and isContainedIn( x, z; ) ) end Location(x==Draw, y==Desk) isContainedIn(x==Draw, y==Desk) ksession.insert( "go2" ); ksession.fireAllRules(); --- go2 Draw in the House House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 22. Backward Chaining 22 rule "go3" when String( this == "go3" ) isContainedIn("Key", "Office"; ) then System.out.println( "Key in the Office" ); end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 23. Backward Chaining 23 rule "go3" when String( this == "go3" ) isContainedIn("Key", "Office"; ) then System.out.println( "Key in the Office" ); end ksession.insert( "go3" ); ksession.fireAllRules(); --- go3 House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 24. Backward Chaining 24 rule "go3" when String( this == "go3" ) isContainedIn("Key", "Office"; ) then System.out.println( "Key in the Office" ); end ksession.insert( "go3" ); ksession.fireAllRules(); --- go3 ksession.insert( new Location("Key", "Draw") ); ksession.fireAllRules(); --- Key in the Office House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 25. Backward Chaining 25 rule "go4" when String( this == "go4" ) isContainedIn(thing, "Office"; ) then System.out.println( "thing " + thing + " is in the Office" ); end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 26. Backward Chaining 26 rule "go4" when String( this == "go4" ) isContainedIn(thing, "Office"; ) then System.out.println( "thing " + thing + " is in the Office" ); end Out Var (unbound) House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 27. Backward Chaining 27 rule "go4" when String( this == "go4" ) isContainedIn(thing, "Office"; ) then System.out.println( "thing " + thing + " is in the Office" ); end ksession.insert( "go4" ); ksession.fireAllRules(); --- go4 thing Key is in the Office thing Computer is in the Office thing Draw is in the Office thing Desk is in the Office thing Chair is in the Office Out Var (unbound) House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 28. Backward Chaining 28 rule "go5" when String( this == "go5" ) isContainedIn(thing, location; ) then System.out.println( "thing " + thing + " is in " + location ); end House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 29. Backward Chaining 29 rule "go5" when String( this == "go5" ) isContainedIn(thing, location; ) then System.out.println( "thing " + thing + " is in " + location ); end Out Var (unbound) House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 30. Backward Chaining 30 rule "go5" when String( this == "go5" ) isContainedIn(thing, location; ) then System.out.println( "thing " + thing + " is in " + location ); end Out Var (unbound) Out Var (unbound) House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13
  • 31. Backward Chaining 31 rule "go5" when String( this == "go5" ) isContainedIn(thing, location; ) then System.out.println( "thing " + thing + " is in " + location ); end ksession.insert( "go5" ); ksession.fireAllRules(); --- go5 thing Knife is in House thing Cheese is in House thing Key is in House thing Computer is in House thing Draw is in House thing Desk is in House thing Chair is in House thing Key is in Office thing Computer is in Office thing Draw is in Office thing Key is in Desk thing Office is in House Out Var (unbound) Out Var (unbound) thing Computer is in Desk thing Knife is in Kitchen thing Cheese is in Kitchen thing Kitchen is in House thing Key is in Draw thing Draw is in Desk thing Desk is in Office thing Chair is in Office House Location("Office", "House ") Location("Kitchen", "House") Location("Desk", "Office") Location("Chair", "Office") Location("Computer", "Desk") Location("Draw", "Desk") Location("Knife", "Kitchen") Location("Cheese", "Kitchen") Location("Key", "Draw") Tuesday, 2 July 13