Re: Why does this not work ?

"Richard A. O'Keefe" <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 8/03/2014, at 8:05 AM, Roelof Wobben wrote:
> I have this problem.

This sounds uncommonly like homework.
> 
> Write a query against the item and inventory records that returns the inventory level for an item when you only know the item name. 
> 
> I have this facts:
> 
> customer(wobben, musselkanaal, aaa).
> 
> customer(ankone, hengelo, bbb).
> 
> customer("de jong", haaksbergen, ccc). 

Why all the blank lines?
Why is there no comment saying which argument
stands for what?
Why do the first two facts use atoms for whatever
argument 1 is, while the last fact uses a string?

> item(1, pan, 0). 
> item(2, beker, 1). 

Why is there no comment saying which argument
means what?
> 
> inventaris( 1, 12). 
> inventaris( 2, 10).

Why is there no comment .....
> 
> So I tried this:
> 
> inventaris(X,Y),item(X,pan,0).

I pasted your code into a file and tried it,
and it worked.  Next time, I think you had
better show us _exactly_ what you did.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.