From: Marko Kreuzer
Subject: Lisp-Project
Date: 
Message-ID: <3779DBE2.9EFA701B@dive.informatik.fh-schmalkalden.de>
Hello together,

we are a project group (business and computer students 6. Terms) to the
University Schmalkalden/Germany
and deal with themselves with the creation of a prolog interpreter with
Golden Common Lisp.
We already created the fundamentals of the interpreter, i.e. simple
logical queries are already solved from system.
These queries have so far only "and" complexity e.g..

(query (father (? V) mike))   >> ((? V) ralph)            ((? V) =
Variable)

We will send the complete source code gladly. Now we are with the
development
of a " not" clause in the clamp. The past solution attempts ran so far
in the sand.

(query (not (father (? V) mike)) >> Output of all persons those are not
father of Mike

Can someone help us this way?

Thanks in advance.
Yours sincerely the project team.


Hallo zusammen,

wir sind eine Projektgruppe (Wirtschaftsinformatiker 6. Semester) an der
FH-Schmalkalden und befassen uns mit der Erstellung eines
Prolog-Interpreters mit Golden Common Lisp. Die Grundz�ge des
Interpreters haben wir bereits erstellt, d.h. einfache logische Abfragen
werden bereits von System gel�st. Diese Abfragen haben bisher nur eine
"und" Komplexit�t. z.B.

(anfrage (vater (? V) klaus))   >> ((? V) bernd)            ((? V) =
Variable)

Den vollst�ndigen Quellcode werden wir gerne zu schicken. Nun stecken
wir bei der Entwicklung einer "not"-Klausel in der Klemme. Die
bisherigen L�sungsversuche verliefen bisher im Sande.

(anfrage (not (vater (? V) klaus)) >> Ausgabe aller Personen die nicht
Vater von Klaus sind

Kann uns jemand auf diesem Weg weiterhelfen?

Danke im voraus.
Mit freundlichen Gr��en das Projektteam.

From: Lieven Marchand
Subject: Re: Lisp-Project
Date: 
Message-ID: <m3iu8560ai.fsf@localhost.localdomain>
Marko Kreuzer <·············@dive.informatik.fh-schmalkalden.de> writes:

> We will send the complete source code gladly. Now we are with the
> development
> of a " not" clause in the clamp. The past solution attempts ran so far
> in the sand.
> 

How is your prolog system structured? Did you implement a PAM-machine?
How are you dealing with cuts?

It's hard to give advice when you aren't more specific about the problems.
Note also that not in Prolog has a fairly weird semantic wrt backtracking.

-- 
Lieven Marchand <···@bewoner.dma.be>
If there are aliens, they play Go. -- Lasker
From: Stig Hemmer
Subject: Re: Lisp-Project
Date: 
Message-ID: <ekv9090ulww.fsf@verden.pvv.ntnu.no>
Marko Kreuzer <·············@dive.informatik.fh-schmalkalden.de> writes:

> ... prolog interpreter ...

> (query (not (father (? V) mike)) >> Output of all persons those are not
> father of Mike

Prolog NOT doesn't behave that way.  To see why, ask yourself: "What
is a person?".  You will see that your query above doen't have enough
information to answer that question.

The Prolog system will see that (father (?  V) mike) has a solution
and then say that (not ...) does not have a solution.  [Assuming that
Mike has a father in the database]

Try the following query:   [Guessing at syntax]

(query (and (is-person (? V))
            (not (father (? V) mike))))

That should work if your Prolog is correctly implemented.  [If I'm
thinking straight...]

Prolog NOT can be written entirely in Prolog using the CUT operator.
So if your interpreter supports CUT, implementing NOT should be a very
easy job.

I would suggest that your problem is that you don't understand how NOT
works in Prolog.  Read up on this.

Happy Hacking!

Stig Hemmer,
Jack of a Few Trades.
From: Gilbert Baumann
Subject: Re: Lisp-Project
Date: 
Message-ID: <ywbf7logmt5d.fsf@rz114s1.rz.uni-karlsruhe.de>
Marko Kreuzer <·············@dive.informatik.fh-schmalkalden.de> writes: 
>  
> we are a project group (business and computer students 6. Terms) to the 
> University Schmalkalden/Germany 
> and deal with themselves with the creation of a prolog interpreter with 
> Golden Common Lisp. 
> We already created the fundamentals of the interpreter, i.e. simple 
> logical queries are already solved from system. 
> These queries have so far only "and" complexity e.g.. 
>  
> (query (father (? V) mike))   >> ((? V) ralph)            ((? V) Variable) 
>  
> We will send the complete source code gladly. Now we are with the 
> development 
> of a " not" clause in the clamp. The past solution attempts ran so far 
> in the sand. 
>  
> (query (not (father (? V) mike)) >> Output of all persons those are not 
> father of Mike 
>  
> Can someone help us this way? 
 
Some remarks: 
 
1. You state that "(not (father (? V) klaus))" should deliver all 
   assignments for V, so that the _person_ V is not father of Klaus. 
   Where does this extra restriction, that V must be a person come 
   from? Why is V=17 no valid solution? 
 
2. [spoiler] In Prolog NOT is usually defined a little bit different: 
   (NOT x) <=> x is not provable.  
 
   A well known definition of NOT is therefore: 
 
   not X :- X, !, fail. 
   not X. 
 
3. Every better Prolog book explains that. A good start would be the 
   german copy of Sterling and Shaprio, "Prolog - Fortgeschrittene 
   Programmiertechniken", Addison-Wesley, 1988. 
 
Gilbert. 
-- 
;;; You know you have hacked Lisp too much, when you m-c-x in a C buffer.
From: Roos Van Raadshooven L.A. (Leon)
Subject: Re: Lisp-Project
Date: 
Message-ID: <roosvanr.931311465@biceps>
Gilbert Baumann <····@rz.uni-karlsruhe.de> writes:

>Marko Kreuzer <·············@dive.informatik.fh-schmalkalden.de> writes: 
>>  
>> we are a project group (business and computer students 6. Terms) to the 
>> University Schmalkalden/Germany 
>> and deal with themselves with the creation of a prolog interpreter with 
>> Golden Common Lisp. 
>> We already created the fundamentals of the interpreter, i.e. simple 
>> logical queries are already solved from system. 
>> These queries have so far only "and" complexity e.g.. 
>>  
>> (query (father (? V) mike))   >> ((? V) ralph)            ((? V) Variable) 
>>  
>> We will send the complete source code gladly. Now we are with the 
>> development 
>> of a " not" clause in the clamp. The past solution attempts ran so far 
>> in the sand. 

Paul Graham's book "On Lisp" contains an excellent description and code of both
a prolog interpreter and compiler.

Leon.