The following Linux command(s) verify the installed version.
gprolog --version
On
2019-08-05 the output was as follows.
Prolog top-Level (GNU Prolog) 1.4.4
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz
GNU Prolog comes with ABSOLUTELY NO WARRANTY.
This is free software; see the source or the file
named COPYING for copying conditions.
The file type of a
Prolog program file is
pro.
The following Linux command(s) create/edit a hello program in the your home directory using the nano text editor.
nano ~/hello.pro
Create the following program text in the editor that will output the text "Hello world"
:- initialization(main).
main:- print('Hello world'),nl.
To exit with save, remember to press
Ctrl-X, then "
y" (for yes) and
Enter to exit.
The following Linux command(s) run the program.
gplc --no-top-level ~/hello.pro
~/hello
The output should be as follows.
Hello world
The following Linux command(s) combine the compile and run steps.
gplc --no-top-level ~/hello.pro && ~/hello
On
the output was as follows.
Hello world