Re: [eclipse-clp-users] Not equal constraint in String

From: <mskala_at_...206...>
Date: Mon, 22 Jun 2015 00:16:59 -0500 (CDT)
On Mon, 22 Jun 2015, Edgaonkar, Shrirang wrote:
> What is the difference ? Am I missing anything here ?

\= isn't a constraint and it doesn't mean "not equal."  It is a logical
statement true if its operands cannot be unified.

In your second example, when the interpreter attempts to satisfy
STR1 \= "", at that point STR1 is a free variable.  It *can* in fact be
unified with "", so the statement "it is not possible to unify STR1 with
"" " is false, and the goal fails.  The other example worked because it
was waiting until STR1 had a (ground, not free variable) value before
testing it.

I don't know if the not-equal constraints in any of the constraint
libraries will work with strings, but that's what you need; if there isn't
one ready-made, you may have to create a custom one.

-- 
Matthew Skala
mskala_at_...206...                 People before principles.
http://ansuz.sooke.bc.ca/
Received on Mon Jun 22 2015 - 05:09:34 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:21 CEST