0

This is the statement:

All birds can fly except for penguins and ostriches or unless they have a broken wing.

Here is my attempt:

∀x birds(x)→ fly(x)^((birds(x, penguins)^birds(x, ostriches))˅broken(wing)→¬fly(x))

is my attempt correct? how do we present "except" in predicate logic? thanks

Tommy Lee
  • 794
  • 2
  • 11
  • 30

4 Answers4

4

On understanding "except" ...

When we say "A except B" we normally mean that A and B are mutually exclusive. Either A is the case or B is the case but not both.

If you think in terms of sets then

All birds can fly except for penguins and ostriches or unless they have a broken wing

could be re-written as

In the universe of birds, there are exactly two distinct sets -- one in which every member of the set can fly and the other in which you find penguins and ostriches and birds with broken wings.

(In passing, note the way the words "and" and "or" in English often need to be adjusted in a symbolic expression.)

         Birds
+-----------+------------+
|           |            |
|   Fly     | Exceptions |
|           |            |
+-----------+------------+

Representing mutual exclusion in predicate logic is most easily handled by exclusive-or (XOR). We want to say fly XOR exceptions.

In systems that allow quantifiers to limit the universe of discourse, we could write:

∀x∊birds (fly(x) XOR (penguin(x) v ostrich(x) v brokenWing(x)))

If quantifiers are unlimited, then:

∀x (bird(x) → (fly(x) XOR (penguin(x) v ostrich(x) v brokenWing(x))))

And if XOR is not in the set of allowed operators, then you might have to use the equivalence:

p XOR q ≡ ((p v q) & -(p & q))

There are a couple of other implications hiding in the English sentence that are not fully expressed in the suggestions above.

  • The sentence in predicate logic allows the case that there are no birds, whereas the English sentence probably implies that there is at least one bird.

  • "A except B" in English normally implies that there are at least some instances of the exception. Not only is there at least one bird, but there is at least one penguin that cannot fly. That could be added to the predicate sentence via appropriate use of existential quantifiers.

  • "A except B" in English nearly always implies that A is the most common case and B is the exception. In the absence of other evidence, we would assume A. In the universe of birds, most can fly and only the listed exceptions cannot fly. There is no easy construct in predicate logic to capture the sense of a majority case.

MattClarke
  • 1,647
  • 1
  • 11
  • 32
2

There is a "prolog" tag to your question. In Prolog it can be:

fly(X, WingCondition) :-
    bird(X),
    X \= penguin,
    X \= ostrich,
    WingCondition \= broken.
Sergii Dymchenko
  • 6,890
  • 1
  • 21
  • 46
2

No, your attempt is incorrect. It says that all birds fly and also some birds don't fly, so it's a contradiction. Also note that broken(wing) doesn't mention x at all.

As a hint, it should look like

∀x (bird(x) ^ ¬<conditions under which birds don't fly>) → fly(x)
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
  • means that broken wing should be broken(x)->wing(x)? – Tommy Lee Mar 17 '14 at 12:56
  • No. Note the formula should be composed from _propositions_. I.e. `bird(x)` should be read as "`x` is a bird", `fly(x)` means "`x` can fly", etc. So what would `wing(x)` be? – Alexey Romanov Mar 17 '14 at 19:05
  • so wing(x) is x has wing to represent x has broken wings i should put brokenWing(x)? – Tommy Lee Mar 17 '14 at 23:47
  • Yes, this is one possibility. – Alexey Romanov Mar 18 '14 at 09:26
  • 1
    The template given in this answer does not capture the full intention of the sentence. The English sentence implies that a penguin cannot fly, but that is not represented by the proposed template. The template captures the case where a bird is not a penguin but is silent about whether birds that are penguins can fly or not. – MattClarke Mar 18 '14 at 21:22
0

So all birds and not birds that are penguins, ostriches and birds with broken wings can fly

∀x (birds(x) ^ ¬ (birds(x, penguins) ^ birds(x, ostriches) ^ broken_wing(x))) → fly(x))

or this maybe

∀x (birds(x) ^ ¬ (birds(x, penguins) ^ birds(x, ostriches) ^ birds(x,broken_wing))) → fly(x))

Maciler
  • 1
  • 4