Predicate Logic: Difference between revisions
BloomWiki: Predicate Logic |
BloomWiki: Predicate Logic |
||
| Line 1: | Line 1: | ||
<div style="background-color: #4B0082; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | |||
{{BloomIntro}} | {{BloomIntro}} | ||
Predicate Logic (or First-Order Logic) is the "Upgrade" to propositional logic that allows us to talk about "Objects" and "Properties." While propositional logic can only handle whole sentences (P or Q), predicate logic can "Look inside" the sentence to see the relationship between things. It uses "Quantifiers" to make statements like "All humans are mortal" or "There is at least one planet with life." It is the language of modern "Mathematics," "Databases," and "AI Knowledge Representation." By moving from "Simple Statements" to "Complex Relationships," predicate logic gives us a powerful tool to describe the entire universe in a single, consistent language. | Predicate Logic (or First-Order Logic) is the "Upgrade" to propositional logic that allows us to talk about "Objects" and "Properties." While propositional logic can only handle whole sentences (P or Q), predicate logic can "Look inside" the sentence to see the relationship between things. It uses "Quantifiers" to make statements like "All humans are mortal" or "There is at least one planet with life." It is the language of modern "Mathematics," "Databases," and "AI Knowledge Representation." By moving from "Simple Statements" to "Complex Relationships," predicate logic gives us a powerful tool to describe the entire universe in a single, consistent language. | ||
</div> | |||
== Remembering == | __TOC__ | ||
<div style="background-color: #000080; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | |||
== <span style="color: #FFFFFF;">Remembering</span> == | |||
* '''Predicate Logic''' — A system of logic that uses predicates and quantifiers to describe properties and relationships. | * '''Predicate Logic''' — A system of logic that uses predicates and quantifiers to describe properties and relationships. | ||
* '''Predicate''' — A property or relation (e.g., in "P(x)", P might mean "Is a Cat"). | * '''Predicate''' — A property or relation (e.g., in "P(x)", P might mean "Is a Cat"). | ||
| Line 13: | Line 18: | ||
* '''Arity''' — The number of objects a predicate takes (e.g., "Is_Red(x)" has arity 1; "Is_Brother_Of(x, y)" has arity 2). | * '''Arity''' — The number of objects a predicate takes (e.g., "Is_Red(x)" has arity 1; "Is_Brother_Of(x, y)" has arity 2). | ||
* '''Inference''' — The process of deriving a new true statement from existing ones (e.g., "If all humans are mortal, and Socrates is human, then Socrates is mortal"). | * '''Inference''' — The process of deriving a new true statement from existing ones (e.g., "If all humans are mortal, and Socrates is human, then Socrates is mortal"). | ||
</div> | |||
== Understanding == | <div style="background-color: #006400; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Understanding</span> == | |||
Predicate logic is understood through '''Quantification''' and '''Relationships'''. | Predicate logic is understood through '''Quantification''' and '''Relationships'''. | ||
| Line 37: | Line 44: | ||
'''The 'Syllogism' Upgrade'''': Aristotle's famous "Socrates is mortal" logic was actually the very first (and simplest) form of predicate logic. It took 2,000 years for Gottlob Frege to add the "Quantifiers" (∀ and ∃) to turn it into the "Full Version" we use today. | '''The 'Syllogism' Upgrade'''': Aristotle's famous "Socrates is mortal" logic was actually the very first (and simplest) form of predicate logic. It took 2,000 years for Gottlob Frege to add the "Quantifiers" (∀ and ∃) to turn it into the "Full Version" we use today. | ||
</div> | |||
== Applying == | <div style="background-color: #8B0000; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Applying</span> == | |||
'''Modeling 'The Database Query' (Translating English into Predicate Logic):''' | '''Modeling 'The Database Query' (Translating English into Predicate Logic):''' | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
| Line 69: | Line 78: | ||
: '''SQL (1974)''' → The standard language for databases, which is literally just "Predicate Logic in a Suit." | : '''SQL (1974)''' → The standard language for databases, which is literally just "Predicate Logic in a Suit." | ||
: '''Prolog (1972)''' → The first "Logic Programming Language," where you don't write "Steps," you just write "Facts and Rules" in predicate logic, and the computer finds the answer for you. | : '''Prolog (1972)''' → The first "Logic Programming Language," where you don't write "Steps," you just write "Facts and Rules" in predicate logic, and the computer finds the answer for you. | ||
</div> | |||
== Analyzing == | <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Analyzing</span> == | |||
{| class="wikitable" | {| class="wikitable" | ||
|+ Propositional vs. Predicate Logic | |+ Propositional vs. Predicate Logic | ||
| Line 85: | Line 96: | ||
'''The Concept of "Bound" vs. "Free" Variables''': Analyzing why variables can be confusing. A variable is '''Bound''' if it is inside a quantifier (like 'x' in ∀x). A variable is '''Free''' if it is just a "Hole" in the sentence. Predicate logic is only "True or False" if all its variables are bound—otherwise, it's just a "Formula." | '''The Concept of "Bound" vs. "Free" Variables''': Analyzing why variables can be confusing. A variable is '''Bound''' if it is inside a quantifier (like 'x' in ∀x). A variable is '''Free''' if it is just a "Hole" in the sentence. Predicate logic is only "True or False" if all its variables are bound—otherwise, it's just a "Formula." | ||
</div> | |||
== Evaluating == | <div style="background-color: #483D8B; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Evaluating</span> == | |||
Evaluating predicate logic: | Evaluating predicate logic: | ||
# '''The "Decidability" Problem''': Unlike propositional logic, you can't always "Calculate" if a predicate statement is true. Alan Turing proved that some problems in predicate logic are "Un-solvable" by any computer. | # '''The "Decidability" Problem''': Unlike propositional logic, you can't always "Calculate" if a predicate statement is true. Alan Turing proved that some problems in predicate logic are "Un-solvable" by any computer. | ||
| Line 92: | Line 105: | ||
# '''Natural Language''': Humans say "Most people like pizza." Predicate logic only has "All" or "Some." It doesn't have a symbol for "Most." | # '''Natural Language''': Humans say "Most people like pizza." Predicate logic only has "All" or "Some." It doesn't have a symbol for "Most." | ||
# '''Complexity''': As soon as you add a few variables (x, y, z), the number of possible "Worlds" explodes, making it very hard for AIs to "Reason" using pure logic alone. | # '''Complexity''': As soon as you add a few variables (x, y, z), the number of possible "Worlds" explodes, making it very hard for AIs to "Reason" using pure logic alone. | ||
</div> | |||
== Creating == | <div style="background-color: #2F4F4F; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Creating</span> == | |||
Future Frontiers: | Future Frontiers: | ||
# '''Knowledge Graphs''': Using predicate logic to connect all the data on the internet (The "Semantic Web") so AIs can truly "Understand" the relationships between people and things. | # '''Knowledge Graphs''': Using predicate logic to connect all the data on the internet (The "Semantic Web") so AIs can truly "Understand" the relationships between people and things. | ||
| Line 104: | Line 119: | ||
[[Category:Philosophy]] | [[Category:Philosophy]] | ||
[[Category:Logic]] | [[Category:Logic]] | ||
</div> | |||
Latest revision as of 01:56, 25 April 2026
How to read this page: This article maps the topic from beginner to expert across six levels � Remembering, Understanding, Applying, Analyzing, Evaluating, and Creating. Scan the headings to see the full scope, then read from wherever your knowledge starts to feel uncertain. Learn more about how BloomWiki works ?
Predicate Logic (or First-Order Logic) is the "Upgrade" to propositional logic that allows us to talk about "Objects" and "Properties." While propositional logic can only handle whole sentences (P or Q), predicate logic can "Look inside" the sentence to see the relationship between things. It uses "Quantifiers" to make statements like "All humans are mortal" or "There is at least one planet with life." It is the language of modern "Mathematics," "Databases," and "AI Knowledge Representation." By moving from "Simple Statements" to "Complex Relationships," predicate logic gives us a powerful tool to describe the entire universe in a single, consistent language.
Remembering[edit]
- Predicate Logic — A system of logic that uses predicates and quantifiers to describe properties and relationships.
- Predicate — A property or relation (e.g., in "P(x)", P might mean "Is a Cat").
- Universal Quantifier (∀, "For All"): A statement that is true for EVERY object in a group (e.g., ∀x P(x) = "Everything is a cat").
- Existential Quantifier (∃, "There Exists"): A statement that is true for AT LEAST ONE object (e.g., ∃x P(x) = "There is at least one cat").
- Variable (x, y, z): A placeholder for an object in the universe.
- Constant (a, b, c): A specific, named object (e.g., "Socrates").
- Domain of Discourse — The "World" of objects we are talking about (e.g., "The set of all animals").
- First-Order Logic — A system where we can talk about "Objects," but not about "Properties of Properties" (which would be Higher-Order logic).
- Arity — The number of objects a predicate takes (e.g., "Is_Red(x)" has arity 1; "Is_Brother_Of(x, y)" has arity 2).
- Inference — The process of deriving a new true statement from existing ones (e.g., "If all humans are mortal, and Socrates is human, then Socrates is mortal").
Understanding[edit]
Predicate logic is understood through Quantification and Relationships.
1. The Power of "All" and "Some": Propositional logic is too "Small" for most math.
- You can't say "All numbers are even" with simple P and Q.
- Predicate logic allows you to "Loop" over a whole world.
- **∀x (Even(x))**: This statement is only true if every single 'x' in the world is even.
- This allows us to write "General Rules" rather than just "Individual Facts."
2. Relationships (Relations): Predicate logic can describe "Graphs" and "Connections."
- **Likes(x, y)**: This is a relationship between two people.
- We can say complex things like: "There is someone (x) who is liked by everyone (y)."
- **∃x ∀y Likes(y, x)**.
- This is the foundation of "SQL Databases"—every query you run on a database is actually a statement in predicate logic.
3. The "Scope" of a Variable: Variables are "Bound" by their quantifiers.
- Just like in programming, a variable 'x' inside a "For Each" loop only exists inside that loop.
- Logic allows us to "Nests" these loops to create incredibly complex descriptions of reality.
The 'Syllogism' Upgrade': Aristotle's famous "Socrates is mortal" logic was actually the very first (and simplest) form of predicate logic. It took 2,000 years for Gottlob Frege to add the "Quantifiers" (∀ and ∃) to turn it into the "Full Version" we use today.
Applying[edit]
Modeling 'The Database Query' (Translating English into Predicate Logic): <syntaxhighlight lang="python"> def evaluate_predicate(domain, predicate_func, quantifier):
"""
Simulates ∀ and ∃ logic.
"""
results = [predicate_func(obj) for obj in domain]
if quantifier == "ALL": # ∀
return all(results)
elif quantifier == "EXISTS": # ∃
return any(results)
return None
- World: [1, 2, 3, 4] | Predicate: "Is even?"
numbers = [1, 2, 3, 4] is_even = lambda x: x % 2 == 0
- Check: "Are ALL numbers even?" (∀x Even(x))
print(f"∀x Even(x): {evaluate_predicate(numbers, is_even, 'ALL')}")
- Check: "Is there SOME number that is even?" (∃x Even(x))
print(f"∃x Even(x): {evaluate_predicate(numbers, is_even, 'EXISTS')}") </syntaxhighlight>
- Logic Landmarks
- Begriffsschrift (1879) → Gottlob Frege's book that "Invented" modern predicate logic, often called the "Most important work in logic since Aristotle."
- Principia Mathematica (1910) → Russell and Whitehead's attempt to derive all of math from pure predicate logic (a massive task that took 2,000 pages).
- SQL (1974) → The standard language for databases, which is literally just "Predicate Logic in a Suit."
- Prolog (1972) → The first "Logic Programming Language," where you don't write "Steps," you just write "Facts and Rules" in predicate logic, and the computer finds the answer for you.
Analyzing[edit]
| Feature | Propositional (Small) | Predicate (Big) |
|---|---|---|
| Basic Unit | The Sentence (P) | The Object and Property (P(x)) |
| Scope | Single facts | General rules (All / Some) |
| Complexity | Low (Calculated with Truth Tables) | High (Often "Un-calculable") |
| Analogy | A 'Calculator' | A 'Programming Language' |
The Concept of "Bound" vs. "Free" Variables: Analyzing why variables can be confusing. A variable is Bound if it is inside a quantifier (like 'x' in ∀x). A variable is Free if it is just a "Hole" in the sentence. Predicate logic is only "True or False" if all its variables are bound—otherwise, it's just a "Formula."
Evaluating[edit]
Evaluating predicate logic:
- The "Decidability" Problem: Unlike propositional logic, you can't always "Calculate" if a predicate statement is true. Alan Turing proved that some problems in predicate logic are "Un-solvable" by any computer.
- Higher-Order Logic: Predicate logic can't talk about "Properties of Properties" (e.g., "Kindness is a Virtue"). Does this mean it's "Too weak" to describe human life?
- Natural Language: Humans say "Most people like pizza." Predicate logic only has "All" or "Some." It doesn't have a symbol for "Most."
- Complexity: As soon as you add a few variables (x, y, z), the number of possible "Worlds" explodes, making it very hard for AIs to "Reason" using pure logic alone.
Creating[edit]
Future Frontiers:
- Knowledge Graphs: Using predicate logic to connect all the data on the internet (The "Semantic Web") so AIs can truly "Understand" the relationships between people and things.
- Formal Verification: Using predicate logic to "Prove" that the code in a self-driving car or a nuclear reactor is 100% safe before it is ever turned on.
- Neuro-Symbolic AI: Merging "Neural Networks" (which are good at seeing patterns) with "Predicate Logic" (which is good at following rules) to create the next generation of AI.
- Computational Law: Turning the "Laws of a Country" into predicate logic so that contracts can be "Executed" automatically by a computer without needing a lawyer.