我曾尝试使用 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!(即使我们知道 Dan 有长颈鹿,我们也可以写下 2 种可能性)。它不应该修改添加额外的问题或语句不应该切断我们现有的证明,但是它在我当前的解决方案中。3. statement (pattern(Dan, Girrafe) de facto 切断了不必要的可能性(没有哪个程序找到正确的解决方案)。
我不知道我是否使用了不好的 prover9 或者只是忽略了我的问题中的某些内容(或者它在经典布尔语句中的表示)。我能做错什么?