First-Order Logic (FOL) in Artificial Intelligence is a formal system used to represent and reason about the properties and relationships of objects. Unlike propositional logic, which deals with simple, true or false statements, FOL includes quantifiers and predicates, allowing for more complex expressions. FOL enables the representation of statements like "All humans are mortal" using variables, constants, functions, and quantifiers (e.g., ∀x (Human(x) → Mortal(x))). It is foundational for knowledge representation, enabling AI systems to perform sophisticated reasoning, infer new information, and solve problems in a wide range of domains.
First Order Logic (FOL) in Artificial Intelligence is a formal system used to represent and reason about the properties and relationships of objects. Unlike propositional logic, which deals with simple, true or false statements, FOL includes quantifiers and predicates, allowing for more complex expressions. FOL enables the representation of statements like "All humans are mortal" using variables, constants, functions, and quantifiers (e.g., ∀x (Human(x) → Mortal(x))). It is foundational for knowledge representation, enabling AI systems to perform sophisticated reasoning, infer new information, and solve problems in a wide range of domains. Consider the following sentence, which cannot be represented using Propositional Logic (PL):
First-Order Logic (FOL):
The syntax of First-Order Logic (FOL) specifies which combinations of symbols form valid logical expressions. The fundamental syntactic elements of FOL are symbols, which allow us to write statements in a concise, shorthand notation.
Constant: | 1, 2, A, John, Mumbai, cat,.... |
---|---|
Variables: | x, y, z, a, b,.... |
Predicates: | Brother, Father, >,.... |
Functions: | sqrt, LeftLegOf, .... |
Connectives: | ∧, v, ¬, ⇒, ⇔ |
Equality: | == |
Quantifier: | ∀, ∃ |
Atomic sentences are the simplest expressions in First-Order Logic (FOL). They are created by combining a predicate symbol with a sequence of terms enclosed in parentheses.
We can represent atomic sentences in the format: Predicate(term1, term2, ..., term n).
Examples:
Complex sentences are formed by combining atomic sentences using connectives.
First-Order Logic (FOL) statements can be divided into two parts:
Consider the statement: "x is an integer." It consists of two parts: the first part, "x," is the subject of the statement, and the second part, "is an integer," is the predicate.
The universal quantifier, denoted by the symbol "∀", is used in logical representation to indicate that a statement holds true for every instance of a particular thing or for everything within its scope.
In the universal quantifier, we use the implication "→". For a variable x, "∀x" is read as:
Example:
All man drink coffee. Let the variable x represent a cat. In the universe of discourse (UOD), the statement "all x" can be represented as:
∀x man(x) → drink (x, coffee).
It is read as: "For all x, where x is a person who drinks coffee."
Existential quantifiers are a type of quantifier that express that a statement within its scope is true for at least one instance of something.
It is denoted by the logical operator "∃", which resembles an inverted E. When used with a predicate variable, it is called an existential quantifier.
Note: In existential quantification, we always use the AND or conjunction symbol "∧".
Example:
Some boys are intelligent.
∃x: boys(x) ∧ intelligent(x)
It is read as: "There are some x where x is a boy who is intelligent."
Points to remember:
Properties of Quantifiers:
Examples of First-Order Logic (FOL) using quantifiers:
Free Variable: A variable is considered a free variable in a formula if it appears outside the scope of any quantifier.
Example: In ∀x ∃y [P(x, y, z)], z is a free variable.
Bound Variable: A variable is considered a bound variable in a formula if it appears within the scope of a quantifier.
Example: In ∀x [A(x) ∧ B(y)], both x and y are bound variables.