开发者

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

开发者 https://www.devze.com 2023-02-23 13:31 出处:网络
I am trying to convert the following sentence to a well formed formula using firs开发者_Python百科t-order logic(Predicate logic).

I am trying to convert the following sentence to a well formed formula using firs开发者_Python百科t-order logic(Predicate logic).

All towers are of the same color.

I have defined the following predicates:

Tower(x) :: x is a tower.

Color(x, y) :: x is of color 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?


There exists a Y1 such that for all X Tower(X) implies Color(X, Y1)


Let's not assume that any towers or colors exist.

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. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消