bug-prolog
[Top][All Lists]
Advanced

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

GNU Prolog segfaults on simple math (Mac OS Lion )


From: Tomasz Baranski
Subject: GNU Prolog segfaults on simple math (Mac OS Lion )
Date: Mon, 21 Nov 2011 22:31:21 +0100

First things first:

$ uname -a
Darwin Air-Tomka.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9
20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

$ gprolog --version
Prolog top-Level (GNU Prolog) 1.4.0
By Daniel Diaz
Copyright (C) 1999-2011 Daniel Diaz




Given the following code:

example1(X) :- X is 1.
example2(X) :- X is 1+1.



when I run it with gprolog, I get:

$ gprolog
GNU Prolog 1.4.0
By Daniel Diaz
Copyright (C) 1999-2011 Daniel Diaz
| ?- ['example'].
compiling /Users/tomo/projects/7L7W/prolog/day2/example.pl for byte code...
/Users/tomo/projects/7L7W/prolog/day2/example.pl compiled, 1 lines
read - 490 bytes written, 7 ms

(1 ms) yes
| ?- example1(X).

X = 1

yes
| ?- example2(X).

Fatal Error: Segmentation Violation



However, if I compile the file:

$ gplc example.pl -o example
$ ./example
GNU Prolog 1.4.0
By Daniel Diaz
Copyright (C) 1999-2011 Daniel Diaz
| ?- example1(X).

X = 1

yes
| ?- example2(X).

X = 2

yes



I might be missing something... I'm just learning Prolog.


Tomo



reply via email to

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