0

I am learning Prolog, using GNU Prolog on Mac OS X. I am getting the following error from interactive mode:

GNU Prolog 1.3.1
By Daniel Diaz
Copyright (C) 1999-2009 Daniel Diaz
| ?- between(0,5,X).
uncaught exception: error(existence_error(procedure,between/3),top_level/0)
| ?- halt.

But between/3 is supposed to be a built-in predicate, I thought. Why is this happening and what can I do about it? Thanks!

Paulo Moura
  • 18,373
  • 3
  • 23
  • 33
Amittai Aviram
  • 2,270
  • 3
  • 25
  • 32
  • 4
    upgrade your installation or take a Prolog definition – CapelliC Oct 09 '16 at 06:20
  • The `between/3` built-in predicate was added to GNU Prolog in version 1.4.1. – Paulo Moura Oct 09 '16 at 14:45
  • Ah! Thank you, Paulo! In fact, I had suspected that, and tried to update gnu-prolog using Homebrew. Now I can see that I had a couple of problems: (1) I had issued the command "brew reinstall Gnu Prolog," and, apparently, Homebrew has no "reinstall" command (although it looked as if it were doing something--odd); (2) After uninstalling and reinstalling, I eventually found out that Homebrew now installs software in /usr/local/Cellar, but my "gprolog" command was a symlink pointing to something below /opt/usr/local (now I don't remember). Changing the symlink fixed this. – Amittai Aviram Oct 09 '16 at 17:31

0 Answers0