:- module termination. :- interface. :- import_module char, list. % no problem if this is commented out and --infer-all enabled :- pred tokenizable(list(char)::in) is semidet. :- implementation. :- import_module string. tokenizable(Line) :- (Line = [], true; identifier(_, Line, Line1), tokenizable(Line1)). :- pred is_digit_term(char::in) is semidet. % this pragma behaves as expected (try commenting out) :- pragma terminates(is_digit_term/1). is_digit_term(C) :- is_digit(C). :- func from_char_list_term(list(char)) = string. :- pragma terminates(from_char_list_term/1). % this triggers the "termination constant of infinity" warnings from_char_list_term(L) = from_char_list(L). % this does not %from_char_list_term(L) = "X". :- pred identifier(string::out, list(char)::in, list(char)::out) is semidet. identifier(from_char_list_term([C])) --> [C], { is_digit_term(C) }.