Hi,
I'm considering a number of options in trying to architect a distributed system in line with the semantic web's ambitions.
I haven't yet given a try to ciao prolog, but I would like to know a number of things before I get into more details.
First: I have read that prolog systems are generally backward-chaining systems. I would like to do forward-chaining so I can deal with notification of particular events to the users.
Second: The user contributed libraries mention a utility to convert Prolog to SQL... Does that cover triggers ? :-) that would be too easy, wouldn't it ? More seriously, what does it cover ? It just sounds like magic !
Finally: what kind of persistence does ciao prolog allow for ? In regard to XSB for example. I'm concerned about the convenience of writing triggered code to write things down to a database or an EJB,... Is such a thing possible ?
Thanks in advance for taking the time to answer my naive questions,
Candide Kemmler ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
At 13:19 +0200 02/5/28, Candide Kemmler wrote:
...
First: I have read that prolog systems are generally backward-chaining systems. I would like to do forward-chaining so I can deal with notification of particular events to the users.
...
Though the Prolog interpreter uses backward-chaining you can use Prolog to write meta-interpreters to perform any kind of proof strategy including forward-chaining. Here is a very simple forward-chaining meta-interpeter:
chain_forward(Facts, NewFacts) :- % to find new facts derive_facts(Facts, Facts1), % perform one forward-chaining step chain_forward(Facts1, NewFacts). % and recurse chain_forward(Facts, Facts). % no more facts
derive_facts(Facts, [Fact|Facts]) :- % for a new fact rule(Conditions, Fact), % find a rule forall(member(Condition, Conditions), member(Condition, Facts)), % whose preconditions are true and + member(Fact, Facts). % whose consequence is new
forall(Element, Condition) :- + (Element, + Condition).
With a trivial set of rules
rule(['The sun is shining.'], 'I am hot.'). rule(['I am hot.'], 'I get myself an ice-cream.').
we get
?- chain_forward(['The sun is shining.'], NewFacts). NewFacts = ['I get myself an ice-cream.','I am hot.','The sun is shining.'] ?
Regards.
Norbert E. Fuchs
Department of Information Technology University of Zurich CH-8057 Zurich Switzerland
Telephone +41-1-635 43 13 Fax +41-1-635 68 09 Email fuchs(a)ifi.unizh.ch WWW http://www.ifi.unizh.ch/~fuchs/ ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
hi,
First: I have read that prolog systems are generally backward-chaining systems. I would like to do forward-chaining so I can deal with notification of particular events to the users.
My approach to add "reactive rules" to prolog was based on a data driven schema which exploits an indexing mechanism based on bitmaps. Although the software has been written for sicstus the idea is general and could be replicated in any prolog which provides a foreign language interface.
ftp.cs.unibo.it:/pub/gaspari/fw_rules/
Efficient Support for Reactive Rules in Prolog by M.Gaspari [LNAI September 1997] ftp.cs.unibo.it:/pub/gaspari/papers/aiia97.ps.gz
May be it could be reasonable to port the library in ciao.
Mauro --- ---- *Mauro Gaspari *Dip. di Scienze dell'Informazione *Universita' di Bologna *Via Mura Anteo Zamboni 7 *40126 - Bologna - Italy
Work (Bologna): +39 051 2094875 Work (Cesena): +39 0547 642813 Fax (Bologna): +39 051 2094510 E-mail: gaspari(a)cs.unibo.it www: http://cs.unibo.it/~gaspari ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------