Re: clp problem w/ gnu prolog
- From: suranap@xxxxxxxxx
- Date: 15 Jul 2006 09:31:58 -0700
I was afraid of that. Is there a way to collect references to variables
in L? Sometimes pattern matching isn't appropriate, and nth is
preferable.
Neng-Fa Zhou wrote:
% This doesn't work the same.
test2(L) :-
fd_domain(L,1,4),
findall(V1,(for(C1,1,2),nth(C1,L,V1)),As),
findall(V2,(for(C2,3,4),nth(C2,L,V2)),Bs),
fd_all_different(As),
fd_all_different(Bs),
fd_labeling(L).
| ?- length(L,4),test2(L).
L = [1,1,1,1] ?
You get this result because the constraints are on As and Bs, which contain
copies of variables of those in L.
--nf
.
- References:
- clp problem w/ gnu prolog
- From: suranap
- Re: clp problem w/ gnu prolog
- From: Neng-Fa Zhou
- clp problem w/ gnu prolog
- Prev by Date: Re: clp problem w/ gnu prolog
- Next by Date: Problem with Parsing
- Previous by thread: Re: clp problem w/ gnu prolog
- Next by thread: Problem with Parsing
- Index(es):