From: Ken Tilton
Subject: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <B4bnh.29$mx4.13@newsfe10.lga>
Seriously considering using an embedded Prolog to churn out the Algebra 
wits of my upcoming world-beating win-big-with-lisp educational title.

ACL's prolog seems dandy, and I get the feeling LW's rocks because of 
the KW product they also offer. ie, Guessing the prolog came first.

Otoh, my rough sense is that I do not need much prolog per se, whereas 
the Lisp-Prolog integration will matter hugely. ACL's looks fine, just 
starting to look at LW's.

I see Norvig's Prolog is the basis of ACL's prolog and truly free to 
use, so I could just use that. Other ____?

Note that using ACL sucks me into their licensing maw, but I have not 
completely ruled that out so let's leave them on the table.

kenny

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty

From: Ralf Mattes
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <pan.2007.01.04.17.53.07.677459@mh-freiburg.de>
On Thu, 04 Jan 2007 12:45:35 -0500, Ken Tilton wrote:

> Seriously considering using an embedded Prolog to churn out the Algebra 
> wits of my upcoming world-beating win-big-with-lisp educational title.
> 
> ACL's prolog seems dandy, and I get the feeling LW's rocks because of 
> the KW product they also offer. ie, Guessing the prolog came first.
> 
> Otoh, my rough sense is that I do not need much prolog per se, whereas 
> the Lisp-Prolog integration will matter hugely. ACL's looks fine, just 
> starting to look at LW's.
> 
> I see Norvig's Prolog is the basis of ACL's prolog and truly free to 
> use, so I could just use that. Other ____?

Have you had a look at Chr. Rhodes (from SBCL fame) version of Norvig's
Prolog?  From the README:

 
 This is PAIProlog, an adaptation of the Prolog compiler from Peter
 Norvig's _Paradigms of Artificial Intelligence Programming_, and
 distributed under the terms of Peter Norvig's licence, included as
 license.html and viewable (as of May 2005) at 
 <http://www.norvig.com/license.html>.

HTH Ralf Mattes


> Note that using ACL sucks me into their licensing maw, but I have not
> completely ruled that out so let's leave them on the table.
> 
> kenny
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <vZbnh.34$mx4.13@newsfe10.lga>
Ralf Mattes wrote:
> On Thu, 04 Jan 2007 12:45:35 -0500, Ken Tilton wrote:
> 
> 
>>Seriously considering using an embedded Prolog to churn out the Algebra 
>>wits of my upcoming world-beating win-big-with-lisp educational title.
>>
>>ACL's prolog seems dandy, and I get the feeling LW's rocks because of 
>>the KW product they also offer. ie, Guessing the prolog came first.
>>
>>Otoh, my rough sense is that I do not need much prolog per se, whereas 
>>the Lisp-Prolog integration will matter hugely. ACL's looks fine, just 
>>starting to look at LW's.
>>
>>I see Norvig's Prolog is the basis of ACL's prolog and truly free to 
>>use, so I could just use that. Other ____?
> 
> 
> Have you had a look at Chr. Rhodes (from SBCL fame) version of Norvig's
> Prolog?  From the README:
> 
>  
>  This is PAIProlog, an adaptation of the Prolog compiler from Peter
>  Norvig's _Paradigms of Artificial Intelligence Programming_, and
>  distributed under the terms of Peter Norvig's licence, included as
>  license.html and viewable (as of May 2005) at 
>  <http://www.norvig.com/license.html>.

Yobboware?! Well, OK, I'll take a look...

> The connection has timed out
> 
> The server at www-jcsu.jesus.cam.ac.uk is taking too long to respond.

Frickin yobs. :) Thx for the lead, I'll keep trying.

kenny

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Frank Buss
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <1wqtw4uhciro.12i7vopijjuhv$.dlg@40tude.net>
Ken Tilton wrote:

> Seriously considering using an embedded Prolog to churn out the Algebra 
> wits of my upcoming world-beating win-big-with-lisp educational title.

Why do you need Prolog, if you have Cells? Would be interesting to
implement some reasoning logic into or with Cells :-)

-- 
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <LNjnh.1607$Qv2.125@newsfe12.lga>
Frank Buss wrote:
> Ken Tilton wrote:
> 
> 
>>Seriously considering using an embedded Prolog to churn out the Algebra 
>>wits of my upcoming world-beating win-big-with-lisp educational title.
> 
> 
> Why do you need Prolog, if you have Cells? Would be interesting to
> implement some reasoning logic into or with Cells :-)
> 

Yeah, a forward-chaining is a mere subset of Cells functionality. But it 
is time to stop building tools and ship an app, so off-the-shelf stuff 
is welcome.

That said, I am still evaluating the idea of using Prolog. I noticed my 
current solution finder already does a fair job of applying multiple 
rules to come up with an optimal solution. But I might be able to use 
Prolog within a rule -- the code in there is hairy enough to have sent 
me on this Prolog investigation.

kzo

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <Nzunh.390$9y3.238@newsfe09.lga>
Madhu wrote:
> * Ken Tilton <···············@newsfe10.lga> :
> 
> | Seriously considering using an embedded Prolog to churn out the Algebra 
> | wits of my upcoming world-beating win-big-with-lisp educational title.
> 
> Are you sure you need prolog?

No. Two seconds after posting that and an hour after I started trying I 
managed to express a Lisp predicate as an ACL Prolog rule that succeeded 
or failed:

    (<-- (plus? ?n) (lisp t (plusp ?n)))

...and remembered how much I loved (!not) the naturalness 
(PWUAHAHAHAHAHAA!) of Prolog.

The above works because (LISP prolog-thingy lisp-form) binds the result 
of the lisp form to the prolog-thingy which is usually a prolog 
variable, and where prolog-thingy is a literal succeeds only if the 
value bound is the same literal.

There's a fine line between... (completion also on the KFE).

> You might be able to use Screamer (after
> working with for a few hours or a day or two).  Licensing *may* be a
> problem.  But it is non-deterministic Common Lisp -- not another
> embedded language.  

Non-determinism gives programmers a pain where they sit. Got a great 
quote (from a constraints overview thesis) on that if anyone needs it. 
Proving Socrates mortal gets noobs all excited and sucks them into a 
black hole of frustration when they try to scale up to something like 
solving Algebra in reasonable steps, spending hours trying to figure out 
why the damn thing insists on x + y - y -> x + 0 when they want it to go 
straight to x.

That is why my trivial little Cells special case of constraints is such 
a popular success and the once-thriving constraints programme has 
withered into nichedom.

I think I just need to improve the code.

Thx, tho.

kzo

ps. If I were starting from scratch I would actually look harder at 
leveraging an embedded Prolog. k

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Damien Kick
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <Wpynh.10963$X72.4895@newsread3.news.pas.earthlink.net>
Ken Tilton wrote:
> No. Two seconds after posting that and an hour after I started trying I
> managed to express a Lisp predicate as an ACL Prolog rule that succeeded 
> or failed:
> 
>    (<-- (plus? ?n) (lisp t (plusp ?n)))

FWIW, I think lispp would help, though it doesn't make much of a difference.

(<-- (plus ?n) (lispp (plusp ?n)))
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <Jcznh.150$cK.40@newsfe11.lga>
Damien Kick wrote:
> Ken Tilton wrote:
> 
>> No. Two seconds after posting that and an hour after I started trying I
>> managed to express a Lisp predicate as an ACL Prolog rule that 
>> succeeded or failed:
>>
>>    (<-- (plus? ?n) (lisp t (plusp ?n)))
> 
> 
> FWIW, I think lispp would help, though it doesn't make much of a 
> difference.
> 
> (<-- (plus ?n) (lispp (plusp ?n)))

Oh, damn, I read that, too, but before I actually started experimenting 
so it cleared the top of my head with room to spare.

