Syntax and Semantics of Propositional Logic
Prerequisites
- Basic understanding of mathematical logic
- Familiarity with Boolean algebra concepts
π― Learning Objectives
- Understand the syntax of propositional logic: atomic propositions and connectives
- Define well-formed formulas (WFFs) formally
- Apply operator precedence to parse complex formulas
- Evaluate formulas under given truth assignments
1. What is Propositional Logic?
Propositional logic (also called sentential logic or zeroth-order logic) is the simplest form of formal logic. It deals with propositionsβstatements that are either true or falseβand how they can be combined using logical connectives.
A proposition is a declarative sentence that is either true (β€) or false (β₯), but not both. It has a definite truth value.
Examples of Propositions
- "The Earth revolves around the Sun." β True
- "7 + 5 = 13" β False
- "GATE DA 2026 exam has an AI section." β True
Non-Propositions (Not Declarative)
- "What time is it?" β Question, no truth value
- "Close the door." β Command, no truth value
- "x + 2 = 5" β Open sentence (depends on x)
2. Syntax of Propositional Logic
The syntax defines the alphabet (symbols) and grammar (rules for forming valid expressions) of the language.
2.1 Alphabet
The alphabet of propositional logic consists of:
| Symbol Type | Symbols | Description |
|---|---|---|
| Propositional variables | P, Q, R, S, ... (or p, q, r, s, ...) | Atomic propositions |
| Truth constants | β€ (True), β₯ (False) | Logical constants |
| Negation | Β¬ | NOT (unary connective) |
| Conjunction | β§ | AND (binary connective) |
| Disjunction | β¨ | OR (binary connective) |
| Implication | β | IF...THEN (binary connective) |
| Biconditional | β | IF AND ONLY IF (binary connective) |
| Parentheses | ( , ) | Grouping |
2.2 The Five Logical Connectives
Β¬P is true when P is false, and false when P is true. It flips the truth value.
Β¬P is true βΊ P is false
P β§ Q is true only when both P and Q are true.
P β§ Q is true βΊ P is true AND Q is true
P β¨ Q is true when at least one of P or Q is true. This is inclusive OR.
P β¨ Q is false βΊ P is false AND Q is false
P β Q is false only when P is true and Q is false. P is the antecedent (hypothesis), Q is the consequent (conclusion).
P β Q is false βΊ P is true AND Q is false
β οΈ Common GATE Mistake: Implication
Many students get confused: P β Q is true when P is false, regardless of Q. A false hypothesis makes the entire implication vacuously true. For example: "If 2 + 2 = 5, then the moon is made of cheese" is True!
P β Q is true when P and Q have the same truth value.
P β Q is true βΊ (P β Q) β§ (Q β P)
3. Well-Formed Formulas (WFFs)
A well-formed formula is defined recursively:
- Base case: Every propositional variable (P, Q, R, ...) is a WFF. The constants β€ and β₯ are WFFs.
- Negation: If α is a WFF, then ¬α is a WFF.
- Binary connective: If Ξ± and Ξ² are WFFs, then (Ξ± β§ Ξ²), (Ξ± β¨ Ξ²), (Ξ± β Ξ²), and (Ξ± β Ξ²) are WFFs.
- Nothing else is a WFF.
WFF or Not?
| Expression | WFF? | Reason |
|---|---|---|
| P β§ Q | β Yes | Binary connective applied to two propositional variables |
| Β¬(P β Q) | β Yes | Negation applied to an implication WFF |
| β§ P Q | β No | Connective must be between two WFFs (infix notation) |
| P β§ β¨ Q | β No | Two consecutive binary connectives without operand |
| ((P β¨ Q) β§ Β¬R) β S | β Yes | Valid recursive construction |
4. Operator Precedence
To reduce the number of parentheses, we adopt a standard precedence (from highest to lowest):
Operator Precedence (Highest to Lowest)
| Priority | Operator | Name | Associativity |
|---|---|---|---|
| 1 (Highest) | Β¬ | Negation | Right |
| 2 | β§ | Conjunction | Left |
| 3 | β¨ | Disjunction | Left |
| 4 | β | Implication | Right |
| 5 (Lowest) | β | Biconditional | Left |
π Key Point for GATE
Implication (β) is right-associative: P β Q β R means P β (Q β R), not (P β Q) β R.
Example 1: Parsing P β§ Q β¨ R β S
Step 1: β§ binds tighter than β¨: (P β§ Q) β¨ R β S
Step 2: β¨ binds tighter than β: ((P β§ Q) β¨ R) β S
Fully parenthesized: ((P β§ Q) β¨ R) β S
Example 2: Parsing Β¬P β§ Q β R β¨ S
Step 1: Β¬ has highest precedence: (Β¬P) β§ Q β R β¨ S
Step 2: β§ next: ((Β¬P) β§ Q) β R β¨ S
Step 3: β¨ next: ((Β¬P) β§ Q) β (R β¨ S)
Fully parenthesized: ((Β¬P) β§ Q) β (R β¨ S)
Example 3: Parsing P β Q β R β S β¨ Β¬T
Step 1: Β¬ first: P β Q β R β S β¨ (Β¬T)
Step 2: β¨ binds: P β Q β R β (S β¨ (Β¬T))
Step 3: β is right-associative: P β (Q β R) β (S β¨ (Β¬T))
Step 4: β again: (P β (Q β R)) β (S β¨ (Β¬T))
Fully parenthesized: (P β (Q β R)) β (S β¨ (Β¬T))
5. Semantics: Truth Assignments and Interpretations
A truth assignment (also called an interpretation or valuation) is a function v that maps every propositional variable to a truth value:
v : {P, Q, R, ...} β {True, False}
The truth value of any compound formula is then determined by the truth values of its components and the semantics of the connectives.
Given an interpretation v, the truth value of a formula Ξ±, denoted v(Ξ±), is:
- v(¬α) = True iff v(α) = False
- v(Ξ± β§ Ξ²) = True iff v(Ξ±) = True and v(Ξ²) = True
- v(Ξ± β¨ Ξ²) = True iff v(Ξ±) = True or v(Ξ²) = True
- v(Ξ± β Ξ²) = True iff v(Ξ±) = False or v(Ξ²) = True
- v(Ξ± β Ξ²) = True iff v(Ξ±) = v(Ξ²)
Example: Evaluate (P β Q) β§ Β¬R under v(P)=T, v(Q)=F, v(R)=T
- v(P β Q) = v(P)=T and v(Q)=F, so P β Q = False (T β F = F)
- v(Β¬R) = Β¬True = False
- v((P β Q) β§ Β¬R) = False β§ False = False
π Number of Possible Interpretations
For a formula with n distinct propositional variables, there are 2n possible truth assignments. This is why truth tables have 2n rows.
6. Key Terminology Summary
| Term | Meaning |
|---|---|
| Atomic formula | A propositional variable (P, Q, R, ...) |
| Literal | An atom or its negation (P or Β¬P) |
| Compound formula | Formula built using connectives |
| Model | An interpretation that makes a formula true |
| β¨ (entails) | Semantic consequence: Ξ± β¨ Ξ² means every model of Ξ± is a model of Ξ² |
| β’ (derives) | Syntactic derivation using inference rules |
7. GATE Exam Tips
π― Frequently Tested Concepts
- Operator precedence β Questions often test whether you can parse formulas correctly without full parenthesization.
- Implication truth table β The fact that F β T = T and F β F = T trips up many students.
- WFF identification β Distinguish valid formulas from syntactically incorrect expressions.
- Number of interpretations β For n variables, there are exactly 2n interpretations.