info-gnuprologjava
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Info-gnuprologjava] Problems understanding the usage of the GNU Pro


From: Daniel Thomas
Subject: Re: [Info-gnuprologjava] Problems understanding the usage of the GNU Prolog API
Date: Tue, 22 Feb 2011 22:28:41 +0000

Hello,

You might want to look at the listing/1 or findall/3 predicates for
looking at what knowledge has been gained thus far.

> Also it seems that my prolog rules generate infinite knowledge. Do you
> perhaps know of an inbuilt predicate to prevent this?

I am not quite sure what you mean by infinite knowledge? Do you mean
that it is creating an infinite number of predicate values and hence not
terminating? In that case you probably want to alter your rules so that
doesn't happen. If you are not sure how to do so then you probably need
to find some guide to help teach you prolog. I had the advantage of
lectures on it http://www.cl.cam.ac.uk/teaching/0910/Prolog/ was a very
good and well taught course but just reading the lecture notes probably
doesn't help as much as one might like.

You can put write/1 instructions or use listing/1 or findall/3 at
various different points in your prolog to see what is happening there.
It would be neater if trace/0 was working but I don't think that it is.
You might try debugging your prolog using a normal prolog interpreter
such as gnuprolog or swiprolog.

I hope this helps,

Daniel

On Tue, 2011-02-22 at 22:03 +0100, Daniel Warzecha wrote:
> Hello again,
> 
> 
> thank you for your help so far.
> 
> 
> I started producing goal results. Now is the time to debug my prolog
> rules.
> 
> 
> Is there some way to print the knowledge that has been gained so far?
> 
> 
> So I could trace a goal like this?
> 
> 
> isKey(X)?
> 
> 
> X -> isSymKey(X) -> isKey(X).
> 
> 
> Also it seems that my prolog rules generate infinite knowledge. Do you
> perhaps know of an inbuilt predicate to prevent this?
> (Do not feel that you need to answer this, this is just from a
> relatively new prolog user to someone who maintains a problem domain
> library)
> 
> 
> Greetings,
> 
> 
> Daniel Warzecha

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]