2
问题是:盐被偷了!那么,它被发现的罪魁祸首是卡特彼勒, 比尔蜥蜴或柴郡猫。三是审判和法院作出以下 声明:将逻辑谜题转化为谓词演算和序言/ dlv
CATERPILLAR: Bill the Lizard ate the salt.
BILL THE LIZARD: That is true!
CHESHIRE CAT: I never ate the salt.
。就这样,他们中的至少一个撒谎和至少一个说了实话。谁吃了盐 ?
我知道如果法案是真的,比所有的陈述都是真的,如果柴郡是真的,那么所有的都是假的,所以它一定是毛毛虫。
综观谓词演算和编程它,它会是这样的权利:
suspect(caterpillar).
suspect(lizard).
suspect(cat).
:- suspect(cat), suspect(lizard).
:- suspect(cat), suspect(caterpillar).
:- suspect(lizard), suspect(caterpillar).
%where these imply not more than one of these can be true or returned in our set
但随后进一步描述这个谓词逻辑,我不我会怎样形容描述或抗辩的他们制作。如果一个陈述是真实的,那么这意味着其他人可能会失败。