View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000009 | mercury | Bug | public | 2007-09-28 00:13 | 2007-10-13 22:39 | ||||||||
Reporter | juliensf | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000009: spurious error message when testing equivalence of equal things | ||||||||||||
Description | From bojar@csse.unimelb.edu.au Fri May 18 19:03:54 2007 Date: Fri, 18 May 2007 19:06:43 +1000 From: Ondrej Bojar <bojar@csse.unimelb.edu.au> To: mercury-bugs@csse.unimelb.edu.au Subject: spurious error message when testing equivalence of equal things Hi. When compiling this code: :- module testbug. :- interface. :- import_module io. :- pred main(io::di, io::uo) is det. :- implementation. :- import_module list, int. main(!IO) :- A = [1,2,3], B = [1,2,3], ( if A = B % if same(A, B) % use this to compile seamlessly then io.write_string("yes\n", !IO) else io.write_string("no\n", !IO) ). :- pred same(T::in, T::in) is semidet. same(A, B) :- A = B. The compiler emits a lengthy message: testbug.m:013: In clause for `'__Unify__'(in, (unique(list.'[|]'(unique(1), testbug.m:013: unique(list.'[|]'(unique(2), unique(list.'[|]'(unique(3), testbug.m:013: unique((list.[])))))))) >> unique(list.'[|]'(unique(1), testbug.m:013: unique(list.'[|]'(unique(2), unique(list.'[|]'(unique(3), testbug.m:013: unique((list.[]))))))))), (unique(list.'[|]'(unique(1), testbug.m:013: unique(list.'[|]'(unique(2), unique(list.'[|]'(unique(3), testbug.m:013: unique((list.[])))))))) >> unique(list.'[|]'(unique(1), testbug.m:013: unique(list.'[|]'(unique(2), unique(list.'[|]'(unique(3), testbug.m:013: unique((list.[]))))))))))': testbug.m:013: mode error: argument 2 did not get sufficiently instantiated. testbug.m:013: Final instantiatedness of `HeadVar__1' was testbug.m:013: `unique(list.'[|]'(bound(1), bound(list.'[|]'(bound(2), testbug.m:013: bound(list.'[|]'(bound(3), bound((list.[]))))))))', testbug.m:013: expected final instantiatedness was testbug.m:013: `unique(list.'[|]'(unique(1), unique(list.'[|]'(unique(2), testbug.m:013: unique(list.'[|]'(unique(3), unique((list.[]))))))))'. testbug.m:016: Warning: the condition of this if-then-else cannot fail. The code seamlessly compiles if I test for the equivalence using an extra predicate call to same/2. The issue does not arise with primitive types, e.g. A=1, B=1. Thanks, O. -- Ondrej Bojar (mailto:obo@cuni.cz / bojar@ufal.mff.cuni.cz) http://www.cuni.cz/~obo | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2007-09-28 00:13 | juliensf | New Issue | |
2007-09-28 00:13 | juliensf | File Added: testbug.m | |
2007-10-09 17:23 | anonymous | Note Added: 0000011 | |
2007-10-09 17:24 | anonymous | Note Added: 0000012 | |
2007-10-13 04:02 | anonymous | Note Added: 0000015 | |
2007-10-13 04:02 | anonymous | Note Added: 0000016 | |
2007-10-13 08:52 | anonymous | Note Added: 0000017 | |
2007-10-13 13:07 | anonymous | Note Added: 0000018 | |
2007-10-13 22:39 | anonymous | Note Added: 0000020 | |
2007-10-23 18:37 | juliensf | Note Deleted: 0000011 | |
2007-10-23 18:37 | juliensf | Note Deleted: 0000012 | |
2007-10-23 18:38 | juliensf | Note Deleted: 0000020 | |
2007-10-23 18:38 | juliensf | Note Deleted: 0000018 | |
2007-10-23 18:38 | juliensf | Note Deleted: 0000017 | |
2007-10-23 18:39 | juliensf | Note Deleted: 0000015 | |
2007-10-23 18:39 | juliensf | Note Deleted: 0000016 |