The following are logical statements in English:
- A horse is a mammal.
- A human is a mammal.
- Mammals have four legs and no arms, or two legs and two arms.
- A horse has no arms.
- A human has arms.
- A human has no legs.
A possible translation of these statements into first-order predicate calculus is as follows:
mammal( horse ).
mammal( human ).
for all x, mammal( x )
→ legs(x, 4) and arms(x, 0) or legs(x, 2) and arms(x, 2).
arms( horse, 0).
not arms( human, 0 ).
legs( human, 0 ).
In this example,
- The constants are the integers 0, 2, and 4 and names horse and human.
- The predicates are
mammal
, arms
, and legs
.
- The only variable is
x
.
- The first five statements are axioms.
arms(human,2)
becomes provable from the axioms.
legs(human,2)
is true also, so the last statement is false.
- Precedence can be used to leave out many parentheses.
For example,
legs(x,4) and arms(x,0) or legs(x,2) and arms(x,2)
is the same as
(legs(x,4) and arms(x,0)) or (legs(x,2) and arms(x,2))