1

I am pulling my hair out! I have installed gprolog (1.4.4) on my Mac, and I am following (I think) the instructions in the Gnu Prolog manual to the letter, but the interactive environment is not remembering my definitions:

GNU Prolog 1.4.4 (64 bits)
Compiled Sep 26 2016, 00:06:17 with clang
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz
| ?- [user].
compiling user for byte code...
even(0).
even(s(s(X))) :- even(X).

user compiled, 3 lines read - 362 bytes written, 21729 ms

(2 ms) yes
| ?- even(X).
uncaught exception: error(existence_error(procedure,even/1),top_level/0)
| ?- 

As you can see from the interactive response, I enter Ctl-D after the second line of my knowledge base input (my only rule). Gprolog says that it has compiled my three lines. Why can't it recognize my query correctly? Thanks!

Amittai Aviram
  • 2,270
  • 3
  • 25
  • 32

0 Answers0