bug-prolog
[Top][All Lists]
Advanced

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

Re: Cut(!) and fail inside nested once/1 calls?


From: Daniel Diaz
Subject: Re: Cut(!) and fail inside nested once/1 calls?
Date: Mon, 24 Sep 2012 09:11:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0

Hi Dave

Le 21/09/2012 20:14, Dave Sworin a écrit :
Please advise whether the following behavior is a bug.
Test platforms tried: 1) Ubuntu 10.10 64-bit gprolog 1.3.1 and 2) Mint 13 64-bit gprolog 1.4.1
 
once((
(once(((4 == 5) ; (!,fail)))) ;
(write(a))
)).
 
This query writes the letter a to the standard output.  (I hope I typed all the parentheses correctly!)
Correct behavior.
 
If I remove the once/1 call inside the outer once/1, the cut(!) and fail works as expected.
 
once((
((((4 == 5) ; (!,fail)))) ;
(write(a))
)).
 
This query fails with a "no".
Correct behavior.
 
Is the cut(!) and fail scope limited inside the once/1 call?
You said it :-) once/1 is a built-in predicate (it is not a control construct). So it is not transparent to cut (i.e. the scope of cut is the Goal of once/1).

Daniel
 
Dave
 
PS: Everything seems to work fine in gprolog 1.4.1 but in the debugger I experienced segmentation
violations debugging after consulting a very large prolog file bug exact same thing works fine in
gprolog 1.3.1.  Have other people experienced this too.  I do not have a small example.
 
PS: I would be interested in getting this large file. Can I get by ftp (or other) a zipped version of this file ?
(you can write to me directly: address@hidden)


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