From: Alfonso Esteban Gonzalez Sencion
Subject: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <1081328453.597542@slbhw0>
Hello

I am looking for an rule inference engine or functional programming 
system  similar to prolog for lisp (or scheme ;-)

Right now I am using Prolog for some of my projects, but I am not happy 
with some of its features. Specially the lack of standard object 
oriented features and the managment of data structures. For big complex 
problems I find it lacking.

For example if I have an object which contains a several attributes in 
Prolog I define an assertion which looks like this.

object(par1,par2,par3,par4,par5,...,parn)

Each time I want to make a matching I have to set the paramaters in the 
right order which I find rather error prone. Additional functions could 
be written to simplify the access to the information, but I find it 
cumbersome.

Yes I konw that the knowledge could be written in anohter way, like this:

object_par1(obj,val1)
object_par2(obj,val2)
etc...

But I prefer to the informationin just one place.

I have taken a look at CLIPS. What I like from clips is the way of 
representing knowledge using deftemplate.

(deftemplate object
	(slot par1 )
	(slot par2 )
	(slot par3 )
	....
	(slot parn )
)

how can they be initialized

	(assert (object ( par1 val1) (par2 val2 ) ... (parn valn)))

And retrieved later.

But I would like to have the ability, like in prolog, to call a rule 
passing it parameters, instead of firing the rules through assertions.

Any suggestion?
	

From: Sashank Varma
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <none-961346.09515507042004@news.vanderbilt.edu>
In article <·················@slbhw0>,
 Alfonso Esteban Gonzalez Sencion <·······@alcatel.es> wrote:

> But I would like to have the ability, like in prolog, to call a rule 
> passing it parameters, instead of firing the rules through assertions.

