%------------------------------------------------------------------------ % Program for which ANSWER COMPLETION is needed. I am not sure about % the answers (probably everything is undefined). %------------------------------------------------------------------------ :- table p/0, s/0, r/0. p :- p. p :- tnot(s). s :- tnot(r). r :- tnot(s), r. r :- p. %------------------------------------------------------------------------ test :- p, fail. test :- ( p -> ( tnot(p) -> writeln('p is undefined (OK)') ; writeln('p is true') ) ; writeln('p is false') ), ( s -> ( tnot(s) -> writeln('s is undefined (OK)') ; writeln('s is true') ) ; writeln('s is false') ), ( r -> ( tnot(r) -> writeln('r is undefined (OK)') ; writeln('r is true') ) ; writeln('r is false') ).