Predicate for a simple statement

34 Views Asked by At

Today is my first day working with predicate logic. Here is what is given (I've written it down myself not sure if this is the correct way):

G(w) → w is a genre
L(x, G(w)) → x likes w genre
F(x, y) → x is from country y
S(m,g) → Suggest m mood song from genre g.
P(x,m) → x has m mood.

I want to write predicate logic for the statement:

All people from Jamaica likes Reggae genre.
If a person is from Jamaica and they are in a happy mood suggest a song from Reggae genre.

How can I write the above rule in predicate logic terms? I'm also not sure if L(x, G(w)) is the right way to describe x likes w genre

2

There are 2 best solutions below

2
On BEST ANSWER

You need constant "raggae" (say "$r_0$") and "Jamaica" ("$j_0$"), such that $G(r_0)$ holds (Raggae is a genre) and $\exists x: F(x,j_0)$ (somebody comes from Jamaica , so it's an existing country; we are not given a predicate $C(x)$ that says $x$ is a country, or some such, while we do have one for "genre".

I think $L(x,w)$ means $x$ likes (genre) "$w$", you cannot have $G(w)$ as the second argument (as it is a Boolean predicate, not a member of the "universe" (which contains "people", "moods", "genres" and "countries".

All people from Jamaica like the genre of Raggae:

$\forall x: (F(x,j_0) \to L(x, r_0)$: for all things $x$, if $x$ comes from Jamaica (the constant we introduced above) (implicit is that $x$ is then a person?) then $x$ likes $r_0$, the constant for that genre.

"If people are from Jamaica and in a happy mood", can be expressed if we have a constant "happy", which must be a "mood". Say $h_0$ means happy and $P(x, h_0)$ means person $x$ is in a happy mood. So the second then can become:

$\forall x: (F(x,j_0) \land P(x,h_0)) \to S(x,r_0)$

2
On

I'm also not sure if L(x, G(w)) is the right way to describe x likes w genre

No. You are never allowed to use predicates inside predicates. Which makes sense: a predicate is a statement about objects, not about predicates.

So, you have to use $L(x,y)$ ... and this will translate into '$x$ likes $y$', rather than '$x$ likes genre $y$'.

The nice thing about this is that if $x$ and $y$ are both persons, then you can still use $L(x,y)$ to say that (person) $x$ likes (person) $y$.

However, if you want to say that '$x$ likes genre $y$', you'll have to make explicit that $y$ is a genre, i.e. you'd do $L(x,y) \land G(y)$. Indeed, there is nothing in $L(,y)$ that requires $x$ to be a person, so if you want $x$ to be a person, you'll have to explicitly add $P(x)$ as well, where $P(x)$ means '$x$ is a person'.

Likewise, I strongly suggest to make the following changes to your symbolization scheme:

$G(w)$: $w$ is a genre

$L(x,y)$: $x$ likes $y$

$F(x, y)$: $x$ is from $y$

$S(x,y)$: $x$ suggest $y$.

$H(x)$: $x$ is in a happy mood.

$P(x)$: $x$ is a person

$S(x)$: $x$ is a song

$j$: Jamaica

$r$: Reggea

With this:

All people from Jamaica likes Reggae genre.

becomes:

$\forall x ((P(x)\land F(x,j)) \to (L(x,r)\land G(r)))$

and

If a person is from Jamaica and they are in a happy mood suggest a song from Reggae genre.

which I assume is meant as:

If a person is from Jamaica and they are in a happy mood, then they suggest a song from Reggae genre.

translates as:

$\forall x (P(x) \land F(x,j) \land H(x)) \to \exists y (S(y) \land F(y,r))$

Note that you never really use the $G$ 'is a genre predicate', since both sentences referenced the specific genre of Reggae.