Re: SWI Prolog forgets identity of query variables in CHR ???
Uwe Lesta <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <DADDA4CE0F00374BB9EA2BEDBFF2CCDF602BF22865@SERVER.SBS.SBS-Softwaresysteme.de> |
Hello Henning, What did you expect when queering ?- c(X,Y). ? Remember CHR select a constraint by matching the not by unification. If unification is needed the CHR constraint has to be c(X,Animal) <=> Animal = cow | d(X,pig). Hope this helps Uwe > -----Original Message----- > From: [email protected] > bonn.de [mailto:swi-prolog-bounces+lesta=sbs- > [email protected]] On Behalf Of Henning > Christiansen > Sent: Tuesday, February 25, 2014 12:43 PM > To: [email protected] > Subject: [SWIPL] SWI Prolog forgets identity of query variables in CHR > ??? > > Hi SWIPL team, > > I observed strange problem that the identity of variables in CHR > queries are sometimes forgotten when the resylt is printed out. > I could isolate the problem into a one rule program. > For the two test queries, no rule is applied; > the first one behaves as you would expect, but in the second one, my > query variables gets renamed and thus the semantics of the answer is > wrong. > > If I have a program with no rules, no misbehaviour is observed > > (running on Mac OS 10.9.1) > > best wishes > > Henning > > > The program: > > :- use_module(library(chr)). > :- chr_constraint c/2, d/2. > c(X,cow) <=> d(X,pig). > > Queries: > $ swipl > Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 6.6.1-DIRTY) > .... > > ?- [program]. > % library(chr) compiled into chr 0.51 sec, 6,504 clauses > % program compiled 0.51 sec, 6,551 clauses > true. > > ?- c(X,duck). > c(X,duck) > true . > c(X,duck) > > ?- c(X,Y). > c(_G30729,_G30730) > true . > c(_G30729,_G30730) > > > > > > Henning Christiansen > Professor of Computer Science, PhD > Leader of Research group PLIS: Programming, Logic and Intelligent > Systems > Department of Communication, Business and Information Technologies > Roskilde University > P.O.Box 260, DK-4000 Roskilde, DENMARK > http://www.ruc.dk/~henning > > -------------- next part -------------- > HTML attachment scrubbed and removed > _______________________________________________ > SWI-Prolog mailing list > [email protected] > https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog