%------------------------------------------------------------------------ % Program that causes a seg fault when interpreted. % % Model T = {p}, F = {q}, U = {r}. %------------------------------------------------------------------------ % :- auto_table. :- table p/0, r/0, q/0. p :- tnot(q). p :- tnot(q),r. q :- tnot(p),q. r :- tnot(p),tnot(r),q. r :- tnot(q),tnot(r),p. %------------------------------------------------------------------------ test :- r, fail. test :- ( p -> ( tnot(p) -> writeln('p is undefined') ; writeln('p is true (OK)') ) ; writeln('p is false') ), ( q -> ( tnot(q) -> writeln('q is undefined') ; writeln('q is true') ) ; writeln('q is false (OK)') ), ( r -> ( tnot(r) -> writeln('r is undefined (OK)') ; writeln('r is true') ) ; writeln('r is false') ).