thx, kt

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Damien Kick
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <YjAnh.10989$X72.4384@newsread3.news.pas.earthlink.net>
Ken Tilton wrote:
> Damien Kick wrote:
>> Ken Tilton wrote:
>>
>>> No. Two seconds after posting that and an hour after I started trying I
>>> managed to express a Lisp predicate as an ACL Prolog rule that 
>>> succeeded or failed:
>>>
>>>    (<-- (plus? ?n) (lisp t (plusp ?n)))
>>
>>
>> FWIW, I think lispp would help, though it doesn't make much of a 
>> difference.
>>
>> (<-- (plus ?n) (lispp (plusp ?n)))
> 
> Oh, damn, I read that, too, but before I actually started experimenting 
> so it cleared the top of my head with room to spare.

One of my favorite things about Prolog in Lisp is being able to mix-n-match

(defmacro defoo (name &rest args)
   `(<-- (,name ,@args) (lispp (,name ,@args))))

(defoo plusp ?n)
(defoo minusp ?n)
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <98Cnh.1244$mx4.1087@newsfe10.lga>
Damien Kick wrote:
> Ken Tilton wrote:
> 
>> Damien Kick wrote:
>>
>>> Ken Tilton wrote:
>>>
>>>> No. Two seconds after posting that and an hour after I started trying I
>>>> managed to express a Lisp predicate as an ACL Prolog rule that 
>>>> succeeded or failed:
>>>>
>>>>    (<-- (plus? ?n) (lisp t (plusp ?n)))
>>>
>>>
>>>
>>> FWIW, I think lispp would help, though it doesn't make much of a 
>>> difference.
>>>
>>> (<-- (plus ?n) (lispp (plusp ?n)))
>>
>>
>> Oh, damn, I read that, too, but before I actually started 
>> experimenting so it cleared the top of my head with room to spare.
> 
> 
> One of my favorite things about Prolog in Lisp is being able to mix-n-match
> 
> (defmacro defoo (name &rest args)
>   `(<-- (,name ,@args) (lispp (,name ,@args))))
> 
> (defoo plusp ?n)
> (defoo minusp ?n)

Ah, I was wondering if I could get away with that. Nice to know if I 
ever go back. Of course in this case His Kennyness has now spoken in 
Infallibility Mode and decreed plus? and minus?, but for non-predicates 
this would be handy (and really confuse the uninitiated, always a plus).

kenny

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Markus Triska
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <87lkkggxtp.fsf@gmx.at>
Ken Tilton <·········@gmail.com> writes:

>    (<-- (plus? ?n) (lisp t (plusp ?n)))
>
> ...and remembered how much I loved (!not) the naturalness
> (PWUAHAHAHAHAHAA!) of Prolog.

That's not even Prolog syntax. A Prolog analogon of plusp:

positive(N) :- N > 0.
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <f4Pnh.79$D05.37@newsfe09.lga>
Markus Triska wrote:
> Ken Tilton <·········@gmail.com> writes:
> 
> 
>>   (<-- (plus? ?n) (lisp t (plusp ?n)))
>>
>>...and remembered how much I loved (!not) the naturalness
>>(PWUAHAHAHAHAHAA!) of Prolog.
> 
> 
> That's not even Prolog syntax. A Prolog analogon of plusp:
> 
> positive(N) :- N > 0.
> 

Sure, but the challenge is how to merge Prolog with Lisp, so you cannot 
use Prolog, it has to be Lisp extended suitably with (still) Lisp 
macros. Another respondent pointed out ACL Prolog's lispp, syntactic 
sugar for easily implementing a Prolog rule that succeeds or fails as 
implemented by Lisp predicate returning t or nil.

Note also I said that this experience /reminded me/ of Prolog's 
unprogrammability, not that it proved it.

kt

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Markus Triska
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <87sleo8686.fsf@gmx.at>
Ken Tilton <·········@gmail.com> writes:

> Sure, but the challenge is how to merge Prolog with Lisp, so you
> cannot use Prolog, it has to be Lisp extended suitably with (still)
> Lisp macros

No, one can build a Prolog parser in Lisp and use that.

> Note also I said that this experience /reminded me/ of Prolog's
> unprogrammability, not that it proved it.

