Re: uncaught exception: error(existence_error(procedure,even/1),top_level/0)

JSibelius <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>

James Gale wrote:
> 
> Hi I'm a newbee to prolog, and have just installed gnu prolog but what
> every I enter into the console I get this error, uncaught exception:
> error(existence_error(procedure,even/1),top_level/0)
> 
> example.
> 
> GNU Prolog 1.3.1
> By Daniel Diaz
> Copyright (C) 1999-2009 Daniel Diaz
> | ?- even(X).
> uncaught exception: error(existence_error(procedure,even/1),top_level/0)
> 
> not sure if the installation was wrong, but got not errors or I'm missing
> something very simple.
> also is there a good FAQ's page for this interpreter.
> 
> many thanks
> 
> James.
> 
> ps. sorry if this is a silly posting but didn't know what else to try :S 
> 
> 

I had the same error, but I figured it out :) What you have to do is create
a "logic database". This is a simple text file with the facts and the rules
of the program (or the "program's universe" if u like :P) Make a blank text
file and enter:

even(a).
even(b).

compile with:

petko@ubuntu:~/prog/prolog$ gplc nubble.pro 

execute with:

petko@ubuntu:~/prog/prolog$ ./nubble 

This is what you get:

GNU Prolog 1.3.0
By Daniel Diaz
Copyright (C) 1999-2007 Daniel Diaz
| ?- even(X).

X = a ? ;

X = b

yes
| ?- even(a).

yes
| ?- even(c).

no
| ?- 

I hope this helps :)

-- 
View this message in context: http://old.nabble.com/uncaught-exception%3A-error%28existence_error%28procedure%2Ceven-1%29%2Ctop_level-0%29-tp22366566p26804308.html
Sent from the Gnu - Prolog - Users mailing list archive at Nabble.com.
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.