Re: [eclipse-clp-users] Boolean value behaviour

From: Edgaonkar, Shrirang <Shrirang.Edgaonkar_at_nttdata.com>
Date: Mon, 8 Feb 2016 05:15:50 +0000
Dear clp users,



 Sorry but I found the solution.



:- lib(ic).
solveNull(A,B):-

A #:: 0..1,
B #:: 0..1,

A ~= B,
B = 1,
var(A).



Using the sound difference operator works for me.



Thanks and Regards,

Shrirang Edgaonkar

________________________________
From: Edgaonkar, Shrirang [Shrirang.Edgaonkar_at_nttdata.com]
Sent: 08 February 2016 13:01:49
To: eclipse-clp-users_at_lists.sourceforge.net
Subject: [eclipse-clp-users] Boolean value behaviour


Dear clp users,



 Following is the script that executes:-

Script 1:



:- lib(ic).
solveNull(A,B):-

A #:: 0..1,
B #:: 0..1,

A #\= B,
B #= 1.



It provides the solution of A as 0 and B as 1 but I do not wish to have A as 0. I wish to restrict A to be var(See the script 2 below. It should pass.). One solution is to change the domain of A to 0..2 or 0..3. Is there a cleaner way of doing it?



Script 2:

:- lib(ic).
solveNull(A,B):-

A #:: 0..1,
B #:: 0..1,

A #\= B,
B #= 1,
var(A).



I am almost sure there isn't any solution to it but I wanted my search subroutine to decide the value of A.



Kindly help me.



Thanks and Regards,

Shrirang Edgaonkar

______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.

______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.
Received on Mon Feb 08 2016 - 05:16:02 CET

This archive was generated by hypermail 2.2.0 : Mon Feb 08 2016 - 15:13:13 CET