Propositional Logic and Its Application in Artificial Intelligence
Propositional logic focuses on statements, known as propositions, that are either true or false. By using logical connectors like AND, OR, NOT, and IMPLIES, it creates complex expressions and applies logical rules to assess whether they are true or false.
Propositional Logic in AI
In Artificial Intelligence (AI), propositional logic is a major approach for representing knowledge. It uses statements (propositions) that are either true or false to describe facts. Logical operators such as AND, OR, NOT, and IMPLIES are used to combine these basic statements into more detailed expressions.
This structure allows AI to perform logical reasoning and reach decisions. Rule-based logic, expert systems, and automatic proof engines often rely on this method. In AI models, inference strategies like Resolution and Modus Ponens help machines draw conclusions from known information.
Propositional expressions in AI are made of symbols representing facts, combined with logical operators. These symbols are often grouped with parentheses to structure the logical meaning clearly.
Examples of Propositions
Here are some changed examples of simple propositions:
- Rainwater flows into the drain.
- A circle has five corners. (False)
- Glass breaks when dropped on a hard surface.
- 6 + 3 = 11. (False)
- A drone can fly without direct control from a person.
Key Points about Propositional Logic
- Propositional logic is used in AI, math, and computer science to reason about logical expressions.
- It focuses only on the structure of statements and doesn't consider their actual meaning or context.
- The order of operation is important: NOT (¬) is done first, followed by AND, then OR, then IMPLIES, and finally BICONDITIONAL.
- Truth tables are tools used to analyze whether a statement is logically valid, can be true, or is always false.
- This logic system doesn’t handle relationships between items or statements like "all" or "some" — these need First Order Logic (FOL).
- Only declarative statements qualify as propositions. For example, “The stars are visible tonight” is a proposition. A question like “Is it raining?” is not.
Basic Parts of Propositional Logic
Propositions (Statements)
Two kinds of propositions are used:
- Atomic propositions are the smallest units and can’t be broken down further.
Example: "The book is on the shelf."
- Compound propositions are formed by joining atomic propositions using logic operators.
Example: "He studies OR he plays football."
Logical Operators (Connectives)
Logical operators are used to connect or modify propositions to build more complex expressions. Here are the main ones:
Symbol | Name | Meaning | Example |
---|---|---|---|
∧ | Conjunction | AND | A ∧ B |
∨ | Disjunction | OR | A ∨ B |
→ | Implication | If A, then B | A → B |
↔ | Biconditional | If and only if | A ↔ B |
⊕ | Exclusive OR | Either A or B | A ⊕ B |
¬ | Negation | NOT | ¬A or ~B |
Explanation of Logical Connectives
- Conjunction (AND ∧):
- Disjunction (OR ∨):
- Negation (NOT ¬):
- Implication (→):
- Biconditional (↔):
Truth Tables for Logical Connectives
Truth tables display all possible combinations of truth values:
Conjunction (AND ∧)
P | Q | P ∧ Q |
---|---|---|
T | T | T |
T | F | F |
F | T | F |
F | F | F |
Disjunction (OR ∨)
P | Q | P ∨ Q |
---|---|---|
T | T | T |
T | F | T |
F | T | T |
F | F | F |
Implication (→)
P | Q | P → Q |
---|---|---|
T | T | T |
T | F | F |
F | T | T |
F | F | T |
Biconditional (↔)
P | Q | P ↔ Q |
---|---|---|
T | T | T |
T | F | F |
F | T | F |
F | F | T |
Exclusive OR (⊕)
P | Q | P ⊕ Q |
---|---|---|
T | T | F |
T | F | T |
F | T | T |
F | F | F |
Negation (¬)
P | ¬P |
---|---|
T | F |
F | T |
Always True, Always False, and Conditional Propositions
- Tautology: A statement that is always true, no matter the truth values of its parts.
Example: P ∨ ¬P
- Contradiction: A statement that is always false.
Example: P ∧ ¬P
- Contingency: A proposition that may be true in some cases and false in others.
Example: P ∧ Q
Operator Priority (Precedence)
The order in which logic operators are evaluated:
-
Parentheses
-
Negation (¬)
-
AND (∧)
-
OR (∨)
-
Implication (→)
-
Biconditional (↔)
Note: If two operators have the same priority, they’re read from left to right.
Logic Example: Buying Decision
Statement: "If the item is discounted AND I have money, then I’ll buy it OR I’ll wait."
Propositions:
- P = Item is discounted
- Q = I have money
- R = I will buy
- S = I will wait
Logical form:
(P ∧ Q) → (R ∨ S)
This expression follows the order: Parentheses → AND → OR → THEN (Implication).
Logical Equivalence
When two logic statements always have the same truth value, they are logically equivalent.
Example: P → Q is the same as ¬P ∨ Q
In AI, this helps simplify complex expressions, saving processing time and improving reasoning efficiency.
Logic Operator Properties
- Commutative: Changing order doesn’t change result
(P ∨ Q = Q ∨ P)
- Associative: Grouping doesn’t affect meaning
((P ∨ Q) ∨ R = P ∨ (Q ∨ R))
- Distributive: AND over OR (and vice versa)
P ∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R)
- De Morgan’s Law:
¬(P ∧ Q) = ¬P ∨ ¬Q
¬(P ∨ Q) = ¬P ∧ ¬Q
- Double Negation:
¬(¬P) = P
- Implication Rule:
P → Q = ¬P ∨ Q
- Idempotent Law:
P ∧ P = P
P ∨ P = P
Propositional Logic Syntax
- Atomic Propositions: Single statements like P, Q, etc.
- Connectives: Logical symbols such as ∧, ∨, ¬, →, ↔
- Parentheses: Group operations
- Compound Propositions: Formed by connecting multiple atomic propositions, e.g., (P ∧ Q) ∨ ¬R
How AI Uses Propositional Logic
- Automated Reasoning: If "Room is dark" → AI turns on lights
- Knowledge Representation: "Customer adds item to cart" → "Show discount" → P → Q
- Decision Making: Low battery (P) AND charger nearby (Q) → Charge device
- Planning: Room is free (P) AND team is available (Q) → Schedule meeting
- Expert Systems: Has job (P) AND good credit score (Q) → Approve loan (R)
- Gaming: Enemy is close (P) AND move is available (Q) → Make move
- Language Understanding: “If it’s hot (P), turn on AC (Q)” → P → Q
Limitations of Propositional Logic
- Cannot show how objects are related (e.g., "John is taller than Mike").
- Fails to express statements like "Every student passed the exam" because it lacks quantifiers.
- Cannot use variables to represent general rules.
- Doesn’t scale well when the number of facts increases.
- Not suitable for uncertain or incomplete data.
To overcome these, AI systems often use First Order Logic, which adds variables, relationships, and quantifiers for more advanced reasoning.