Re: A query in Pilog

2018-07-02 Thread Bruno Franco
>If it does not work it is not because the >programming language or because
>some arbitrary, arcane rules you will >never understand. If PicoLisp does
not >do what you want it is because "You are >to dumb

Yeah, it can be very frustrating. But I like it in the long run. Since it
is so simple, it is easy to understand, and once you get it you rarely make
the same mistake again.

And that's something I like about this community. Even if I am too dumb to
get it, there is someone else smart enough to guide me the correct way : )

Thanks again!

On Mon, Jul 2, 2018, 00:14 Johann-Tobias Schäg  wrote:

>
> That is the horrible thing about PicoLisp. If it does not work it is not
> because the programming language or not because some arbitrary, arcane
> rules you will never understand. If PicoLisp does not do what you want it
> is because "You are to dumb to understand a simple system of simple rules"
> or something like that. This can be very insulting if you take it too
> personal.
>
> But on the other side of the coin, you wouldn't wanna miss such stark
> direct feedback as a NIL. Sometimes it is just what you deserve and need.
> *Von:* brunofrancosala...@gmail.com
> *Gesendet:* 2. Juli 2018 5:46 vorm.
> *An:* picolisp@software-lab.de
> *Antworten:* picolisp@software-lab.de
> *Betreff:* Re: A query in Pilog
>
> OH, I just realized how!
>
> (? (loves Mark @X) (woman @X))
>
> It seems obvious in hindsight XD
>
> On Sun, Jul 1, 2018 at 10:37 PM Bruno Franco 
> wrote:
>
>> Yeah! that is exactly right!
>>
>> All this time I had tried to use the "?" function like this:
>> (? ((loves Mark @X) (woman @X)))
>> But it returned NIL.
>>
>> So, when you search for a variable that can satisfy more than one
>> predicate,
>> you make a list of predicates (call it PList) and pass it as argument to
>> (prove (goal PList)).
>>
>> Is there a way to do that using only the "?" function, or must it always
>> be wrapped by the (prove (goal )) combo?
>>
>>
>> On Sun, Jul 1, 2018 at 6:05 PM Johann-Tobias Schäg 
>> wrote:
>>
>>> I've got it working the following way. It is very inelegant but it shows
>>> the idea.
>>>
>>>  (be woman (Ann))
>>> #-> woman
>>> (prove (goal (woman @X))) # wrong
>>> #!? (woman @X)
>>> #woman -- Undefined
>>> (prove (goal '((woman @X #quoted list can contain multiple statements
>>> #-> ((@X . Ann))
>>> (be loves (Mark Ann))
>>> #-> loves
>>> (be loves (Mark Max))
>>> #-> loves
>>> (prove (goal '((loves Mark @X) (woman @X #as is seen here
>>> #-> ((@X . Ann))
>>>
>>> does that help?
>>>
>>> *Von:* brunofrancosalamin@gmailcom 
>>> *Gesendet:* 1. Juli 2018 11:49 nachm.
>>> *An:* picolisp@software-lab.de
>>> *Antworten:* picolisp@software-lab.de
>>> *Betreff:* A query in Pilog
>>>
>>> I'm going through the "Learn Prolog Now!" ebook and I ran into this
>>> query:
>>>
>>> ?- loves(marsellus,X), woman(X).
>>>
>>> And I can't figure out how to do it in pilog.
>>> Is there a function that can test multiple queries at once, like or/2
>>> does?
>>>
>>> thanks
>>>
>>


Re: A query in Pilog

2018-07-01 Thread Johann-Tobias Schäg
That is the horrible thing about PicoLisp. If it does not work it is not because the programming language or not because some arbitrary, arcane rules you will never understand. If PicoLisp does not do what you want it is because "You are to dumb to understand a simple system of simple rules" or something like that. This can be very insulting if you take it too personal.But on the other side of the coin, you wouldn't wanna miss such stark direct feedback as a NIL. Sometimes it is just what you deserve and need.Von: brunofrancosala...@gmail.comGesendet: 2. Juli 2018 5:46 vorm.An: picolisp@software-lab.deAntworten: picolisp@software-lab.deBetreff: Re: A query in Pilog  OH, I just realized how!(? (loves Mark @X) (woman @X))It seems obvious in hindsight XDOn Sun, Jul 1, 2018 at 10:37 PM Bruno Franco <brunofrancosala...@gmail.com> wrote:Yeah! that is exactly right! All this time I had tried to use the "?" function like this:(? ((loves Mark @X) (woman @X)))But it returned NIL.So, when you search for a variable that can satisfy more than one predicate,you make a list of predicates (call it PList) and pass it as argument to (prove (goal PList)).Is there a way to do that using only the "?" function, or must it always be wrapped by the (prove (goal )) combo?On Sun, Jul 1, 2018 at 6:05 PM Johann-Tobias Schäg <johtob...@gmail.com> wrote:  I've got it working the following way. It is very inelegant but it shows the idea. (be woman (Ann))#-> woman(prove (goal (woman @X))) # wrong#!? (woman @X)#woman -- Undefined(prove (goal '((woman @X #quoted list can contain multiple statements#-> ((@X . Ann))(be loves (Mark Ann))#-> loves(be loves (Mark Max))#-> loves(prove (goal '((loves Mark @X) (woman @X #as is seen here#-> ((@X . Ann))does that help?   Von: brunofrancosalamin@gmailcomGesendet: 1. Juli 2018 11:49 nachm.An: picolisp@software-lab.deAntworten: picolisp@software-lab.deBetreff: A query in Pilog  I'm going through the "Learn Prolog Now!" ebook and I ran into this query:?- loves(marsellus,X), woman(X).And I can't figure out how to do it in pilog.Is there a function that can test multiple queries at once, like or/2 does?thanks



Re: A query in Pilog

2018-07-01 Thread Bruno Franco
OH, I just realized how!

(? (loves Mark @X) (woman @X))

It seems obvious in hindsight XD

On Sun, Jul 1, 2018 at 10:37 PM Bruno Franco 
wrote:

> Yeah! that is exactly right!
>
> All this time I had tried to use the "?" function like this:
> (? ((loves Mark @X) (woman @X)))
> But it returned NIL.
>
> So, when you search for a variable that can satisfy more than one
> predicate,
> you make a list of predicates (call it PList) and pass it as argument to
> (prove (goal PList)).
>
> Is there a way to do that using only the "?" function, or must it always
> be wrapped by the (prove (goal )) combo?
>
>
> On Sun, Jul 1, 2018 at 6:05 PM Johann-Tobias Schäg 
> wrote:
>
>> I've got it working the following way. It is very inelegant but it shows
>> the idea.
>>
>>  (be woman (Ann))
>> #-> woman
>> (prove (goal (woman @X))) # wrong
>> #!? (woman @X)
>> #woman -- Undefined
>> (prove (goal '((woman @X #quoted list can contain multiple statements
>> #-> ((@X . Ann))
>> (be loves (Mark Ann))
>> #-> loves
>> (be loves (Mark Max))
>> #-> loves
>> (prove (goal '((loves Mark @X) (woman @X #as is seen here
>> #-> ((@X . Ann))
>>
>> does that help?
>>
>> *Von:* brunofrancosala...@gmail.com
>> *Gesendet:* 1. Juli 2018 11:49 nachm.
>> *An:* picolisp@software-lab.de
>> *Antworten:* picolisp@software-lab.de
>> *Betreff:* A query in Pilog
>>
>> I'm going through the "Learn Prolog Now!" ebook and I ran into this query:
>>
>> ?- loves(marsellus,X), woman(X).
>>
>> And I can't figure out how to do it in pilog.
>> Is there a function that can test multiple queries at once, like or/2
>> does?
>>
>> thanks
>>
>


Re: A query in Pilog

2018-07-01 Thread Bruno Franco
Yeah! that is exactly right!

All this time I had tried to use the "?" function like this:
(? ((loves Mark @X) (woman @X)))
But it returned NIL.

So, when you search for a variable that can satisfy more than one predicate,
you make a list of predicates (call it PList) and pass it as argument to
(prove (goal PList)).

Is there a way to do that using only the "?" function, or must it always be
wrapped by the (prove (goal )) combo?


On Sun, Jul 1, 2018 at 6:05 PM Johann-Tobias Schäg 
wrote:

> I've got it working the following way. It is very inelegant but it shows
> the idea.
>
>  (be woman (Ann))
> #-> woman
> (prove (goal (woman @X))) # wrong
> #!? (woman @X)
> #woman -- Undefined
> (prove (goal '((woman @X #quoted list can contain multiple statements
> #-> ((@X . Ann))
> (be loves (Mark Ann))
> #-> loves
> (be loves (Mark Max))
> #-> loves
> (prove (goal '((loves Mark @X) (woman @X #as is seen here
> #-> ((@X . Ann))
>
> does that help?
>
> *Von:* brunofrancosala...@gmail.com
> *Gesendet:* 1. Juli 2018 11:49 nachm.
> *An:* picolisp@software-lab.de
> *Antworten:* picolisp@software-lab.de
> *Betreff:* A query in Pilog
>
> I'm going through the "Learn Prolog Now!" ebook and I ran into this query:
>
> ?- loves(marsellus,X), woman(X).
>
> And I can't figure out how to do it in pilog.
> Is there a function that can test multiple queries at once, like or/2 does?
>
> thanks
>


Re: A query in Pilog

2018-07-01 Thread Johann-Tobias Schäg
  I've got it working the following way. It is very inelegant but it shows the idea. (be woman (Ann))#-> woman(prove (goal (woman @X))) # wrong#!? (woman @X)#woman -- Undefined(prove (goal '((woman @X #quoted list can contain multiple statements#-> ((@X . Ann))(be loves (Mark Ann))#-> loves(be loves (Mark Max))#-> loves(prove (goal '((loves Mark @X) (woman @X #as is seen here#-> ((@X . Ann))does that help?   Von: brunofrancosala...@gmail.comGesendet: 1. Juli 2018 11:49 nachm.An: picolisp@software-lab.deAntworten: picolisp@software-lab.deBetreff: A query in Pilog  I'm going through the "Learn Prolog Now!" ebook and I ran into this query:?- loves(marsellus,X), woman(X).And I can't figure out how to do it in pilog.Is there a function that can test multiple queries at once, like or/2 does?thanks
PԔ ‘ )m¢˜œ¢X¬¦Ê·«zV›uë.n7œ