Verify the Conversion to First Order Logic

76 Views Asked by At

I have been trying to convert the following sentences to First Order Logic. Could you please verify it, if I am doing it right. Thank you

Every firm whose all employees can code is happy.

Fi(X)-> X is a firm

E(Y,X)-> Y is an employee of X

C(Y)-> Y can code

H(X)-> X is happy.

∀X((Fi(X)∧∀y(E(Y,X)→C(Y)))→H(X))

Is this right or is it done this way? Because the above case evaluates to True if even an employee exists that doesn't code.

Does this work?

∀X((F(X)→∀y(E(Y,X)→C(Y)))→H(X))

Every manager who has a female employee is female.

F(X)-> X is a female E(Y,X)-> Y is an employee of X M(X)-> X is a Manager F(Y)-> Y is a female.

∀X(∃Y(M(X)∧E(Y,X)∧F(Y))→F(X))

Is this right?

Thank you

1

There are 1 best solutions below

1
On BEST ANSWER
∀X((Fi(X)∧∀y(E(Y,X)→C(Y)))→H(X))

Is this right or is it done this way? Because the above case evaluates to True if even an employee exists that doesn't code.

Yes, and that is okay. Any firm with an employee who does not code, may be happy or unhappy. However, if a firm is unhappy then there does exist an employee who cannot code.

Does this work?

∀X((F(X)→∀y(E(Y,X)→C(Y)))→H(X))

No. That should be: $\forall X~\Big(F(X)\to\big(\forall Y~(E(Y,X)\to C(Y))\to H(X)\big)\Big)$

Because $(\phi\wedge \psi)\to \rho \iff \phi\to(\psi\to \rho)$ , and neither is logically equivalent to $(\phi\to\psi)\to \rho$


Every manager who has a female employee is female.

∀X(∃Y(M(X)∧E(Y,X)∧F(Y))→F(X))

Is this right?

Yes, that is okay.


A note on capitalisation. We conventioinally use lowercase letters for variables, and constants, while reserving uppercase symbols for predicates. Case sensitivity is also important. y and Y are not interchangable. If you pick a symbol, stick to it.