Chapter 2 · Computational Thinking & Algorithms
2.8Predicate Logic
Predicate logic looks inside a statement to see the object and its property, using predicates and variables.
Written and checked by Muhammad Raheel(opens in a new tab)
Full Stack Developer · AI Engineer · Reviewed 21 Oct 2026 · 2 min read
On this page
In propositional logic a whole sentence is one letter, like P. You know if P is true or false, but you cannot see what the sentence is about. Predicate logic opens the sentence up. It shows the object and what is said about it.
With predicate logic we can talk about single things, groups of things, and how things are related.
Figure 2.7: Predicate Logic Structure
The book's figure shows a box called Predicate with the word Helps inside. Two arrows lead to two Variable boxes, x and y. Below them is the expression Helps (x, y). You can read it as "x helps y". Helps is the relationship, and x and y are the two objects in it.
Introduction to Predicate Logic
Predicate logic works with two building blocks: predicates and variables.
Try it. If x is 8, the statement is true. If x is 3, it is false. The answer changes with x, and that is what makes it a predicate.
Predicate logic can also express statements about whole groups, such as "All students are hardworking" or "Some books are interesting". The book says it is used to represent knowledge in a formal, exact way.
Difference Between Propositional and Predicate Logic
| Propositional logic | Predicate logic | |
|---|---|---|
| Works with | simple statements that are true or false | predicates and variables |
| Properties and relationships | cannot describe them | can describe them |
| Power | less expressive | more expressive and powerful |
| Ease | easier to understand, but less flexible | covers many objects and conditions |
Predicates and Variables
A predicate describes a property of an object, or a relationship between objects. The book's example is isEven(x), which is true when x is an even number.
The "domain of discourse" is simply the set of things we are talking about, for example all whole numbers or all students in a class. With variables we can write general statements, like the book's "For all x, x > 0". Put a predicate and variables together and you get a predicate logic expression.
The book compares the two kinds of logic with one sentence:
- Propositional logic: A = "Ali is Tall". You cannot see inside A, so it is limited.
- Predicate logic: Tall(Ali). You can see the subject, Ali, and the property, Tall. It is much more expressive.
Practice this topic
Short questions
1.What is a predicate in predicate logic?2 marks
Answer
From the book: "A predicate is a statement that can be true or false depending on the values of the variables. For example, "x is greater than 5" is a predicate because it depends on x." Also: "Predicates describe properties or relationships of objects."
2.What is predicate logic?2 marks
Answer
From the book: "Predicate logic is an extension of propositional logic. It allows us to express more detailed statements about objects and their properties. In predicate logic, we can talk about individuals, groups, and relationships between them."
3.Write two differences between propositional logic and predicate logic.3 marks
Answer
From the book: "Propositional logic deals with simple statements that are either true or false. It cannot describe properties of objects or relationships between them. Predicate logic, on the other hand, uses predicates and variables to express detailed statements." Also: "Predicate logic is more expressive and powerful than propositional logic. Propositional logic is easier to understand but less flexible."
4.What do variables represent in predicate logic? Give the book's example of a general statement.2 marks
Answer
From the book: "Variables represent objects or values in the domain of discourse. Using variables, we can write general statements like "For all x, x > 0.""
5.Explain the predicate "isEven(x)".2 marks
Answer
From the book: "Predicates describe properties or relationships of objects. For example, "isEven(x)" is true if x is an even number." Its truth depends on the value of the variable x.
6.Compare A = "Ali is Tall" in propositional logic with Tall(Ali) in predicate logic.3 marks
Answer
From the book: Propositional Logic, A = "Ali is Tall": "Cannot see inside (A)", "Limited". Predicate Logic, Tall(Ali): "Can see subject Ali + property Tall", "Much more expressive".
7.What does Figure 2.7 "Predicate Logic Structure" show?3 marks
Answer
It shows a box "Predicate" holding "Helps", with arrows to two "Variable" boxes holding x and y, and the label "Helps (x, y)". The book says: "In predicate logic, we can talk about individuals, groups, and relationships between them (as shown in Figure 2.7)." "Predicates and variables together form predicate logic expressions."
Long questions
1.What is predicate logic? Explain predicates and variables with examples from the book, and describe Figure 2.7.8 marks
Answer
Cover these points, using the book's text:
- Predicate logic (verbatim): "Predicate logic is an extension of propositional logic. It allows us to express more detailed statements about objects and their properties. In predicate logic, we can talk about individuals, groups, and relationships between them (as shown in Figure 2.7)."
- Introduction to Predicate Logic (verbatim): "Predicate logic studies statements that contain variables and predicates. A predicate is a statement that can be true or false depending on the values of the variables. For example, "x is greater than 5" is a predicate because it depends on x." It allows statements like "All students are hardworking" or "Some books are interesting." "It is used to represent knowledge formally."
- Predicates and Variables (verbatim): "Predicates describe properties or relationships of objects. For example, "isEven(x)" is true if x is an even number. Variables represent objects or values in the domain of discourse. Using variables, we can write general statements like "For all x, x > 0." Predicates and variables together form predicate logic expressions."
- Figure 2.7: Predicate Logic Structure: the predicate "Helps" with two variables x and y, written "Helps (x, y)".
Aim for 250-350 words.
2.Explain the difference between propositional logic and predicate logic. Use the book's example of "Ali is Tall".6 marks
Answer
- Difference Between Propositional and Predicate Logic (verbatim): "Propositional logic deals with simple statements that are either true or false. It cannot describe properties of objects or relationships between them. Predicate logic, on the other hand, uses predicates and variables to express detailed statements. Predicate logic is more expressive and powerful than propositional logic. Propositional logic is easier to understand but less flexible. Predicate logic allows statements about many objects and conditions."
- The book's example, as a two-column comparison:
- Propositional Logic: A = "Ali is Tall"; "Cannot see inside (A)"; "Limited".
- Predicate Logic: Tall(Ali); "Can see subject Ali + property Tall"; "Much more expressive".
- A neat table of the points above earns full marks: deals with / can describe properties and relationships / uses / expressive power / ease and flexibility.
Aim for 200-300 words.
In this chapter
- 2.1Introduction to Computational Thinking
- 2.2Problem Solving Using Computational Thinking
- 2.3Logic as a Knowledge Representation Framework
- 2.4Propositional Logic
- 2.5Truth Tables
- 2.6Propositional Equivalence
- 2.7Propositional Satisfiability
- 2.8Predicate LogicYou are here
- 2.9Quantifiers in Predicate Logic
- 2.10Applying Predicate Logic to Real-World Problems
- 2.11Logic-Based Reasoning and Inference