What is inference?

The inference is finding a conclusion or result based on any data, events, and any information. Usually, there will be a set of conditions and the conclusion is made, which satisfies all the given conditions are true. The conclusion is made according to the inference rules. Any artificial intelligence agent or an intelligent system uses the inference engine to find a better result or output. The work of the inference engine is to analyze the fact and figures based on all circumstances. After the analysis, the machine concludes this fact and gives it to the agent. The agent uses this conclusion for further processing and decision-making. Intelligent systems will generate new logic from existing ones based on the facts.

Conditional statements in Inference

In proposition logic, new conditional statements can be generated from existing ones. Consider the conditional statement AB with logical connective "implication". The expression says that if statement A it is true then statement B must be true. Now the three conditional statements, that can be generated from this are given below:

  • Converse: The converse statement is opposite to the implication. The expression for the converse is BA. This is read as "B implies A".
  • Contrapositive: The contrapositive follow the negation rule. It is the negation of statements in converse . The negation of A, B is ~A, ~B. And the contrapositive expression is ~B~A that represent "if ~B then ~A".

  • Inverse: The inverse statement follow the negation of statements in implication . The expression of inverse is ~A~B

Inference in First-Order Logic

Inference in First-order logic (FOL) generates new sentences or facts from the existing ones. To understand the First-order logic inference rule, let's know some basic definitions.

Substitution: Substitution is an essential operation performed on formulas and terms. It comes in all inference systems in first-order logic. The term F[m/z], represents that a constant "m" can be substituted in place of variable "z".

Equality: In FOL, equality defines the same object can be represented by different terms. Let's see this with the help of an example. Given is an equality example of first-order logic(FOL).

Example: Sister(Jenny)=Anna.

In the above example, the object pointed by Sister (Jenny) is the same as the object pointed by Anna.

First-order logic consists of the following:-

  • Relations-such as, Greater than, round, pink, prime, even, comes between
  • Object-such as, Football game, colors, numbers, houses, people.
  • Functions-such as, One more than, mother of, plus, sister of.

Basic components of FOL consist of the following:

Components of FOL

First-order logic inference rules for quantifier

  • Universal Generalization- It is a rule that states that if the premise is correct or valid for any element, say c in the universe of discourse, we have a conclusion as ∀ x Q(x). It is written as:-

Qc×Qx

This rule is used to represent that every element has a similar property.

Example:-

Q(c): "The nibble contains 4 bits".

So∀ x Q(x) which means "All nibble contains 4 bits" will be valid.

  • Universal Instantiation

This is also known as Universal Elimination. This can be used multiple times to add new sentences.

In UI( Universal Instantiation), any sentence can be inferred by substituting a ground terminal for the variable.

According to the Rule, any sentence Q(c) can be obtained by replacing a ground word c from the ∀ x Qx for any item in the discourse universe, where c is the constant that comes in a domain x. It is written as:-

xQxQc

Example:- "If every person likes chocolates" ∀x Q(x), we can infer that "harry likes chocolates" Q(c)

  • Existential Instantiation

This is also known as Existential elimination. It is a valid inference rule in first-order logic. It can be applied only once to restore the existential sentence.
This rule concludes that one can infer Q(c) from the equation or formula provided in ∃x Q(x) for a new symbol c which is a constant. It is written as:-

xQxQc

Example:-

Consider, ∃x Crown(x)∧OnHead(x, harry)

So, from this, we can infer that Crown(K)∧OnHead(K, harry), as long as K doesn't exist in the knowledge base.

  • Existential introduction

This is also known as Existential Generalization. According to this rule, element c exists in the universe of discourse. Q is the property of the universe of discourse. So by this, it states that something exists in the universe that has the property Q. It is written as:-

QcxQx

Example:- 

Consider "Ron got good marks in English."

so, we can infer that, "Someone got good marks in English."

Rules of inference

Inference Rules are the templates for generating authentic arguments. These Rules are enforced to develop proofs in AI. These proofs are usually the sequence of conclusions.

There are 7 types of inferences in Artificial intelligence:

  • Modus Ponens

The modes ponens is based on the implication AB that is read by "A implies B" which means that "if A is true then B must be true". The rule states that if A implies B and A is true, then B will be true. It is written as:

AB,AB

Example:-

