bug-prolog
[Top][All Lists]
Advanced

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

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


From: Dave Sworin
Subject: Cut(!) and fail inside nested once/1 calls?
Date: Fri, 21 Sep 2012 11:14:18 -0700 (PDT)

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!)
 
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".
 
Is the cut(!) and fail scope limited inside the once/1 call?
 
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.
 

reply via email to

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