Inference in FOL
Inference in FOL
In First-Order Logic, inference is used to derive new facts or sentences from existing ones.
Before we get into the FOL inference rule, it's important to understand some basic FOL
terminology.
Substitution:
Substitution is a basic procedure that is applied to terms and formulations. It can be found in all
first-order logic inference systems. When there are quantifiers in FOL, the substitution becomes
more complicated. When we write F[a/x], we are referring to the substitution of a constant "a"
for the variable "x."
Equality:
In First-Order Logic, atomic sentences are formed not only via the use of predicate and words,
but also through the application of equality. We can do this by using equality symbols, which
indicate that the two terms relate to the same thing.
In the above example, the object referred by the Brother (John) is close to the object referred
by Smith. The equality symbol can be used with negation to portray that two terms are not the
same objects.
First-order logic has inference rules similar to propositional logic, therefore here are some basic
inference rules in FOL:
• Universal Generalization
• Universal Instantiation
• Existential Instantiation
• Existential introduction
1. Universal Generalization:
• Universal generalization is a valid inference rule that states that if premise P(c) is true for
any arbitrary element c in the universe of discourse, we can arrive at the conclusion x P.
(x).
• It can be represented as:
• If we want to prove that every element has a similar property, we can apply this rule.
• x must not be used as a free variable in this rule.
Example: Let's represent, P(c): "A byte contains 8 bits", so "All bytes contain 8 bits."for ∀ x
P(x) , it will also be true.
2. Universal Instantiation:
3. Existential Instantiation:
4. Existential introduction
What is Unification?
o Unification is a process of making two different logical atomic expressions identical by finding a
substitution. Unification depends on the substitution process.
o It takes two literals as input and makes them identical using substitution.
o Let Ψ1 and Ψ2 be two atomic sentences and 𝜎 be a unifier such that, Ψ1𝜎 = Ψ2𝜎, then it can be
expressed as UNIFY(Ψ1, Ψ2).
o Example: Find the MGU for Unify{King(x), King(John)}
Substitution θ = {John/x} is a unifier for these atoms and applying this substitution, and both
expressions will be identical.
o The UNIFY algorithm is used for unification, which takes two atomic sentences and returns a
unifier for those sentences (If any exist).
o Unification is a key component of all first-order inference algorithms.
o It returns fail if the expressions do not match with each other.
o The substitution variables are called Most General Unifier or MGU.