First, read a description of the town
called Saints and Sinners found here,
then use your browser to return here. You've
decided not to leave the town after all but
to prospect for gold, which, as you now remember,
is the reason you trekked out into the
badlands in the first place. The following
notation is used: "StX" denotes the statement
"resident X is a Saint". This statement
is either true or false. Let g denote the statement
"There is gold in the mountains just north of
town". This is also either true or false; it is
what you want to find out. The rules of the town (two
and only two types of inhabitants,
Saints who always tell the truth, and Sinners who
always lie) are summed up in the
following truth table. The critical thing is that
whatever speaker X said, the statement
iff(StX, WhatXSaid) is always true. If speaker B
says there is gold, then either B is a
Saint (StB = T) and there is gold (g = T) or B is
a Sinner (StB = F) and there's no gold
(g = F), i.e., iff(StB, g) = T. See the truth
table, below, where only the first and last lines
apply in the town of Saints and Sinners. This is
the heart of a simple consistency test for
any conversation between residents of the town.
Their conversations must be consistent
with this rule, and we just need to detect if any
speaker says something which puts him or
her in the middle two lines of the truth table,
below.