Logic: propositional and predicate
GATE DA210 min read
Propositional logic
Definition. A proposition is a statement that is either true or false. Formulas are built from propositional variables with the connectives (not), (and), (or), (implies) and (if and only if).
Implication. is false only when is true and is false. So it is equivalent to . Its contrapositive is equivalent to it; its converse and inverse are not.
| T | T | T | T | T | T |
| T | F | F | T | F | F |
| F | T | F | T | T | F |
| F | F | F | F | T | T |
Useful equivalences.
- De Morgan: and .
- Distribution: .
- .
- Exportation: .
Kinds of formula. A tautology is true under every assignment (e.g. ); a contradiction is false under every assignment; a formula is satisfiable if at least one assignment makes it true. A formula is valid exactly when is unsatisfiable.
Entailment. A knowledge base entails , written , if is true in every model (assignment) where is true. Equivalently, is unsatisfiable. A formula over variables has assignments, so model checking by truth table takes time.
Solved examples
Example 1: is it a tautology? Check (modus ponens). The only way an implication fails is a true premise with a false conclusion: false and true. But true and false make false. So it never fails: a tautology.
Example 2: equivalent forms. .
Inference rules and resolution
Sound rules derive only entailed conclusions:
- Modus ponens: from and , infer .
- Modus tollens: from and , infer .
- Hypothetical syllogism: from and , infer .
- Disjunctive syllogism: from and , infer .
Fallacies (not valid): affirming the consequent (, , so ) and denying the antecedent (, , so ).
Conjunctive normal form (CNF): a conjunction of clauses, each a disjunction of literals. Every formula has an equivalent CNF: remove and , push inward with De Morgan, then distribute over .
Resolution: from clauses and infer . To prove : convert to CNF and resolve repeatedly; deriving the empty clause proves entailment (refutation). Resolution is sound and refutation-complete.
Horn clauses have at most one positive literal, e.g. , i.e. . For Horn knowledge bases, forward chaining (fire rules whose premises are known) and backward chaining (work back from the goal) decide entailment in time linear in the size of the KB.
Solved example
Example 3: resolution proof. KB: , , . Goal: .
- Clauses: , , , and the negated goal .
- Resolve with : .
- Resolve with : .
- Resolve with : the empty clause.
So .
Predicate (first-order) logic
Definition. First-order logic adds objects, predicates (properties and relations, such as or ), functions, and the quantifiers (for all) and (there exists).
Translating English.
- "All students study": . Use with .
- "Some student studies": . Use with .
- "No student studies": , equivalently .
Exam point. is a classic mistake: it is true as soon as anything is not a student.
Negating quantifiers. and .
Order matters. (everyone loves someone) differs from (someone is loved by everyone). The second implies the first, not the other way round. Quantifiers of the same kind commute: .
Distribution. and . But does not distribute over , and does not distribute over .
Inference in first-order logic. Universal instantiation replaces a variable with any ground term; existential instantiation replaces an variable with a new constant (a Skolem constant). Unification finds a substitution that makes two expressions identical, e.g. and unify with . Generalised modus ponens combines unification with modus ponens.
Solved example
Example 4. From and : instantiate , then modus ponens gives .
You have read the free 26% of this note
Sign in with Google to keep reading. It is free, takes one tap, and you also get:
- 10 practice questions from this note
- Every note in full, plus the PDF library
- Official past papers as timed tests, with explanations
- An AI tutor for doubts, in Hindi or English
- Your progress, mistakes and study plan saved on every device