<div dir="ltr"><div>Hello all,</div><div><br></div><div>I'm new to Mercury so I apologize if this question is naive. As a simple task I am trying to identify a conjugated french verb. <br></div><div><br></div><div>:- type person<br>      --->  firstSing</div><div>      ...<br>      ;     thirdPlur.<br></div><div><br></div>:- pred er_ending(person, string).<br>:- mode er_ending(in, in) is semidet.<br>:- mode er_ending(in, out) is det.<br>:- mode er_ending(out, in) is nondet.<br><br>er_ending(firstSing, "e").<br>er_ending(secondSing, "es").<br>er_ending(thirdSing, "e").<br>er_ending(firstPlur, "ons").<br>er_ending(secondPlur, "ez").<br><div>er_ending(thirdPlur, "ent").</div><div><br></div><div>This is only part of the program, but when I compile it I get this error:</div><div><br></div><div>Uncaught Mercury exception:<br></div><div>Software Error: predicate `ml_backend.ml_string_switch.ml_generate_string_binary_simple_lookup_switch'/11: Unexpected: model_non</div><div><br></div><div>I think this error may be due to how I am trying to use the predicate er_ending/2. Sure enough it was! Just before sending this mail I changed the modes to:</div><div><br></div><div>:- pred er_ending(person, string).<br>:- mode er_ending(in, in) is semidet.<br>:- mode er_ending(in, out) is det.<br>:- mode er_ending(out, out) is multi. <-- changed here.</div><div><br></div><div>And now it is working just dandy. I think I confused myself by assuming the second argument was bound when it fact it wasn't. Regardless I think it would be a good idea to handle the exception or provide helpful error message. I tried a lot of things before solving it just now. I should note that I did not receive an exception so long as the string argument of er_ending was unique in my facts. Commenting out 'er_ending(thirdSing, "e").' allows the program to compile even with the old mode.</div><div><br></div><div>I hope you find this email coherent,</div><div><br></div><div>Thanks,</div><div>Harrison<br></div><div><br></div><div><br></div></div>