Predicate logic represents facts precisely.
A predicate
, as used here, means a property of an
object (such as green), or a category of objects
(such as cats).
This program translates logic expressions into English.
Proper nouns (names such as Frodo or Kalamazoo) and uncountable nouns (water and music) are treated as objects, not predicates.
Countable common nouns, adjectives, verbs, and prepositions are treated as predicates.
To assert that an object has a property,
or belongs to a category,
name the predicate first and then put the object's name in
parentheses.
green(Kermit)
says that
Kermit has the property of being green.
frog(Kermit)
says that
Kermit is in the set of frogs.
You can't say Kermit(green)
,
because Kermit is an object, not a property,
and because green is a property, not an object.
(We don't say That green thing has the property of being Kermit.
You might say that, but this program doesn't.)
Only objects can be assigned to categories,
or be said to have properites.
You can't say:
frog(green(Kermit))
,
because that asserts that the idea
Kermit is green is a frog.
Instead, you should say:
green(Kermit) ∧ frog(Kermit)
,
which makes two assertions about Kermit: that he is green
and that he is a frog.
If you want to say that All cats are mammals,
you can't say
mammals(cats)
,
because cats is a category of objects,
not an object.
Instead, you should say:
∀ X (cat(X) → mammal(X))
,
which breaks down as Every object that is a cat is a mammal.
(Note that order is important, and if you get it wrong you change
the meaning.
∀ X (mammal(X) → cat(X))
means Every object that is a mammal is a cat, probably
not what you want.)
Parentheses are important. Try
¬ fish(Garfield)
and
¬(fish(Garfield))
.