0
> The father sat to the right of the person who had corn, 
> who sat to the right of the person who ate pork, who sat to the right of the
> person who had baked potato, who sat to the right of the person who
> had peas.

如何将其转换为 Prolog 谓词?任何人都可以帮忙吗?

4

1 回答 1

1

我首先将其改写为“吃玉米的人的权利就是父亲。吃猪肉的人的权利就是吃玉米的人。” 等等。然后使用谓词 right(x, y) 表示“对 x 的权利是 y”。最终结果是:

right(corn, father).
right(pork, corn).
right(potato, pork).
right(peas, potato).
于 2013-01-26T21:17:10.473 回答