%------------------------------------------------------------------------ % Program for which ANSWER COMPLETION is needed (it should have only % one answer for p). %------------------------------------------------------------------------ :- table p/0, s/0, r/0. p :- p. p :- tnot(s). s :- tnot(r), s. r :- tnot(s), r. %------------------------------------------------------------------------ test :- p, fail. test :- ( p -> ( tnot(p) -> writeln('p is undefined') ; writeln('p is true (OK)') ) ; writeln('p is false') ), ( s -> ( tnot(s) -> writeln('s is undefined') ; writeln('s is true') ) ; writeln('s is false (OK)') ), ( r -> ( tnot(r) -> writeln('r is undefined') ; writeln('r is true') ) ; writeln('r is false (OK)') ).