Re: [eclipse-clp-users] Another compiler bug

From: Kish Shen <kisshen_at_...5...>
Date: Mon, 23 Feb 2009 17:42:59 +0000
Hi Stephan,

Thanks for the bug report. I have taken a look at the abstract machien 
code that is generated for this program, and it does look wrong --
when the q/2 is called with C bound to 1, the indexing code incorrectly
commits to the then branch before doing the B=b unification, so that 
when the unification fails (a = b in your case), the whole query fails.

Cheers,

Kish

Stephan Schiffel wrote:
> Hi all,
> 
> I think, I found another bug (tested with version 6.0#72).
> The query p in the following program fails and prints "if" but neither "then" 
> nor "else".
> 
> p :- q(a, 1).
> 
> q(A, C) :-
>   equal([A], [B]),
>   writeln("if"),
>   (B=b, C=1 ->
>     writeln("then")
>   ;
>     writeln("else")
>   ).
> 
> equal(A, A).
> 
> The program works as expected, if the condition of the if-then-else part is 
> replaced with
>   (\+ (B\=b ; C\=1) ->
> or 
>   (\+ \+ (B=b, C=1) ->
> 
> Regards,
> Stephan
> 
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Mon Feb 23 2009 - 17:43:05 CET

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST