%------------------------------------------------------------------------ % Program that causes a segmentation fault (because the parent tabled % choice point register is wrongly updated). % % Model T = {}, F = {t}, U = {p,q,r}. %------------------------------------------------------------------------ :- table p/0, q/0, r/0, t/0. p :- tnot(q), tnot(r), p. p :- tnot(t), tnot(r). q :- tnot(q), tnot(r), p. r :- tnot(q), p, tnot(r). t :- fail. %------------------------------------------------------------------------ test :- q, fail. test :- ( p -> ( tnot(p) -> writeln('p is undefined (OK)') ; writeln('p is true') ) ; writeln('p is false') ), ( q -> ( tnot(q) -> writeln('q is undefined (OK)') ; writeln('q is true') ) ; writeln('q is false') ), ( r -> ( tnot(r) -> writeln('r is undefined (OK)') ; writeln('r is true') ) ; writeln('r is false') ), ( t -> ( tnot(t) -> writeln('t is undefined') ; writeln('t is true') ) ; writeln('t is false (OK)') ).