2
$\begingroup$

I have an example problem where I must use predicates, quantifiers, and logical connectives to convert the statements. The statement is...

"Whenever there is an active alert, all queued messages are transmitted."

How should I approach this to better understand how to assign predicates? How should I know when to use a universal or existential quantifier? I am having an extremely difficult time understanding such problems and really need some pointers in getting to think about this more logically.

$\endgroup$
3
$\begingroup$

We have always problem in formalizing natural language statements.

The first step is how to translate : whenever.

We assume that it has the same meaning of "when".

Thus, the statement is of the form :

When $A$, then $B$

and we symbolize it with the connective : $\rightarrow$ ("if ..., then _") :

$A \rightarrow B$.

Now we need quantifiers for analyzing the two clauses :

  • there is an active alert

  • all queued messages are transmitted.

The first one will be :

$\exists x(Alert(x) \land Active(x))$

while for the second we have :

$\forall y((Message(y) \land Queued(y)) \rightarrow Transmitted(y))$.

Putting all together :

$$\exists x(Alert(x) \land Active(x)) \rightarrow \forall y((Message(y) \land Queued(y)) \rightarrow Transmitted(y))$$

$\endgroup$
0
$\begingroup$

This is an old question, and I do agree with the accepted answer as far as how to translate this example, but for the sake of future readers I want to expand a bit on the more general part of your question: "How should I approach this to better understand how to assign predicates?"

In my experience, when translating natural language statements into predicate logic, the parts of a sentence that usually indicate your quantifiers (existential $\exists x$, universal $\forall x$) are:

  • verbs and their adverbs, especially phrases like like "when $x$ is...", "there is", "there must be", etc.
  • adjectives related to quantity, such as "all", "every", "each", "some", "a/an", etc.

Another important thing to note is that natural language often hides its conditionals, so to speak, in all sorts of strange constructs, such as:

  • "When $x$, $y$" - equivalent to "if x, then y"
  • "There should be a $y$ wherever you find an $x$" - could be rephrased as "if there exists an $x$, then there exists a $y$"

It's important to learn to recognize and pull apart these different ways of expressing the same basic underlying concepts, which is pretty much what logic is for.

When translating sentences into predicate logic, I find it helpful to pose questions to yourself about the phrase to tease out the scope and structure of the various clauses, such as:

  • "Is this clause telling me something about all things of a certain kind, or is it making a statement about a single thing?"
  • "Does this statement talk about something existing or being in a certain state, using adverbs like whenever or wherever, or does it use broad adverbs and adjectives like all, every, or each?"

So with that in mind, let's dissect the example posed:

Whenever there is an active alert, all queued messages are transmitted.

Here are the parts that jump out at me:

Whenever there is an active alert, all queued messages are transmitted.

  • "Whenever" - sounds like a conditional poking it's head out
  • "there is an" - the first clause is talking about the existence of a single item, in this case an "active alert", so we'll want an existential quantifier; Additionally, the use of "whenever" feels very conditional,
  • "all" - the second clause is talking about all instances of a certain type of thing, in this case "queued messages", so we'll need a universal quantifier

One more note about the second clause, "all queued messages are transmitted": there's another conditional here, hidden where it's easy to miss. In fact, pretty much every universal quantifier will have a conditional. This makes sense if you think about it; I don't know if there's anything useful that you could say about literally every thing in the universe, and even if there is, you usually aren't talking on that scale, so your universal quantifier needs to be reigned in with a conditional.

Example: a statement like $\forall x(x$ is transmitted$)$ isn't particularly useful. That statement says "every single $x$ in the universe is transmitted", which isn't what you want. Instead, you want to say "Every queued message is transmitted". When phrased in terms of quantifiers and conditionals, this becomes "For all $x$, if $x$ is a queued message, then x is transmitted"; expressed in pseudo-formal syntax, this could be written as: $\forall x((x$ is a queued message$) \rightarrow$ $(x$ is transmitted$))$.

Now, let's try to reword the sentence in something that more closely resembles the syntax we're aiming for. Here are some translations I think we can safely make:

  • "whenever there is a Q, ..." can be rephrased as "if there exists an x that is a Q, then ..."
  • "all P are R" can be rephrased as "for all y, if y is a P, that y is R"

So far, we've translated to something like:

If there exists an x that is an active alert, then for all y where y is a queued message, that y is transmitted.

or in halfway-there pseudo-formal syntax:

$\exists x(x-is-an-active-alert) \rightarrow \forall y((y-is-a-queued-message) \rightarrow (y-is-transmitted))$

We're almost there. The last thing to do is identify the predicates, but that's the easy part: they're pretty much spelled out in our halfway-there sentence above. Remember that predicates name the categories and properties of our objects. With that in mind, here are a few rules of thumb, with examples referencing the sentence "All swans are white":

  • each noun in the original sentence should become a predicate applied to a variable, e.g. "swan" becomes $Swan(x)$
  • each adjective applied to the noun usually ends up as a separate predicate applied to the same variable, e.g. "white" becomes $White(x)$
  • all the predicates for a single noun (within a single clause) should be connected in a conjunction (usually with the noun's predicate first, but that's mostly convention), e.g. "white swan" becomes $Swan(x) \land White(x)$

So, given all that above, let's take a final crack at our example sentence:

$\exists x(Alert(x) \land Active(x)) \rightarrow \forall y((Message(y) \land Queued(y)) \rightarrow Transmitted(y))$

In (somewhat) plain English, this might be written:

If there exists an x that is and Alert and Active, then for each y, if that y is a Message and it is Queued, it is Transmitted.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.