How would I translate this sentence into a predicate formula

142 Views Asked by At

A dragon is green if at least one of its parents is green

I have

∀X⋅dragon(X) ∧ green (X) ⇒ ∃Y⋅childOf(Y,X)∧green(X)

Is this correct?

3

There are 3 best solutions below

1
On BEST ANSWER

"A dragon is green if at least one of its parents is green"

I have: $$\forall X\cdot\color{silver}{\Big(}\textsf{dragon}(X) ∧ \textsf{green} (X) ⇒ ∃Y⋅\color{silver}{\big(}\textsf{childOf}(Y,X)∧\textsf{green}(X)\color{silver}{\big)\Big)}$$

No, you said: "Everything that is a dragon and green, will be green and has a child."†   That is assuming that the scope of the universal is meant to encompass the entire line as I've indicated.

(† I read $\textsf{childOf}(Y,X)$ as "$Y$ is a child of $X$")


Note: the required sentence is of the form: "$A$ if $B$", not "$A$ only if $B$".

You want to say: "Everything, which is a dragon and has a parent who is green, will be green."

$$\forall X~\Big( \textsf{dragon}(X)\wedge \exists Y~\big(\textsf{childOf}(X,Y)\wedge\textsf{green}(Y)\big)\;\to\;\textsf{green}(X)\Big) \\[2ex] \forall X~\forall Y~\Big( \big(\textsf{dragon}(X)\wedge \textsf{childOf}(X,Y)\wedge\textsf{green}(Y)\big)\;\to\;\textsf{green}(X)\Big)$$

1
On

I think your implication is backwards. The formula you have written says that every green dragon must be the child of another green dragon.

5
On

No. You assert that every green dragon $X$ has a parent, and that $X$ is green. Assuming the final green(X) is a typo for green(Y), you assert that every green dragon has a green parent, which again could be false: there's no reason a green dragon should have green parents.