Propositional and predicate logic in brief
Propositional logic works with whole statements, each of which is either true or false, and combines them with words such as “and,” “or” and “if…then.” Predicate logic looks inside those statements. It names objects, describes their properties and relations with predicates, and uses quantifiers such as “for all” and “there exists.” Predicate logic can express far more, which is why it is often the choice for knowledge bases and automated reasoning. Propositional logic is simpler, and for some problems it is enough.
What propositional logic does
A proposition is a statement that is either true or false. Each proposition gets a symbol. For example, P could stand for “it is raining” and Q could stand for “the ground is wet.” Connectives combine them:
- ¬P means “it is not raining.”
- P ∧ Q means “it is raining and the ground is wet.”
- P → Q means “if it is raining, the ground is wet.”
A truth table checks every combination of true and false values. With n symbols there are 2^n rows, so the table grows quickly. With 10 symbols there are 1,024 rows.
Propositional logic cannot talk about individual objects in a general way. Each fact about each object needs its own symbol.
What predicate logic adds
Predicate logic introduces objects, predicates and quantifiers. Take the statement “every student passed the exam.” Propositional logic would need a separate symbol for each student, and it could not say that one rule applies to all of them, including students nobody has listed. Predicate logic handles this with one statement:
∀x (Student(x) → Passed(x))
This reads: for every x, if x is a student, then x passed. Once the fact Student(alice) is added, the system can conclude Passed(alice) by applying the rule to Alice.
The predicate logic used in AI is usually first-order, which means the quantifiers range over objects, not over properties.
A side-by-side example
Take the argument “Socrates is human, all humans are mortal, so Socrates is mortal.”
In propositional logic, you define two symbols, H for “Socrates is human” and M for “Socrates is mortal.” The rule is H → M, the fact is H, and the conclusion is M. This works for Socrates only. To add Plato, you need new symbols for Plato’s humanity and mortality and a new rule for him, and every new person needs the same treatment.
In predicate logic, the argument is:
- ∀x (Human(x) → Mortal(x))
- Human(socrates)
- Conclusion: Mortal(socrates)
The rule is written once and covers everyone, including people added later.
How each form is used in AI
Propositional logic suits problems where every condition is a yes-or-no fact and no objects vary. Checking circuit designs and some planning problems are examples. Satisfiability (SAT) solvers, which check whether a set of such conditions can all hold at once, are a central tool here.
Predicate logic is used for knowledge bases, logic programming such as Prolog, automated theorem proving and ontologies. It is one of the knowledge representation approaches in AI, because it stores facts about many objects and the rules that apply to them.
Choosing between them
Use propositional logic when the problem has a fixed set of yes-or-no conditions, such as checking whether a configuration of switches is valid. Use predicate logic when the problem involves many objects and general rules.
The trade-off is computation. Whether a propositional formula is always true can be decided, because a truth table or a solver will finish. For predicate logic, no algorithm can decide validity for every formula, so a search for a proof may take much longer or never finish.
For the predicate side in more depth, see first order predicate logic in artificial intelligence examples.
Key takeaways
- Propositional logic works with whole statements joined by connectives.
- Predicate logic adds objects, predicates and quantifiers, so one rule can cover many objects.
- Propositional validity can always be checked. Predicate validity cannot be decided in general.