I'm currently working on the following task
Use the predicate Like(x, y) which is read as “x likes y”. Use the predicate Subject(x) as well, which is read as “x is a school subject”. Equal = and not equal ≠ are also to be used. Use x and y as variable names. Express the following sentences a) – f) in predicate logic:
, and here are my answers.
(a) Stina likes all subjects. ∀x (Subject(x) -> Like(Stina, x) ) (b) There is a subject that Gustav likes. ∃x (Subject(x) -> Like(Gustav, x)) (c) Hubert likes something that Svante and Gustav like. ∀x (Subject(x) ∧ Like(Svante, x) ∧ Like(Gustav, x) -> Like(Hubert, x)) (d) Rut doesn’t like herself but she likes everyone who likes her. ∀x (¬Like(Rut, Rut) ∧ Like(x, Rut) -> Like(Rut, x)) (e) Gustav likes someone who likes math. ∀x∃y (Subject(y) ∧ y = math ∧ Like(x, y) -> Like(Gustav, x)) (f) Hubert likes all subjects except for math and logic, and Gustav likes math, Rut likes logic and Svante likes Rut and statistics. ∀x (Subject(x) ∧ x ≠ math ∧ x ≠ logic -> Like(Hubert, x)) ∀x (Subject(x) ∧ x = math -> Like(Gustav, x)) ∀x (Subject(x) ∧ x = math -> Like(Rut, x)) ∀x ((Subject(x) ∧ x = statistic) V (x = Rut) -> Like(Svante, x))
In my answer for (f), I ended up writing multiple lines in predicate logic, but is this legitimate? If it's not, how do I sum them up into a single line? Also, is there anything wrong with how I solve the problems in (a)-(e) as well?