【问题标题】:How to put information into prolog如何将信息放入prolog
【发布时间】:2013-01-26 20:53:39
【问题描述】:
> 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 谓词?有人可以帮忙吗?

【问题讨论】:

    标签: prolog logic weblogic-10.x


    【解决方案1】:

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

    right(corn, father).
    right(pork, corn).
    right(potato, pork).
    right(peas, potato).

    【讨论】:

    • 这个答案并不令人满意。您只能从该理论中推断出的仅仅是事实,而从规范中您可以推断出更多。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-07-16
    • 1970-01-01
    • 2010-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-15
    相关资源
    最近更新 更多