<div dir="ltr">To paraphrase Neo, "I know Prolog".<div><br></div><div>but I don't know Mercury and I am struggling to figure out this error....I am porting some old SWI code and it boils down to the fact that I obvuisly don't truly understand what "det" means! Here is the code both as discrete disjunctive clauses and a single big disjunct:</div><div><br></div><div>:- pred char_type(char::in, chartype::out) is det.<br><br></div><div>char_type(')', p_open).<br>char_type('(', p_close).<br>char_type(_, c_general).<br><br>char_type(C, T) :-<br>    (<br>        C = '(', T = p_open<br>    ;   C = ')', T = p_close<br>    ;   C = _,   T = c_general<br>    ).<br></div><div><br></div><div>and here is the compiler output:</div><div><br></div><div>fl1.m:049: In `char_type'(in, out):<br>fl1.m:049:   error: determinism declaration not satisfied.<br>fl1.m:049:   Declared `det', inferred `multi'.<br>fl1.m:056:   Disjunction has multiple clauses with solutions.<br></div><div><br></div><div>Now...I understand why (I think) this happens: it's because the final matching disjuny can match more than one character value hence the multiple (multi) classification by the compiler BUT he calling loop seeks merely to convert a character into a character type.</div><div><br></div><div>Is this "cc_multi" in disguise as if the character is not one of the ones explicitly tested for then I will commit to the first choice as it will be a "general" character i.e. one with no special meaning to my little lexer.</div><div><br></div><div>Thank you,</div><div>Sean.</div><div><br></div></div>