Hi all,
I am trying to develop a program where based on a set of facts and rules
a user gets presented with a certain conclusion (I reckon that holds for
almost any Jess program ;)), but also with the reasoning path that led
to that conclusion. Essentially, I need to implement a
"why"-functionality.
Now, I am aware of Jess's logical clause that allows you to trace
dependencies between facts. However, I need something slightly more
sophisticated than that: I need to be able to reproduce the actual
rule(s) that led to a conclusion.
To clarify, a simple example:
(assert(duck (name donald)))
(assert(uncleOf donald huey))
(assert(uncleOf donald louie))
(assert(uncleOf donald dewey))
(defrule nephews
"if some duck is an uncle of someone else, that someone else is
his nephew"
(duck(name ?X)))
(uncleOf ?X ?Y)))
=>
(assert(nephewOf ?Y ?X))
The user is interested in the conclusion: ("huey is a nephew of donald")
but also in the explanation of that conclusion:
"huey is a nephew of donald" because
1. donald is a duck (fact)
2. donald is a uncle of huey (fact)
3. if some duck is an uncle of someone else, that someone else is
his nephew (rule)
(in this simple example point 3 seems a bit redundant, but in the actual
application the rules are more complex and thus less directly 'obvious'
in the set of premise facts alone)
I can use the logical clause to reproduce the facts in the explanation
(points 1 and 2), but it's that last part of the explanation (point 3)
that has me stumped.
Does anyone have any tips on how to achieve this? Any pointers will be
highly appreciated.
Best regards,
Jeen
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------