Statement-1: "If the room is dirty then I will have clean up",

AB

Statement-2: "The room is dirty", A
Conclusion: "I will have to clean up.", B

Modus Tollens

Modus Tollens follow the negation rule. That means if AB is true and ~B is true, then ~A will also be true. It is represented as:-

AB,~Q~A

Example:-

Statement-1: "If it rains then the clothes will be wet", AB
Statement-2:  "Clothes are not wet, ~B
Conclusion:  Which infers that "it has not rained", ~A

  • Hypothetical Syllogism

The hypothetical syllogism states that if AB is true and BC is true then AC will definitely be true. 

Example:-

Statement-1: If you have my car then you can take its key, A→B
Statement-2: If you can take its key then you can go to the palace, B→C
Conclusion: If you have my car then you can go to the palace, A→C

  • Disjunctive Syllogism

This states that if AB is true for a given condition, and ~A is true, then B will be true. It is denotes as:

ABAB

Example:-

Statement-1: This month is January or February, A∨B
Statement-2: This month is not February, ¬A
Conclusion: This month is January, B

  • Addition

In an addition rule, for the two statements A, B, If A is true then, AB will be true.

AAB

Example:-

Statement-1: I have a banana milk shake, A
Statement-2: I have mango juice, B
Conclusion: I have banana milk shake and mango juice, (A∨B)

  • Simplification

If AB is true, then B or A will also be true. It is denoted as:

ABA or ABB

Example:-

Statement: I will make a coffee and I will read a book.
Conclusion: Therefore, I will read a book.

  • Resolution

According to this, if AB and ¬AC is true, then BC will also be true. Is is denoted as:- 

AB,¬ACBC

Example:-

Statement-1: It is raining or I will make tea.
Statement-2: It is not raining, or I will read a book.
Conclusion: Therefore, I will make tea, or I will read a book.

Context and Applications

This is an important topic in the professional test and for a variety of courses, particularly for-

  • Master of Science in AI
  • Master of Science in data science
  • Graduation in Critical Reasoning
  • Statistical inference
  • Proposition and supposition in inference
  • Inference and syllogism

Practice Problems

Q1. The rule of Universal Instantiation states that any sentence can be inferred by substituting a ground terminal for the variable.

  1. True
  2. False
  3. Partially true
  4. None

Correct Answer: 1

Explanation:- In UI, any sentence can be inferred by substituting a ground terminal for the variable.

Q2. Which of the following is a valid inference rule which is used in inference in AI?

  1. Division
  2. Multiplication
  3. Addition
  4. None

Correct Answer: 3.

Explanation:- Addition is one of the valid rules of inference. Apart from this, other inference rules are modus tollens, modus ponens, Simplification, etc.

Q3. Which one is not a component of FOL?

  1. Constant
  2. Quantifiers
  3. Terms
  4. Unification

Correct Answer: 4. Unification

Explanation- Unification is the way of detecting a substitute that makes two separate logical atomic expressions identical.

Q4. A primary type of Inferences is:

  1. Modus Ponens (Implication)
  2. Modus Tollens (Inverse)
  3. All
  4. Hypothetical Syllogism

Correct Answer: All

Explanation:- Modus ponens, Modus tollens, and Hypothetical Syllogism are all primary types of inferences in AI.

Q5- Which of the following is not an inference style?

  1. Resolution
  2. Forward Chaining
  3. Backward Chaining
  4. Modus Ponens

Correct Answer- Modus Ponens

Explanation- Modus ponens is one of the rules of inference and not an inference style.

Want more help with your computer science homework?

We've got you covered with step-by-step solutions to millions of textbook problems, subject matter experts on standby 24/7 when you're stumped, and more.
Check out a sample computer science Q&A solution here!

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.

Search. Solve. Succeed!

Study smarter access to millions of step-by step textbook solutions, our Q&A library, and AI powered Math Solver. Plus, you get 30 questions to ask an expert each month.

Tagged in
EngineeringComputer Science

Artificial Intelligence

First order Logics

Inference

Search. Solve. Succeed!

Study smarter access to millions of step-by step textbook solutions, our Q&A library, and AI powered Math Solver. Plus, you get 30 questions to ask an expert each month.

Tagged in
EngineeringComputer Science

Artificial Intelligence

First order Logics

Inference