Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!Risch@SRI-AI From: Risch@SRI-AI@sri-unix.UUCP Newsgroups: net.lang.prolog Subject: Puzzle Solution { Liar - Truthteller } Message-ID: <4017@sri-arpa.UUCP> Date: Tue, 2-Aug-83 12:11:35 EDT Article-I.D.: sri-arpa.4017 Posted: Tue Aug 2 12:11:35 1983 Date-Received: Wed, 10-Aug-83 17:01:21 EDT Lines: 17 From: Tore Risch % My solution uses the standard Prolog interpreter by adding minimal % information for such goals wich cannot be proved by the standard % interpreter. ( Since Prolog a.o. cannot distinguish between 'not % provable' and 'false' ) One extra predicate is needed ( see below ). % This predicate is deduced from the fact that noone can be both % a truthteller and a liar at the same time. % To avoid looping the extra predicate replaces some other predicates. notp(says(X,l(X))). % This is the extra predicate. notp(Y):- p(says(X,Y)),p(l(X)). p(says(b,says(a,l(a)))). p(says(c,l(b))). p(l(X)):- p(says(X,Y)),notp(Y). p(t(X)):- p(says(X,Y)),p(Y). % p(Y):-p(says(X,Y)),p(t(X)). % Removed