我尝试过使用prover9来证明这个非常简单的语句,这对于人类来说是显而易见的,但幸运的是我无法得到它的工作。我有以下情形:Prover9找不到正确的解决方案
% Three boys - Dan, Louise and Tom have t-shirts in three diffrent colors
% (white, yellow and green) and with three different patterns: (giraffe, camel and
% panda). Dan has the t-shirt with giraffe, Louise has the yelow one and Tom has
% not the white t-shirt. The boy with the yellow one has not the one with camel
% pattern. Task:
% Represent exercise with classical boolean statements and using
% resolution algorithm answer the question: "who has the t-shirt with the camel pattern?"
formulas(sos).
% (pattern(Dan, Giraffe) & pattern(Louise, Panda) & pattern(Tom, Camel))
% | (pattern(Dan, Giraffe) & pattern(Louise, Camel) & pattern(Tom, Panda))
% | (pattern(Dan, Panda) & pattern(Louise,Giraffe) & pattern(Tom, Camel))
% | (pattern(Dan, Panda) & pattern(Louise, Camel) & pattern(Tom, Giraffe))
% | (pattern(Dan, Camel) & pattern(Louise, Panda) & pattern(Tom, Giraffe))
% | (pattern(Dan, Camel) & pattern(Louise, Giraffe) & pattern(Tom, Panda)).
% This does not works, unfortunately
(pattern(Dan, Giraffe) & pattern(Louise, Panda) & pattern(Tom, Camel))
| (pattern(Dan, Giraffe) & pattern(Louise, Camel) & pattern(Tom, Panda)).
% This works
(color(Dan, White) & color(Louise, Yellow) & color(Tom, Green))
| (color(Dan, White) & color(Louise, Green) & color(Tom, Yellow))
| (color(Dan, Yellow) & color(Louise,White) & color(Tom, Green))
| (color(Dan, Yellow) & color(Louise, Green) & color(Tom, White))
| (color(Dan, Green) & color(Louise, Yellow) & color(Tom, White))
| (color(Dan, Green) & color(Louise, White) & color(Tom, Yellow)).
pattern(Dan, Giraffe).
color(Louise, Yellow).
-color(Tom,White).
all x (color(x,Yellow) -> -pattern(x,Camel)).
end_of_list.
formulas(goals).
pattern(Tom,Camel). % Our solution
% pattern(Louise, Panda).
end_of_list.
- 和2公式是写下所有的可能性,没有约束 - 一个简单的排列3! (即使我们知道丹有长颈鹿,我们可以写下2种可能性)。它不应该修改问题,增加额外的或声明不应该切断我们现有的证据,但它使我在当前的解决方案。 3.声明(模式(丹,Girrafe)事实上切断不必要的可能性(如果没有这些程序找到正确的解决方案)。
我不知道,我是否使用严重prover9或者只是忽略了一些在我的问题(或在其古典布尔语句中的表示)我可以做什么错?
您是否使用过Mace4搜索反例?如果它找到了一个(当你不期望它),那通常是因为你没有正确表示问题。 – AntC 2015-03-05 07:31:50