Re: [eclipse-clp-users] Simple problem - strange effect

From: Wit Jakuczun <wit.jakuczun_at_...6...>
Date: Thu, 22 Apr 2010 15:42:03 +0200
Hi Philipp,
  this program works as you expect:

:-lib(fd).
:-lib(propia).

con1(1,1,0).
con1(1,2,0).
con1(1,3,0).

cons(X,Y,B) :-
    con1(X,Y,B) infers most.

execute(X) :-
    X#::[1,2,3],    cons(1,X, B1), #=(X, 1, B2), B1 + B2 #>= 1.

This program should be (in my opinion) equivalent to yours.

Best regards
-- 
[ Wit Jakuczun  http://www.linkedin.com/in/jakuczunwit  ]



2010/4/22 Philipp Marcus <marcus@...247...>:
> Hi,
>
> given the following simple program:
>
> :-lib(fd).
> :-lib(propia).
>
> con1(1,1,0).
> con1(1,2,0).
> con1(1,3,0).
>
> cons(X,Y,B) :-
>     con1(X,Y,B) infers most.
>
> execute(X) :-
>     X#::[1,2,3],    cons(1,X)    #\/     X#=1.
>
> I'd expect that the domain of X is reduced to the value 1 as the first term
> cons(1,X)  can never be true. But i only get the answer
>
> ?- execute(X).
> No (0.00s cpu)
>
> I am wondering as (false \/ X=1 ) should imply that X has to be 1 to be
> true.
>
> Thanks in advance and best regards,
> Philipp
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
>
>
Received on Thu Apr 22 2010 - 13:42:14 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST