<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">I think I have reached my limit, Mercury is just too clever for me. I thought I was getting somewhere with it but now I am faced with yet another round of battling determinism errors and left feeling like somebody just shoved my face into a bucket of salty nails.</div><div class="">The fundamental issue is I don’t know what the hell I am doing, I don’t understand at least half the foreign language that the manuals are written in, but I cannot really find anything out there to train myself up. It all feels a bit of an uphill struggle some times.</div><div class=""><br class=""></div><div class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><div class="">I decided to factor out the disjuncts into separate predicates starting with the help one, as soon as I did...</div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier" class="">repl.m:108: In `parse_cmd'(out, in, out):</font></div><div class=""><font face="Courier" class="">repl.m:108: error: determinism declaration not satisfied.</font></div><div class=""><font face="Courier" class="">repl.m:108: Declared `semidet', inferred `nondet'.</font></div><div class=""><font face="Courier" class="">repl.m:111: Disjunction has multiple clauses with solutions.</font></div></div><div class=""><br class=""></div><div class=""><br class=""></div></div></div><font face="Courier" class="">:- pred parse_cmd(command::out, list(char)::in, list(char)::out) is semidet.<br class="">parse_cmd(Cmd) —><br class=""> (<br class=""> help_cmd(Cmd). %<=== this is line 111<br class=""> %['h','e','l','p'], skip_ws, eol, {Cmd=help}<br class=""> ;<br class=""> ['l','e','x'], skip_ws, eol, {Cmd=lex}<br class=""> ;<br class=""> ['a','s','t'], skip_ws, eol, {Cmd=ast}<br class=""> ).<br class=""><br class=""></font><div class=""><font face="Courier" class="">:- pred help_cmd(command::out, list(char)::in, list(char)::out) is semidet.<br class=""><br class=""></font></div><div class=""><font face="Courier" class="">help_cmd(Cmd) —><br class=""> ['h','e','l','p’],<br class=""> skip_ws,<br class=""> eol,<br class=""> {Cmd=help}.</font></div><div class=""><font face="Courier" class=""><br class=""></font><br class=""><div class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><font face="Courier" class="">>>> repl.m:111: Disjunction has multiple clauses with solutions.</font></div></div></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class="">What does this means in English? I know what the disjunction is, it’s the call to help_cmd(), what I don’t get is why it has multiple solutions, I know it is semidet so it might fail or it might succeed with a single solution.</div><div class="">I am going to bed thoroughly disillusioned. I fi didn’t need the money I’d quit software yesterday.</div><div class="">:|</div><div class=""><font face="Courier" class=""><br class=""></font></div></body></html>