Symbolic Logic for AI Agents
Introduction to Predicate Logic
Beyond True or False
In propositional logic, we work with simple, declarative statements that are either true or false. "It is raining" is a proposition. "The sky is blue" is another. While useful, this has limits. How would we express a statement like "All dogs are mammals"? We can't assign a single true or false value to this without being able to talk about the properties of things.
This is where predicate logic comes in. It gives us a richer way to talk about the world. Instead of just dealing with whole statements, we can break them down to talk about objects and their properties or relationships. Predicate logic is the language we use to make general claims and reason about groups of things.
Predicate logic lets us move from talking about specific facts to describing general rules and properties.
Think of a predicate as a sentence with a blank in it. For example, "___ is a planet." This isn't true or false on its own. It's a property waiting for an object. If we fill the blank with "Mars," we get "Mars is a planet," which is a true proposition. If we fill it with "Pluto," the truth of the statement is a bit more complicated, but it becomes a proposition we can evaluate.
The blank-filler is called a term, which is usually a variable (like ) or a constant (like Mars). The predicate itself is the property, which we can write in a more formal way, like , where stands for "is a planet" and is our variable term.
Quantifiers: All and Some
The real power of predicate logic comes from two special symbols called quantifiers. They let us talk about the quantity of objects that have a certain property.
quantifier
noun
A symbol that specifies the quantity of elements in a domain that have a certain property.
The first is the universal quantifier, written as . It means "for all" or "for every." If we want to say "All dogs are mammals," we could write it like this:
This reads: "For every thing , if is a dog, then is a mammal." This single statement covers every dog that has ever existed or will ever exist.
The second is the existential quantifier, written as . It means "there exists" or "for some." It makes a claim about at least one thing. To say "Some cats have stripes," we could write:
This reads: "There exists some thing such that is a cat and is striped." It doesn't say all cats have stripes, just that we can find at least one that does.
Universal quantifier (): All things have the property. Existential quantifier (): At least one thing has the property.
How It Differs from Propositional Logic
The key difference is expressiveness. Propositional logic treats sentences as indivisible blocks of truth. Predicate logic looks inside those sentences to see how objects and their properties are related. It gives us the tools to handle variables and make general statements about populations of objects.
| Feature | Propositional Logic | Predicate Logic |
|---|---|---|
| Basic Unit | Propositions (e.g., , ) | Predicates (e.g., , ) |
| Focus | Relationships between propositions | Properties of objects & relationships |
| Generalization | Cannot express "all" or "some" | Uses quantifiers () |
| Example | "If it is raining, then the ground is wet." () | "All birds can fly." () |
In essence, propositional logic is the logic of sentences, while predicate logic is the logic of objects, properties, and relations. This makes it a foundational tool for fields like mathematics, philosophy, and computer science, especially in artificial intelligence, where we need to represent complex knowledge about the world.
Ready to test your understanding?
What is the primary advantage of predicate logic over propositional logic?
Which of the following expressions in predicate logic best represents the statement "Some cats are black"?
By adding predicates and quantifiers, we gain a much more powerful and flexible way to represent logical statements.
