bug-prolog
[Top][All Lists]
Advanced

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

Re: system_error(cannot_catch_throw(error(existence_error(procedure, (>


From: Daniel Diaz
Subject: Re: system_error(cannot_catch_throw(error(existence_error(procedure, (>)/2), findall/3)))
Date: Mon, 14 Sep 2015 09:01:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Hi,

Sorry for the late reply

this is not a bug. With --min-pl-bips only statically referenced predicates are part of the executable (member/2 is dynamically called).
To avoid this you can:
  • avoid the use of --min-pl-bips and friends (e.g. min-bips,...)
  • explicitely call member/2 (eg. adding a dummy clause: dummy :- member(_,_).)
  • use a directive called ensure_linked(member/2).

Daniel



Le 14/07/2015 16:34, Gustavo Brown - INCO a écrit :
I am getting the following error when compiling a simple snippet
 
system_error(cannot_catch_throw(error(existence_error(procedure,(>)/2),findall/3)))
 
To reproduce, create a file (test.pl) with this code:
 
:-initialization(findall_bug).
 
findall_bug:-
  write(findall_bug),nl,
  findall(Att, (member(Att, [6, 0]), Att > 0), XParmAs),
  write(XParmAs),nl,
  findall(Att, findall_bug1([6,0], Att), ParmAs),
  write(ParmAs),nl,
  write(done),nl,
  !. 
 
findall_bug1(Parms, Att):-
 member( Att, Parms),
 Att > 0.
 
I usually compile the generated assembly file with this two steps:
  gplc -S test.pl -o test.s
  mingw-as - o test.obj --32 test.s
and link with MSVC linker.
 
However, I can reproduce this using only gplc:
 
gplc --no-top-level --min-pl-bips -o test.exe test.pl
 
Output of execution is:
 
findall_bug
 
system_error(cannot_catch_throw(error(existence_error(procedure,(>)/2),findall/3)))
 
system_error(cannot_catch_throw(error(existence_error(procedure,(>)/2),findall/3)))
[]
[6]
done
 
If you compile without --min-pl-bips, the output is right
It seems that the compiler treats differently the arithmetic comparison inside findall, and does not include some library code when using --min-pl-bips (and also linking directly with MSVC)
 
Using GNU Prolog 1.4.4
 
Regards,
  Gustavo
 
 

--
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
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-prolog


--
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]