Assumptions you can't prove might be wrong.
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <eWRnh.29$eN3.12@newsfe10.lga>
Markus Triska wrote:
> Ken Tilton <·········@gmail.com> writes:
> 
> 
>>Sure, but the challenge is how to merge Prolog with Lisp, so you
>>cannot use Prolog, it has to be Lisp extended suitably with (still)
>>Lisp macros
> 
> 
> No, one can build a Prolog parser in Lisp and use that.

"One can"? Sorry, this is not pie/sky, I am Actually Working on 
something. I understand your mistake, that does not happen much around 
here. I want(ed) prolog to manage one aspect of the functionality, the 
rest of which is handled by a fancy lisp engine with which the prolog 
bit needs to swim.

> 
> 
>>Note also I said that this experience /reminded me/ of Prolog's
>>unprogrammability, not that it proved it.
> 
> 
> Assumptions you can't prove might be wrong.

Assumptions that I am assuming are certainly wrong.

kt

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Markus Triska
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <87lkke7e79.fsf@gmx.at>
Ken Tilton <·········@gmail.com> wrote:

> Sorry,

Apology accepted.

> I understand your mistake, that does not happen much around here.

With effort, your moments of understanding will become more frequent.

> Assumptions that I am assuming are certainly wrong.

For any logic programming you undertake: Good luck! You know which
group to turn to for inquiry about actual Prolog. Questions about the
Lisp macros that remind you of unnaturalness and unprogrammability
will be dealt with right here. What do you find unnatural about them?
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <zAioh.312$Hf2.102@newsfe11.lga>
Markus Triska wrote:
> Ken Tilton <·········@gmail.com> wrote:
> 
> 
>>Sorry,
> 
> 
> Apology accepted.

dying is easy, comedy is hard.

> 
> 
>>I understand your mistake, that does not happen much around here.
> 
> 
> With effort, your moments of understanding will become more frequent.
> 
> 
>>Assumptions that I am assuming are certainly wrong.
> 
> 
> For any logic programming you undertake: Good luck! You know which
> group to turn to for inquiry about actual Prolog. 

OK, thx. Right now my problem is -3^2. What's the Prolog for that? Code 
and answer, amazing as the latter Q may sound.

kt


-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Mark Tarver
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <1168108447.059694.234680@s34g2000cwa.googlegroups.com>
Qi contains an embedded Prolog which is the object code of its type
theory compiler.  www.lambdassociates.org/prolog.htm gives an overview
of how to use it.    The paper http://www.lambdassociates.org/aum.pdf
gives a description of the Abstract Unification Machine that powers it.
   Its heavily integrated into the functional element.   It's not based
on Norvig but is an extension of the compilation techniques used to
compile Qi itself.

Performance is about 100-150 KLIPS under CLisp and about 600 KLIPS
under CMU.

Ken Tilton wrote:
> Seriously considering using an embedded Prolog to churn out the Algebra
> wits of my upcoming world-beating win-big-with-lisp educational title.
>
> ACL's prolog seems dandy, and I get the feeling LW's rocks because of
> the KW product they also offer. ie, Guessing the prolog came first.
>
> Otoh, my rough sense is that I do not need much prolog per se, whereas
> the Lisp-Prolog integration will matter hugely. ACL's looks fine, just
> starting to look at LW's.
>
> I see Norvig's Prolog is the basis of ACL's prolog and truly free to
> use, so I could just use that. Other ____?
>
> Note that using ACL sucks me into their licensing maw, but I have not
> completely ruled that out so let's leave them on the table.
>
> kenny
>
> --
> The Dalai Lama gets the same crap all the time.
>    -- Kenny Tilton on c.l.l when accused of immodesty
From: Ken Tilton
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <eWSnh.34$ah1.19@newsfe08.lga>
Mark Tarver wrote:
> Qi contains an embedded Prolog which is the object code of its type
> theory compiler.  www.lambdassociates.org/prolog.htm gives an overview
> of how to use it.    The paper http://www.lambdassociates.org/aum.pdf
> gives a description of the Abstract Unification Machine that powers it.
>    Its heavily integrated into the functional element.   It's not based
> on Norvig but is an extension of the compilation techniques used to
> compile Qi itself.

