简体   繁体   English

如何将这句话转换成逻辑良好的一阶公式?

[英]How to convert this sentence into a first order logic well formed formula?

I am trying to convert the following sentence to a well formed formula using first-order logic(Predicate logic). 我正在尝试使用一阶逻辑(谓词逻辑)将以下句子转换为格式正确的公式。

All towers are of the same color. 所有的塔都具有相同的颜色。

I have defined the following predicates: 我定义了以下谓词:

Tower(x) :: x is a tower. 塔(x):: x是塔。

Color(x, y) :: x is of color y Color(x,y):: x的颜色为y

I am not able to convert the aforementioned sentence into a well formed formula using the above predicates. 我无法使用上述谓词将上述句子转换为格式正确的公式。 Is it possible to convert it using the above predicates or some new predicate should be required. 是否可以使用上述谓词将其转换,或者需要一些新的谓词。 Please advise. 请指教。

EDIT: Forgot to add a detail. 编辑:忘记添加详细信息。 There are only three available colours in the world (red, green, blue). 世界上只有三种可用的颜色(红色,绿色,蓝色)。 Can this detail be used. 可以使用此详细信息吗? Does that make any difference to the solution? 这对解决方案有什么影响吗?

存在一个Y1使得对于所有X Tower(X)都意味着Color(X,Y1)

我们不假定存在任何塔楼或颜色。

tower(x) ∧ tower(y) ∧ color(x,z) → color(y,z)

After posting this on StackOverflow, I realized that the problem is more suitable for Math . 将其发布到StackOverflow之后,我意识到该问题更适合Math So I had reposted the problem there. 因此,我将问题重新发布到了那里。

Although, Dave's solution is perfectly correct, the solution posted there seems more intuitive, so I am linking it here for reference of other users. 尽管Dave的解决方案是完全正确的,但此处发布的解决方案似乎更加直观,因此我将其链接到此处以供其他用户参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM