rule systems for crontab and active databases?

Andrew Piskorski <[email protected]> Fri, 27 Jan 2006 16:55:20 -0500
Newsgroups gmane.lisp.lisa.general
Message-ID <[email protected]>
First of all, please note the cross-posting above.  I believe it is
appropriate in this case, as my questions apply equally to CLIPS,
Lisa, and Soar.

I am interested in the use of forward-chaining rule systems in non-AI
systems, particularly for "active databases".  The two use cases I
particularly have in mind are:

1. A much more powerful cron/crontab scheduler replacement.
2. Rich business rules which respond automatically to real-time
   financial market data.

First I'll list some questions for you folks, then go on to discuss
the the two use cases which inspired them:

How well does your system respond to rapidly changing facts?  Can it
change its rules on the fly?  Will it still perform adequately if the
rules change rapidly?  Any useful rules of thumb for just how MUCH
changing of facts and/or rules your system can support?

Is there a good way to make your system time-aware, like cron is?  How
would you do it?

Do you know of anyone implementing a more powerful crontab-like system
before?  If not, how would recommend that someone go about doing so?
Do you think your forward-chaining rule system tools suitable for this
use?  Why or why not?

Do you implement any forward-chaining algorithms other than Rete,
e.g., Leaps, Treat, or Rete* ?  Why or why not?

Any other systems I should look at that I've missed?

And finally, what are fundamental similarities and differences between
your systems and others, and when and why are these significant?  Why
would someone choose to CLIPS vs. Lisa vs. Soar?

Now, the use cases:

1. A much more powerful cron/crontab scheduler replacement:

On Unix, the cron daemon and crontab files are the typical tool for
scheduling jobs to run periodically or at particular times.  This is
useful, but woefully limited in its expressive power.  What I really
want instead, is some tool which, via a programming language, can
express dependencies and constraints between scheduled jobs, integrate
integrates tracking of and actions on job success or failure, etc.

E.g., "Run job A immediately after both jobs B and C successfully
finish.  If job A fails, run job X.  Run job B at the first Monday of
each month, at these times throughout the day..."

It seems to me that a forward chaining rule system should be suitable
for building such a smart cron system, *IF* (among other things) it
has a good way to model and react to the passage of time.  However, so
far I haven't been able to find any info about modeling time and
constraints in such environments, nor any examples of a more powerful
crontab-like system using such tools.

2. Business rules which respond automatically to real-time financial
   market data:

I am interested in taking real-time financial market data (e.g.,
prices of securities) and filtering them through business rules which
trigger arbitrary actions - trade execution, alerts, changes in the
rules, whatever.

Years ago, as part of a larger project, my team actually did implement
a simple version of that.  Fortunately we were only dealing with a
modest amount of streaming data (selected bond index options), so we
simply stuffed all the data it into our Oracle database as it arrived
and then fired triggers based on the data.

That is not a generally useful solution.  It probably would have had
severe performance problems with larger amounts of or faster incoming
data.  Just as bad, RDBMS triggers (in Oracle, PostgreSQL, etc.) have
lots of drawback and limitations, and do NOT provide a very good
language substrate for this kind of job.

E.g., it would be very, very nice to allow sophisticated end users to
define their own rule-based triggers, but our old Oracle trigger
system CERTAINLY could not support that.  We could only offer certain
pre-defined canned rules ("If option price X moves by more than Y%,
suspend all my pending orders!"), and even then we had to carefully
pick what rules to implement so as not to run afoul of recursive
trigger problems and other limitations.

3. Finally, here are some additional links which may be of interest:

These old threads give some links related to the financial market use
case for forward-chaining systems, etc.:

  http://openacs.org/forums/message-view?message_id=44805
  http://openacs.org/forums/message-view?message_id=113190

Various cron systems - AFAIK none of these do what I want:

  http://fcron.free.fr/
  http://www.gentoo.org/doc/en/cron-guide.xml
  http://saturn.sourceforge.net/about.php

Some daemon launcher tools - even more limited than the cron systems
above:

  http://cr.yp.to/daemontools.html
  http://arstechnica.com/reviews/os/macosx-10.4.ars/5
  http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/launchd.8.html

Other projects (some of them very old or defunct) which are more or
less related include Aditi, Venus-DB, Mozart/Oz, Mercury, and of
course various Prolog systems:

  http://www.cs.mu.oz.au/research/aditi/
  http://www.cs.mu.oz.au/research/mercury/
  http://www.cs.utexas.edu/users/venus/
  http://www.cs.utexas.edu/users/miranker/treator.htm
  http://www.mozart-oz.org/
  http://www.cise.ufl.edu/~sharma/research/active.html
  http://itlab.uta.edu/sharma/Projects/Active/index.htm

Thanks for your time and input!

-- 
Andrew Piskorski <[email protected]>
http://www.piskorski.com/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642