I was going to ask if you had considered making Qi embeddable in CL as a 
library, as a way of broadening the possible market. I understand that 
would not make sense for all of Qi's added value.

btw, spotted a possible typo here:
  http://www.lambdassociates.org/ifpe.htm

Mentions "Lisp Associates". s/b "Lambda Associates"?

re: Qi/tk. Bravo, the right way to go for my .02.

re: "niggling habits like calling false NIL" -- En guard!

re: "Does anybody remember the beautiful GARNET system?" -- No, they are 
all using a Cells-driven GUI now. Does Qi replicate KR?

best of luck w/ Qi.

kt

-- 
The Dalai Lama gets the same crap all the time.
   -- Kenny Tilton on c.l.l when accused of immodesty
From: Mark Tarver
Subject: Re: I'd spend a week evaluating, but I would rather waste your time: LW vs. ACL Prolog vs Norvig vs?
Date: 
Message-ID: <1168120510.814363.248900@s34g2000cwa.googlegroups.com>
> was going to ask if you had considered making Qi embeddable in CL as a
>library, as a way of broadening the possible market. I understand that
> would not make sense for all of Qi's added value.

Not sure absolutely what you mean here.   Maybe you could explain.

The idea of Qi was that people could borrow or use it for their Lisp
apps and mix it with native Lisp.   One model is to use Qi to generate
the Lisp and then peel the Qi away from the app when you don't need it
any more.   Like using a jello mold - you put it aside when you've got
the jello you want.

In your app you could use the Qi Prolog to generate the bits of Lisp
you need and then continue your work in Allegro.   The latest Qi GPL
exemption will give a cheap buyout from GPL which would probably suit
you and you can stay in Allegro from then on.

Qi Prolog was a spin-off of the Qi type compiler.   I probably could do
more work on the reader but its pretty solid and the code should port
well.   For instance here is a couple of Horn clauses.

(defprolog "likes(kenny, algebra).
                       likes (X, maths) :- likes(X, algebra).")

Here is the generated code.

(DEFUN likes* (FP1 FP2 Continuation)
 (OR
  (PROG2 (INCF *logical-inferences*)
   (LET ((X1 (lazyderef FP1)))
    (IF (EQ X1 'kenny)
     (LET ((X2 (lazyderef FP2)))
      (IF (EQ X2 'algebra) (popstack Continuation)
       (AND (var? X2)
        (PROGV (LIST X2) (LIST 'algebra) (popstack Continuation)))))
     (AND (var? X1)
      (PROGV (LIST X1) (LIST 'kenny)
       (LET ((X3 (lazyderef FP2)))
        (IF (EQ X3 'algebra) (popstack Continuation)
         (AND (var? X3)
          (PROGV (LIST X3) (LIST 'algebra)
           (popstack Continuation))))))))))
  (PROG2 (INCF *logical-inferences*)
   (LET ((X4 (lazyderef FP2)))
    (IF (EQ X4 'maths) (likes* FP1 'algebra Continuation)
     (AND (var? X4)
      (PROGV (LIST X4) (LIST 'maths)
       (likes* FP1 'algebra Continuation))))))))

Its nearly all portable except for some stuff like lazyderef, popstack
etc.  My stuff here is < 50 lines of code. The Qi commercial license
allows you to carry a limited amount of my source (5K) into your app
with no bother and gives you complete rights over your own stuff.

This might give you what you want.

> btw, spotted a possible typo here:  http://www.lambdassociates.org/ifpe.htm

Looks like a typo OK.

> No, they are all using a Cells-driven GUI now. Does Qi replicate KR?

You've got me there - its 15 years since I used Garnet and my memory of
it is now dim.   KR was a constraint-based system.  I guess the answer
should be 'yes' because Qi/tk contains functions which explicitly query
and allow the user to change the slots of widgets. Hence the value of a
slot could be defined in terms the value of another slot and I've
written code that does just that.   This introduces interesting
challenges for the type checker which I posted in an unanswered post on
Qilang.  But generally Qi/tk will allow dependencies and the type
checker will endeavour to make sure that they work.

> best of luck w/ Qi.

Thanks; also with Tilton algebra.

Mark