[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Gprolog member/2 error ?!
From: |
Pedro Fialho |
Subject: |
Gprolog member/2 error ?! |
Date: |
Sun, 22 Aug 2010 16:32:38 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Hi all,
I found a strange error on my gprolog coding, namely on the source:
pred1([R-C-P|Ls], [R-C-P|Ls1]):-
memberchk(rel(_,X,Y), C),
memberchk(rel(_,Y,_), C),
nth(1,P,Z),
...
I get the debug output:
...call pred1...
6913 3 Call:
memberchk(
rel(_215226,_215227,_215228),
['conclusao'(_198617),'diagnostico'(_198661),
paciente(_198705),nome(_198705,'Rita Ambrosio'),
rel(de,_198617,_198661),rel(para,_198617,_198705)
]
) ?
6913 3 Exit:
memberchk(
rel(de,_198617,_198661),
['conclusao'(_198617),'diagnostico'(_198661),
paciente(_198705),nome(_198705,'Rita Ambrosio'),
rel(de,_198617,_198661),rel(para,_198617,_198705)
]
) ?
6914 3 Call:
memberchk(
rel(_215255,_198661,_215257),
['conclusao'(_198617),'diagnostico'(_198661),
paciente(_198705),nome(_198705,'Rita Ambrosio'),
rel(de,_198617,_198661),rel(para,_198617,_198705)
]
) ?
6914 3 Exit:
memberchk(
rel(de,_198617,_198617),
['conclusao'(_198617),'diagnostico'(_198617),
paciente(_198705),nome(_198705,'Rita Ambrosio'),
rel(de,_198617,_198617),rel(para,_198617,_198705)
]
) ?
+ 6915 3 Call: nth(1,[ser(_198749,a:_198617)],_215322) ?
...
Also tried with member/2 but the List is always changed on exit of the
secound call to member/2. Notice the rel(de,_198617,_198661) predicate
is changed to rel(de,_198617,_198617) although member/2 is not stated
as a destructive process.
Although my rel/3 predicate contains a literal and 2 prolog variables
I'd like to compare variable instances, as stated on the above source.
Any help ?
Greetings,
Peter
- Gprolog member/2 error ?!,
Pedro Fialho <=