Hi, Steve.
The compiler does not even attempt to make such judgements for elseif.
The reason the predicates works, while the function doesn't is that you use "RET" after the if-construction in function but not in the predicate.
Completeness analysis is made plain pattern matching using and and or:clauses
test(DOM) :-
(
DOM=one, RET=1
or
DOM=two, RET=2
),
stdio::write(Ret).
and for pattern matching in arguments:clauses
test(one) :-
RET=1,
stdio::write(Ret).
test(two) :-
RET=1,
stdio::write(Ret).