Question

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

Was it helpful?

Solution 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)

OTHER TIPS

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.

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

fly(X, WingCondition) :-
    bird(X),
    X \= penguin,
    X \= ostrich,
    WingCondition \= broken.

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))

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top