[Disclaimer: I don't know much about Prolog.]

What does it mean to "call a rule passing it parameters"?

Production system interpreters like CLIPS are explicitly
designed to figure out which rules match which data
patterns; this is called "matching" or "pattern recognition".

How do you intend to use the rule system if you see the
need to explicitly call rules rather than letting the
system itself determine which rules can be called?
From: mikel
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <1hVcc.33731$jf6.16561@newssvr29.news.prodigy.com>
Sashank Varma wrote:

> In article <·················@slbhw0>,
>  Alfonso Esteban Gonzalez Sencion <·······@alcatel.es> wrote:
> 
> 
>>But I would like to have the ability, like in prolog, to call a rule 
>>passing it parameters, instead of firing the rules through assertions.
> 
> 
> [Disclaimer: I don't know much about Prolog.]
> 
> What does it mean to "call a rule passing it parameters"?

Pretty much the same thing is means to "call a functions passing it 
parameters," except that Prolog has rules instead of functions. Rules 
and constants are all you get in Prolog, thus rules play the role of 
procedures. A program is written as a main rule that refers to a bunch 
of other rules, in the same sense that a C program is written as a main 
function that calls other functions. It thus makes sense to speak of 
"calling rules" in the sense that one rule refers to a number of other 
rules in its definition.

> Production system interpreters like CLIPS are explicitly
> designed to figure out which rules match which data
> patterns; this is called "matching" or "pattern recognition".
> 
> How do you intend to use the rule system if you see the
> need to explicitly call rules rather than letting the
> system itself determine which rules can be called?
From: Sashank Varma
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <none-46CC05.16064907042004@news.vanderbilt.edu>
In article <·····················@newssvr29.news.prodigy.com>,
 mikel <·····@evins.net> wrote:

> Sashank Varma wrote:
> 
> > In article <·················@slbhw0>,
> >  Alfonso Esteban Gonzalez Sencion <·······@alcatel.es> wrote:
> > 
> > 
> >>But I would like to have the ability, like in prolog, to call a rule 
> >>passing it parameters, instead of firing the rules through assertions.
> > 
> > 
> > [Disclaimer: I don't know much about Prolog.]
> > 
> > What does it mean to "call a rule passing it parameters"?
> 
> Pretty much the same thing is means to "call a functions passing it 
> parameters," except that Prolog has rules instead of functions. Rules 
> and constants are all you get in Prolog, thus rules play the role of 
> procedures. A program is written as a main rule that refers to a bunch 
> of other rules, in the same sense that a C program is written as a main 
> function that calls other functions. It thus makes sense to speak of 
> "calling rules" in the sense that one rule refers to a number of other 
> rules in its definition.
> 
> > Production system interpreters like CLIPS are explicitly
> > designed to figure out which rules match which data
> > patterns; this is called "matching" or "pattern recognition".
> > 
> > How do you intend to use the rule system if you see the
> > need to explicitly call rules rather than letting the
> > system itself determine which rules can be called?

Interesting.  This kind of interaction can be had with
production system interpreters like CLIPS if the user
adopts coding conventions, such as including a unique
"control element" on the condition side of each rule,
which would enable to user to "call" the rule by (and
only by) asserting that control element.  But this is
clumsy at best.

It sounds like the OP would be best off with one of
the many available implementations of Prolog in Common
Lisp.  Norvig provides one in PAIP, Graham another in
"On Lisp".
From: Thomas A. Russ
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <ymi8yh7skq3.fsf@sevak.isi.edu>
Not exactly like Prolog, but you could take a look at the Loom 
knowledge representation language.  In addition to the standard
description-logic features, Loom also has a production rule
system and logic-based methods and method dispatch.

See:  http://www.isi.edu/isd/LOOM/

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: mikel
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <zdVcc.47415$G%3.44817@newssvr25.news.prodigy.com>
Alfonso Esteban Gonzalez Sencion wrote:
> Hello
> 
> I am looking for an rule inference engine or functional programming 
> system  similar to prolog for lisp (or scheme ;-)
> 
> Right now I am using Prolog for some of my projects, but I am not happy 
> with some of its features. Specially the lack of standard object 
> oriented features and the managment of data structures. For big complex 
> problems I find it lacking.
> 
> For example if I have an object which contains a several attributes in 
> Prolog I define an assertion which looks like this.
> 
> object(par1,par2,par3,par4,par5,...,parn)
> 
> Each time I want to make a matching I have to set the paramaters in the 
> right order which I find rather error prone. Additional functions could 
> be written to simplify the access to the information, but I find it 
> cumbersome.
> 
> Yes I konw that the knowledge could be written in anohter way, like this:
> 
> object_par1(obj,val1)
> object_par2(obj,val2)
> etc...
> 
> But I prefer to the informationin just one place.
> 
> I have taken a look at CLIPS. What I like from clips is the way of 
> representing knowledge using deftemplate.
> 
> (deftemplate object
>     (slot par1 )
>     (slot par2 )
>     (slot par3 )
>     ....
>     (slot parn )
> )
> 
> how can they be initialized
> 
>     (assert (object ( par1 val1) (par2 val2 ) ... (parn valn)))
> 
> And retrieved later.
> 
> But I would like to have the ability, like in prolog, to call a rule 
> passing it parameters, instead of firing the rules through assertions.
> 
> Any suggestion?
>     


Pter Norvig's book, _Paradigms of Artificial Intelligence Programming_, 
has, among other things, a Prolog interpreter and compiler in Common 
Lisp. You can get the code from
http://www.norvig.com/paip.html

...which link also has the information about where to get the book that 
explains the code.
From: Pascal Costanza
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <c51c8b$9o7$1@newsreader2.netcologne.de>
Alfonso Esteban Gonzalez Sencion wrote:

> Hello
> 
> I am looking for an rule inference engine or functional programming 
> system  similar to prolog for lisp (or scheme ;-)

IIRC, Peter Norvig's "Paradigms of Artificial Intelligence Programming" 
and Paul Graham's "On Lisp" present implementations of such engines. 
Another obviously powerful library is Screamer. See 
http://www.cliki.net/screamer

LispWorks Enterprise Edition comes with KnowledgeWorks: 
http://www.lispworks.com/products/knowledgeworks.html

I haven't checked theses things yet, so I can't comment on them.

Pascal

-- 
1st European Lisp and Scheme Workshop
June 13 - Oslo, Norway - co-located with ECOOP 2004
http://www.cs.uni-bonn.de/~costanza/lisp-ecoop/
From: Rob Warnock
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <XKSdnQ5i_s0Hr-jdRVn-iQ@speakeasy.net>
Alfonso Esteban Gonzalez Sencion  <·······@alcatel.es> wrote:
+---------------
| I am looking for an rule inference engine or functional programming 
| system  similar to prolog for lisp (or scheme ;-)
+---------------

Have you looked at Poplog/Pop-11? It has a Common Lisp embedded in it:

    <URL:http://www.cs.bham.ac.uk/research/poplog/poplog.info.html>


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Marco Antoniotti
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <aVRec.1$a5.941@typhoon.nyu.edu>
Poplog is a very interesting system.

However, it's CL subsystem needs ANSIfication.  I toyed with it, but ran 
out of time.  Any takers?

Cheers

marco





Rob Warnock wrote:

> Alfonso Esteban Gonzalez Sencion  <·······@alcatel.es> wrote:
> +---------------
> | I am looking for an rule inference engine or functional programming 
> | system  similar to prolog for lisp (or scheme ;-)
> +---------------
> 
> Have you looked at Poplog/Pop-11? It has a Common Lisp embedded in it:
> 
>     <URL:http://www.cs.bham.ac.uk/research/poplog/poplog.info.html>
> 
> 
> -Rob
> 
> -----
> Rob Warnock			<····@rpw3.org>
> 627 26th Avenue			<URL:http://rpw3.org/>
> San Mateo, CA 94403		(650)572-2607
> 
From: Fred Gilham
Subject: Re: Looking for a inference engine similar tor Prolog for Lisp
Date: 
Message-ID: <u74qrnoo74.fsf@snapdragon.csl.sri.com>
> +---------------
> | I am looking for an rule inference engine or functional programming 
> | system  similar to prolog for lisp (or scheme ;-)
> +---------------


You can use Norvig's code from Paradigms of AI Programming.  It
includes a compiler and is quite usable.  We did definite clause
grammar parsing with it.  These were fairly substantial grammars, not
toy examples.

The code for the PAIP book is available on the net.

There are a couple other prolog-in-lisp systems out there, but the
only one I know of that has a compiler is Norvig's.

Also, if you want something similar but don't insist on a close match
to actual Prolog, you can use Screamer.  It uses CPS transformation to
create backtracking versions of Lisp operators, and also includes a
constraint system.

If you are looking for rule inference engines, there's also Lisa, a
new version of which was announced recently.

-- 
Fred Gilham                                       ······@csl.sri.com
I cannot undertake to lay my finger on that article of the
Constitution which granted a right to Congress of expending, on the
objects of benevolence, the money of their constituents.
                                              -- James Madison, 1794