This is not a bug.

X = [a,X] creates a cyclic term during the unification (this happens when a 
variables is unified with a compound term which contains this variable as 
subterm). Gnu Prolog does not handle cyclic terms. The standard unification 
does not perform the occurs check for efficiency reasons. There is a a 
predicate doing this test: unify_with_occurs_check.

unify_with_occurs_check(X, [a,X]) will fail.

Daniel


Le 23 mars 2012 à 15:24, Konstantin Weitz a écrit :

> gprolog segfaults on X = [a,X].
> The type of machine you are using (use uname -a under Unix).
> Linux open-client 3.0.0-16-generic-pae #29-Ubuntu SMP Tue Feb 14 13:56:31 UTC 
> 2012 i686 i686 i386 GNU/Linux
> 
> GNU Prolog version (use gprolog --version).
> Prolog top-Level (GNU Prolog) 1.4.1
> By Daniel Diaz
> Copyright (C) 1999-2012 Daniel Diaz
> 
> The precise commands we need to type to reproduce the bug.
> konne@open-client:~/gprolog-1.4.1/src/TopComp$ ./gprolog 
> GNU Prolog 1.4.1
> By Daniel Diaz
> Copyright (C) 1999-2012 Daniel Diaz
> | ?- X = [a,X].
> Segmentation fault
> 
> 
> -- 
> Ce message a été vérifié par MailScanner pour des virus ou des polluriels et 
> rien de suspect n'a été trouvé. 
> _______________________________________________
> Bug-prolog mailing list
> Bug-prolog@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-prolog


-- 
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.

_______________________________________________
Bug-prolog mailing list
Bug-prolog@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-prolog

Reply via email to