Interactive session?

0 views
Skip to first unread message

Russell

unread,
May 14, 2008, 8:19:21 PM5/14/08
to take rule compiler
Hi guys,

Sorry if this is a stupid question, but the online examples appear to
be focused on a situation where you have an existing database of facts
and rules.

Is it possible to use Take to create a classic interactive inference
shell (eg like Mycin etc), where the user is prompted to enter more
facts as/if needed?

I have an interest in using rule engines for legal reasoning and was
wondering whether Take would be useful for my needs.

Thanks for your time,

Russell


Jens Dietrich

unread,
May 14, 2008, 9:40:26 PM5/14/08
to take-rule...@googlegroups.com
Hi Russell,

You can do this by using external fact sets as follows: a fact set is used at query time to produce an iterator over facts. You can provide an iterator that, when ask for the next fact (next()) pops up a dialog where the end user enters the data to be used to build the next fact. This fact is then returned and used for reasoning. Some possible modifications:

- provide many facts (after one fact has been returned, the iterators hasNext() still returns yes)
- provide one or no facts (yes/true scenario) - the iterator could be empty indicating "no"
- read facts from System.in for old-fashioned command-line applications

Hope this helps, Jens
Reply all
Reply to author
Forward
0 new messages