1 of 24

Natural Language Processing

By

S.V.V.D.Jagadeesh

Sr. Assistant Professor

Dept of Artificial Intelligence & Data Science

LAKIREDDY BALI REDDY COLLEGE OF ENGINEERING

2 of 24

  • Session Outcomes
  • Semantic Analysis
  • Need for semantic representations
  • Verifiability
  • Unambiguous Representations
  • Canonical form
  • Inference & Variables
  • Expressiveness

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Previously Discussed Topics

LBRCE

NLP

3 of 24

At the end of this session, Student will be able to:

  • Apply First Order Logic to derive meaning of the sentences (Apply-L3)

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Session Outcomes

LBRCE

NLP

4 of 24

  • First-Order Logic (FOL), also called predicate logic, is a formal system used to represent objects, properties, relationships, and rules in a domain so that computers can perform reasoning and inference.
  • In Natural Language Processing, FOL is used to represent the meaning of sentences in a structured and machine-interpretable form.
  • Example: John Love Mary
  • Representation: Love(John,Mary)
  • John → subject (agent)
  • Love → relation/action
  • Mary → object

S.V.V.D.Jagadeesh

Friday, March 6, 2026

First Order Logic

LBRCE

NLP

5 of 24

  • Constants
  • Variables
  • Predicates
  • Functions
  • Logical Connectives
  • Quantifiers

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Components of FOL

LBRCE

NLP

6 of 24

  • Constants represent specific objects or entities in the domain.
  • Examples: John, Mary, Paris, India, Computer
  • Example: John is a student.
  • Representation: Student(John)
  • John is a constant.

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Constants

LBRCE

NLP

7 of 24

  • Variables represent unknown or general objects.
  • Examples: x, y, z
  • Example: Student(x)
  • Meaning: x is some student.

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Variables

LBRCE

NLP

8 of 24

  • Predicates represent properties of objects or relationships between objects.
  • Examples: Student(x), Teacher(x), Loves(John, Mary), LivesIn(Ravi, India)
  • Types of predicates
  • Unary
  • Binary
  • Ternary

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Predicates

LBRCE

NLP

9 of 24

  • 1. Unary predicate (one argument)
  • Student(John)
  • Meaning: John is a student.
  • 2. Binary predicate (two arguments)
  • Likes(John, IceCream)
  • Meaning: John likes ice cream.
  • 3. Ternary predicate (three arguments)
  • Give(Ravi, Book, Sita)
  • Meaning: Ravi gave a book to Sita.

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Types of Predicates

LBRCE

NLP

10 of 24

  • Functions return a value related to an object.
  • Example
  • FatherOf(John)
  • Meaning: The father of John.
  • Example sentence
  • The father of John is a doctor.
  • Representation: Doctor(FatherOf(John))

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Functions

LBRCE

NLP

11 of 24

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Logical Connectives

Symbol

Meaning

AND

OR

¬

NOT

IMPLIES

IF AND ONLY IF

  • Logical connectives combine logical statements.

LBRCE

NLP

12 of 24

  • Example using AND (∧)
  • Sentence: John is a student and he is intelligent.
  • Representation: Student(John) ∧ Intelligent(John)
  • Example using OR (∨)
  • Sentence: John is a student or a teacher.
  • Representation: Student(John) ∨ Teacher(John)
  • Example using NOT (¬)
  • Sentence: John is not a teacher.
  • Representation: ¬Teacher(John)

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Examples of Logical Connectives

LBRCE

NLP

13 of 24

  • Example using implication (→)
  • Sentence: If someone is a student, then they study.
  • Representation: Student(x) → Studies(x)
  • Meaning: If x is a student, then x studies.

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Examples of Logical Connectives

LBRCE

NLP

14 of 24

  • Quantifiers express how many objects satisfy a condition.
  • Types:
  • Universal Quantifier
  • Existential Quantifier

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Quantifiers

LBRCE

NLP

15 of 24

  • Universal Quantifier (∀)
  • Symbol: ∀
  • Meaning: For all
  • Example sentence: All humans are mortal.
  • Representation: ∀x Human(x) → Mortal(x)
  • Explanation: For every x, if x is human, then x is mortal.
  • Example: All students study.
  • Representation: ∀x Student(x) → Study(x)
  • Meaning: Every student studies.

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Examples of Quantifiers

LBRCE

NLP

16 of 24

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Examples of Quantifiers

  • Existential Quantifier (∃)
  • Symbol: ∃
  • Meaning: There exists
  • Example sentence: There is a student in the class.
  • Representation: ∃x Student(x)
  • Meaning: At least one student exists.
  • Example
  • Sentence: Some students like mathematics.
  • Representation: ∃x Student(x) ∧ Likes(x, Mathematics)
  • Meaning:There exists a student who likes mathematics.

LBRCE

NLP

17 of 24

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Exercises

  • Sentence: Ravi is a teacher.
  • Sentence: Ravi teaches Sita.
  • Sentence: Every teacher teaches students.
  • Sentence: Some student passed the exam.

LBRCE

NLP

18 of 24

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Solutions

  • Sentence: Ravi is a teacher.
  • Representation: Teacher(Ravi)
  • Sentence: Ravi teaches Sita.
  • Representation: Teaches(Ravi,Sita)
  • Sentence: Every teacher teaches students.
  • Representation: ∀x Teacher(x) → Teaches(x, Student)
  • Sentence: Some student passed the exam.
  • Representation: ∃x Student(x) ∧ Passed(x, Exam)

LBRCE

NLP

19 of 24

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Representing Events

Entity

Role

John

Agent

Cake

Theme

Knife

Instrument

  • Events in NLP can also be represented using predicates.
  • Example sentence
  • John cut the cake with a knife.
  • Representation
  • Cut(John, Cake, Knife)
  • This structure clearly shows who performed the action and what objects were involved.

LBRCE

NLP

20 of 24

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Inference Using First Order Logic

  • FOL allows systems to derive new knowledge from existing facts.
  • Example
  • Knowledge base
  • ∀x Human(x) → Mortal(x)�Human(Socrates)
  • Inference: Mortal(Socrates)
  • Explanation: Since all humans are mortal and Socrates is human, Socrates must be mortal.

LBRCE

NLP

21 of 24

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Advantages of FOL

  • Precise representation of meaning�Captures relationships between objects clearly.
  • Supports reasoning and inference�Allows systems to derive new knowledge.
  • Handles complex sentences�Can represent nested relationships and conditions.
  • Used in knowledge bases and expert systems
  • Foundation for semantic analysis in NLP

LBRCE

NLP

22 of 24

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Disadvantages of FOL

  • Natural language meanings are sometimes too complex or ambiguous.
  • Difficult to represent uncertainty or probability.
  • Requires large knowledge bases.
  • Not always efficient for large-scale NLP tasks.

LBRCE

NLP

23 of 24

  • Previously Discussed Topics
  • Session Outcomes
  • First Order Logic
  • Components of FOL
  • Constants
  • Variables
  • Predicates
  • Functions
  • Logical Connectives

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Summary

LBRCE

NLP

24 of 24

  • Examples of Logical connectives
  • Quantifiers
  • Examples of Quantifiers
  • Exercises and Solutions
  • Representing events
  • Inference Using FOL
  • Advantages of FOL
  • Disadvantages of FOL

S.V.V.D.Jagadeesh

Friday, March 6, 2026

Summary

LBRCE

NLP