[Top][All Lists]

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

Re: Launch gprolog with sh

From: Daniel Diaz
Subject: Re: Launch gprolog with sh
Date: Fri, 30 Mar 2012 10:26:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2


this works well on my machine. I suspect your version is too old (last stable is 1.4.0 and 1.4.1 is in preparation).

The best if to get a more recent version (1.4.0). Either update your ubuntu package or install a new version from sources
(in that case please get the last snapshot at

If you don't update your version you can try to avoid the --entry-goal using a initialization directive to launch init. To do this add in your file:

:- initialization(init).

You can also easily compile it to provide a native executable:


Adding (the initialization directive as explained above).

The execute it with:


Then you can add call the halt/0 predicate (or friends like stop/0) and/or gplc linker options like --min-bips or --no-top-level

BTW: If you upgrade to 1.4.0, you can use the gprolog shebang support (
For this add a very first line in you like:

#!<path_to_gprolog_executable>/gprolog --consult-file

:- initialization(init).

And then you simply execute your script with (after a chmod a+x ./



Le 30/03/2012 09:43, Paolo Parise a écrit :

I'm writing a script (.sh) which should launch gprolog, load a file ( and the initial query (init) in the same file which is in the form:

init :-

but there's something wrong (it seems in the consulting of
gprolog --consult-file --entry-goal 'init, nl'
(error message:)

address@hidden:~/Desktop$ sh
GNU Prolog 1.3.0
By Daniel Diaz
Copyright (C) 1999-2007 Daniel Diaz
warning: command-line goal 'init, nl' caused exception: error(existence_error(procedure,init/0),'command-line')
| ?-

Manually I do the follow:
| ?- [name]
| ?- init.
... processing

Have you got a clue?

Thanks in advance!

Paolo P. 

Ce message a été vérifié par MailScanner pour des virus ou des polluriels et rien de suspect n'a été trouvé.

reply via email to

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