Mercury Bugs - mercury
View Issue Details
0000285mercuryBugpublic2013-05-22 11:242013-06-28 15:54
Reporterpbone 
Assigned To 
PrioritynormalSeveritytweakReproducibilityhave not tried
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000285: Mode error is misleading
DescriptionA mode error can be causes when code is multidet when it is declared as det. In these case the error text uses the phrase "multiple clauses with solutions". Even for single clause predicates.
Steps To ReproduceCreate a single clause predicate declared as det such as:

update_atom_in_map(Atom, SubstsA, Status, OrigHt, !Map) :-
    (
        ( map.search(!.Map, Atom, EntryPrime) ->
            Entry = EntryPrime
        ; version_hash_table.search(OrigHt, Atom, EntryPrime) ->
            Entry = EntryPrime
        ;
            false
        ), # HERE is the error, this should be a -> rather than a ,
        Entry = memo_table_entry(SubstsB, _),
        Substs = SubstsA `union` SubstsB
    ;
        Substs = SubstsA
    ),
    set(Atom, memo_table_entry(Substs, Status), !Map).
TagsNo tags attached.
Attached Files

Notes
(0000525)
juliensf   
2013-05-22 13:15   
The only such error message I can find is:

     "Disjunction has multiple clauses with solutions."

That seems fairly unambiguous for the example above.
(0000547)
pbone   
2013-06-28 15:36   
I don't like the confusion with clauses. Could it say something like "Disjunction has multiple parts with solutions?"
(0000549)
juliensf   
2013-06-28 15:54   
"clause" is a standard term in predicate logic for describing the "parts" of a disjunction. As I said in my original reply, I don't see that the error message has any ambiguity anyway.

Issue History
2013-05-22 11:24pboneNew Issue
2013-05-22 13:15juliensfNote Added: 0000525
2013-06-28 15:36pboneNote Added: 0000547
2013-06-28 15:54juliensfNote Added: 0000549