Reputation: 225
I attended a webinar and learned Grakn supports reasoning through rule based and type based reasoning:
person sub entity;
man sub person;
when {
$r1 (located: $x, locating: $y) isa locates;
$r2 (located: $y, locating: $z) isa locates;
},
then {
(located: $x, locating: $z) isa locates;
};
How does backward reasoning differ from forward chaining in this context?
Upvotes: 1
Views: 127
Reputation: 920
It's easiest to see the difference from the kind of questions you can ask for forward and backward chaining.
Grakn, backward chaining
In Grakn, given this rule, if you query:
(1)
match (located: $x, locating: $z) isa locates; get;
Then Grakn will see from your query that there is a rule that can be used to infer this kind of fact. It then works backward to see if there are any results for the when
of the rule. Simplifying things somewhat, it makes a query as per the when
:
(2)
match
$r1 (located: $x, locating: $y) isa locates;
$r2 (located: $y, locating: $z) isa locates;
get;
if there are results then the then
is inferred by Grakn and you get an answer to your original query (1).
Backward chaining answers the question, "Is this fact true?" Using inference to determine this.
Forward Chaining
Forward chaining answers a different question. It says, "I have these facts, what are all of the things that can be inferred from them?". You can use this to also answer the backward chaining question, however it will be much less efficient as forward chaining will infer unneeded facts.
A nice summary from Wikipedia's Forward Chaining article:
Because the data determines which rules are selected and used, this method is called data-driven, in contrast to goal-driven backward chaining inference.
Upvotes: 1