0% found this document useful (0 votes)
20 views24 pages

Unit 2 1

Uploaded by

rachit14aswal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views24 pages

Unit 2 1

Uploaded by

rachit14aswal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 24

Propositional logic in Artificial

intelligence
An agent learns to make decisions by interacting with its surroundings in
a type of machine learning known as reinforcement learning. By getting
feedback for its activities in the form of incentives or penalties, the agent
learns. Robotics, video games, and self-driving cars are just a few
examples of the many applications for reinforcement learning. We will
thoroughly examine the theories and methods underlying reinforcement
learning in this article.

Propositional Logic based Agent: A Comprehensive Overview

Throughout the last few decades, the field of artificial intelligence (AI)
has experienced significant advancement. Scientists and researchers are
developing a variety of AI models to mimic human intelligence as a result
of advances in technology and computer science. The agent based on
propositional logic is one of the foundational AI techniques. This article
will examine the definition, operation, and numerous uses of a
propositional logic-based agent.

What is Propositional Logic?

A subset of mathematical logic known as propositional logic deals with


propositions, which are statements that can either be true or wrong.
Sentential logic or statement logic are other names for it. The symbols P,
Q, R, and other symbols are used in propositional logic to express
propositions. Compound propositions, which are composed of one or
more separate propositions, are created using these symbols. Moreover,
to link propositions, propositional logic makes use of logical connectives
like "and," "or," "not," "implies," and "if and only if."

Propositional logic (PL) is the simplest form of logic where all the statements are
made by propositions. A proposition is a declarative statement which is either
true or false. It is a technique of knowledge representation in logical and
mathematical form.

Example:
a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
d) 5 is a prime number.
1. Propositional logic is also called Boolean logic as it works on 0 and 1.
2. In propositional logic, we use symbolic variables to represent the logic, and
we can use any symbol for a representing a proposition, such A, B, C, P, Q,
R, etc.
3. Propositions can be either true or false, but it cannot be both.
4. Propositional logic consists of an object, relations or function, and logical
connectives.
5. These connectives are also called logical operators.
6. The propositions and connectives are the basic elements of the
propositional logic.
7. Connectives can be said as a logical operator which connects two
sentences.
8. A proposition formula which is always true is called tautology, and it is
also called a valid sentence.
9. A proposition formula which is always false is called Contradiction.
10.Statements which are questions, commands, or opinions are not
propositions such as "Where is Rohini", "How are you", "What is your
name", are not propositions.

What is a Propositional Logic-based Agent?

An AI agent that utilises propositional logic to express its knowledge and


make decisions is known as a propositional logic-based agent. A
straightforward form of agent, it decides what to do depending on what it
knows about the outside world. A knowledge base, which is made up of a
collection of logical phrases or sentences, serves as a representation of
the propositional logic-based agent's knowledge.

The agent's knowledge is empty, however as it observes the outside


world, it fills it with fresh data. To decide what actions to do in response
to the environment, the agent uses its knowledge base. Depending on the
logical inference it makes on its knowledge base, the agent takes
judgements.

How does a Propositional Logic-based Agent work?

A propositional logic-based agent functions by expressing its


understanding of the outside world as logical statements. The knowledge
base is initially empty, but as the agent explores the environment, it fills
it with fresh data. The agent draws new knowledge from its knowledge
base through logical inference. Deductive or inductive reasoning can be
used to draw a conclusion.

Deductive inference is the process of inferring new information using


logical principles from already known information. The process of
generalizing from specific data to arrive at a broader conclusion is known
as inductive inference. Based on the objectives it seeks to attain, the
agent decides what course of action to take.

Perception, reasoning, and action are the three stages of the agent's
decision-making process. Observing the surroundings and updating the
information base are steps in the perception process. In order to
generate new information, the reasoning stage requires using logical
inference to the knowledge base. The action phase entails choosing an
action based on the information that was gathered and the agent's
objectives.

Applications of Propositional Logic-based Agents

In the field of AI, propositional logic-based agents have several uses.


Expert system applications are one of the most popular uses. Expert
systems are artificial intelligence programs created to address difficulties
in a particular field. They represent their subject knowledge in a
knowledge base, and they draw new information from the knowledge
base using a reasoning engine.

In the area of natural language processing, propositional logic-based


agents are also used (NLP). The area of AI known as NLP deals with how
computers and human languages interact. The meaning of natural
language phrases can be represented by and new information can be
derived from them using propositional logic-based agents.

Knowledge Representation

Propositional logic-based agents' core feature is knowledge


representation. A collection of logical clauses that represent the agent's
knowledge of the outside world make up the knowledge base of the
agent. Depending on how much knowledge the agent has about the
outside world, the knowledge base may be either complete or lacking.
The agent's capacity to make informed decisions is impacted by the
knowledge base's completeness.

The fact that propositional logic offers a straightforward and


understandable method of conveying knowledge is one of its benefits.
Propositional logic uses simple to comprehend logical symbols and logical
connectives to depict relationships between propositions.

Logical Inference

The technique of inferring new knowledge from knowledge already known


is known as logical inference. Propositional logic-based agents should
have logical inference because it enables the agent to reason regarding
the external world and gather new knowledge that can be applied to
decision-making. Deductive inference as well as inductive inference are
the two different categories of logical inference.

By using logical principles, deductive inference is the act of obtaining new


knowledge based on previously data obtained. It is predicated on the idea
that if an argument's premises are true, then it follows that the
argument's conclusion must also be true. Propositional logic-based agents
draw new knowledge from the body of knowledge through deductive
inference.

Decision Making

A crucial function of propositional logic-based agents is decision-making.


The agent bases its decisions on knowledge of the outside world and its
desired outcomes. Three steps make up the decision-making process:
perception, justification, and execution.

Observing the environment and updating the agent's knowledge base is


the process of perception. Using logical inference to extract new
information from the knowledge base is the process of reasoning. Action
is the process of choosing a course of action based on the knowledge that
has been obtained and the agent's goals.

Making judgements in a transparent and understandable manner is one


of the advantages of employing propositional logic-based agents for
decision making. It is simpler to trust the agent's conclusions since the
logical rules it uses to decide are simple enough for humans to
understand.

Limitations

Although agents based on propositional logic offer numerous benefits,


they also have certain drawbacks. One of the drawbacks is that they lack
expressiveness and are unable to depict intricate interactions between
propositions. They are unable to depict, for instance, causal or temporal
links between assertions.

Another drawback is that propositional logic-based agents are unable to


deal with uncertainty or inadequate data. As a result, they are unable to
handle circumstances in which there is a lack of information or
uncertainty regarding the environment.

Fuzzy logic, Bayesian networks, and neural networks, among other forms
of AI models, have been developed to get around these restrictions.
These models offer a more powerful and expressive means of describing
knowledge and making judgements.
Conclusion

In conclusion, Propositional rationale-based specialists give a primary


simulated intelligence strategy to data portrayal and direction. They can
be used in a variety of ways and can be combined with other AI models
to make better systems. They are useful in industries that require trust
and transparency, despite their limitations. Propositional logic-based
agents will continue to be crucial to the development of intelligent
systems as AI research advances. Where information can be expressed as
propositions and decision-making follows logical principles, their
effectiveness shines especially brightly.

Syntax of propositional logic:

The syntax of propositional logic defines the allowable sentences for the
knowledge representation. There are two types of Propositions:

a. Atomic Propositions
b. Compound propositions

o Atomic Proposition: Atomic propositions are the simple propositions. It


consists of a single proposition symbol. These are the sentences which
must be either true or false.

Example:

1. a) 2+2 is 4, it is an atomic proposition as it is a true fact.


2. b) "The Sun is cold" is also a proposition as it is a false fact.
o Compound proposition: Compound propositions are constructed by
combining simpler or atomic propositions, using parenthesis and logical
connectives.

Example:

1. a) "It is raining today, and street is wet."


2. b) "Ankit is a doctor, and his clinic is in Mumbai."

Logical Connectives:
Logical connectives are used to connect two simpler propositions or representing
a sentence logically. We can create compound propositions with the help of
logical connectives. There are mainly five connectives, which are given as follows:
1. Negation: A sentence such as ¬ P is called negation of P. A literal can be
either Positive literal or negative literal.
2. Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a
conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.
3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called
disjunction, where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
4. Implication: A sentence such as P → Q, is called an implication.
Implications are also known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
5. Biconditional: A sentence such as P⇔ Q is a Biconditional sentence,
example If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.

Following is the summarized table for Propositional


Logic Connectives:

Truth Table:
In propositional logic, we need to know the truth values of propositions in all
possible scenarios. We can combine all the possible combination with logical
connectives, and the representation of these combinations in a tabular format is
called Truth table. Following are the truth table for all logical connectives:
Truth table with three propositions:

We can build a proposition composing three propositions P, Q, and R. This truth


table is made-up of 8n Tuples as we have taken three proposition symbols.
Precedence of connectives:
Just like arithmetic operators, there is a precedence order for propositional connectors or logical
operators. This order should be followed while evaluating a propositional problem. Following is
the list of the precedence order for operators:

Precedence Operators

First Precedence Parenthesis

Second Precedence Negation

Third Precedence Conjunction(AND)

Fourth Precedence Disjunction(OR)

Fifth Precedence Implication

Six Precedence Biconditional

Limitations of Propositional logic:


o We cannot represent relations like ALL, some, or none with propositional
logic. Example:

a. All the girls are intelligent.


b. Some apples are sweet.
o Propositional logic has limited expressive power.
o In propositional logic, we cannot describe statements in terms of their
properties or logical relationships.
Rules of Inference in Artificial
intelligence
Inference:
In artificial intelligence, we need intelligent computers which can create new logic
from old logic or by evidence, so generating the conclusions from evidence
and facts is termed as Inference.

Inference rules:
Inference rules are the templates for generating valid arguments.

Inference rules are applied to derive proofs in artificial intelligence, and the proof
is a sequence of the conclusion that leads to the desired goal.

In inference rules, the implication among all the connectives plays an important
role.

Following are some terminologies related to inference rules:

o Implication: It is one of the logical connectives which can be represented


as P → Q. It is a Boolean expression.
o Inverse: The negation of implication is called inverse. It can be represented
as ¬ P → ¬ Q.
o Converse: The converse of implication, which means the right-hand side
proposition goes to the left-hand side and vice-versa. It can be written as
Q → P.
o Contrapositive: The negation of converse is termed as contrapositive, and
it can be represented as ¬ Q → ¬ P.

From the above term some of the compound statements are equivalent to each
other, which we can prove using truth table:
Hence from the above truth table, we can prove that P → Q is equivalent to ¬ Q
→ ¬ P, and Q→ P is equivalent to ¬ P → ¬ Q.

Types of Inference rules:


1. Modus Ponens:

The Modus Ponens rule is one of the most important rules of inference, and it
states that if P and P → Q is true, then we can infer that Q will be true. It can be
represented as:

Example:

Statement-1: "If I am sleepy then I go to bed" ==> P→ Q


Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.

Proof by Truth table:

2. Modus Tollens:

The Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then ¬ P will
also true. It can be represented as:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P

Proof by Truth table:

3. Hypothetical Syllogism:

The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is true,
and Q→R is true. It can be represented as the following notation:

Example:

Statement-1: If you have my home key then you can unlock my home. P→Q
Statement-2: If you can unlock my home then you can take my money. Q→R
Conclusion: If you have my home key then you can take my money. P→R

Proof by truth table:

4. Disjunctive Syllogism:

The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true, then Q will
be true. It can be represented as:

Example:
Statement-1: Today is Sunday or Monday. ==>P∨Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q

Proof by truth-table:

5. Addition:

The Addition rule is one the common inference rule, and it states that If P is true,
then P∨Q will be true.

Example:

Statement: I have a vanilla ice-cream. ==> P


Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)

Proof by Truth-Table:

6. Simplification:

The simplification rule state that if P∧ Q is true, then Q or P will also be true. It
can be represented as:
Proof by Truth-Table:

7. Resolution:

The Resolution rule state that if P∨Q and ¬ P∧R is true, then Q∨R will also be
true. It can be represented as

Proof by Truth-Table:
First-Order Logic in Artificial
intelligence
In the topic of Propositional logic, we have seen that how to represent
statements using propositional logic.

But unfortunately, in propositional logic, we can only represent the facts, which
are either true or false.

PL is not sufficient to represent the complex sentences or natural language


statements.

The propositional logic has very limited expressive power. Consider the following
sentence, which we cannot represent using PL logic.

o "Some humans are intelligent", or


o "Sachin likes cricket."

To represent the above statements, PL logic is not sufficient, so we required some


more powerful logic, such as first-order logic.

First-Order logic:
o First-order logic is another way of knowledge representation in artificial
intelligence. It is an extension to propositional logic.
o FOL is sufficiently expressive to represent the natural language
statements in a concise way.
o First-order logic is also known as Predicate logic or First-order predicate
logic.
o First-order logic is a powerful language that develops information about
the objects in a more easy way and can also express the relationship
between those objects.
o First-order logic (like natural language) does not only assume that the
world contains facts like propositional logic but also assumes the following
things in the world:
o Objects: A, B, people, numbers, colors, wars, theories, squares, pits,
wumpus, ......
o Relations: It can be unary relation such as: red, round, is
adjacent, or n-any relation such as: the sister of, brother of, has
color, comes between
o Function: Father of, best friend, third inning of, end of, ......
o As a natural language, first-order logic also has two main parts:

a. Syntax
b. Semantics

Syntax of First-Order logic:


The syntax of FOL determines which collection of symbols is a logical expression
in first-order logic.

The basic syntactic elements of first-order logic are symbols.

We write statements in short-hand notation in FOL.

Basic Elements of First-order logic:

Following are the basic elements of FOL syntax:

Constant 1, 2, A, John, Mumbai, cat,....

Variables x, y, z, a, b,....

Predicates Brother, Father, >,....

Function sqrt, LeftLegOf, ....

Connectives ∧, ∨, ¬, ⇒, ⇔

Equality ==

Quantifier ∀, ∃

First-order logic statements can be divided into two parts:

o Subject: Subject is the main part of the statement.


o Predicate: A predicate can be defined as a relation, which binds two atoms
together in a statement.

Consider the statement: "x is an integer.", it consists of two parts, the first part
x is the subject of the statement and second part "is an integer," is known as a
predicate.

Atomic sentences:
o Atomic sentences are the most basic sentences of first-order logic. These
sentences are formed from a predicate symbol followed by a parenthesis
with a sequence of terms.
o We can represent atomic sentences as Predicate (term1, term2, ......,
term n).

Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).


Chinky is a cat: => cat (Chinky).

Complex Sentences:
o Complex sentences are made by combining atomic sentences using
connectives.

Quantifiers in First-order logic:


o A quantifier is a language element which generates quantification, and
quantification specifies the quantity of specimen in the universe of
discourse.
o These are the symbols that permit to determine or identify the range and
scope of the variable in the logical expression. There are two types of
quantifier:

a. Universal Quantifier, (for all, everyone, everything)


b. Existential quantifier, (for some, at least one).
Universal Quantifier:

Universal quantifier is a symbol of logical representation, which specifies that the


statement within its range is true for everything or every instance of a particular
thing.

The Universal quantifier is represented by a symbol ∀, which resembles an


inverted A.

Note: In universal quantifier we use implication "→".

If x is a variable, then ∀x is read as:

o For all x
o For each x
o For every x.

Example:

All man drink coffee.

Let a variable x which refers to a cat so all x can be represented in UOD as below:

∀x man(x) → drink (x, coffee).

It will be read as: There are all x where x is a man who drink coffee.
Existential Quantifier:
Existential quantifiers are the type of quantifiers, which express that the
statement within its scope is true for at least one instance of something.

It is denoted by the logical operator ∃, which resembles as inverted E. When it is


used with a predicate variable then it is called as an existential quantifier.

Note: In Existential quantifier we always use AND or Conjunction symbol (∧).

If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:

o There exists a 'x.'


o For some 'x.'
o For at least one 'x.'

Example:

Some boys are intelligent.

∃x: boys(x) ∧ intelligent(x)

It will be read as: There are some x where x is a boy who is intelligent.

ADVERTISEMENT

ADVERTISEMENT
Points to remember:
o The main connective for universal quantifier ∀ is implication →.
o The main connective for existential quantifier ∃ is and ∧.

Properties of Quantifiers:
o In universal quantifier, ∀x∀y is similar to ∀y∀x.
o In Existential quantifier, ∃x∃y is similar to ∃y∃x.
o ∃x∀y is not similar to ∀y∃x.

Some Examples of FOL using quantifier:

1. All birds fly.


In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as follows.
∀x bird(x) →fly(x).

2. Every man respects his parent.


In this question, the predicate is "respect(x, y)," where x=man, and y= parent.
Since there is every man so will use ∀, and it will be represented as follows:
∀x man(x) → respects (x, parent).

3. Some boys play cricket.


In this question, the predicate is "play(x, y)," where x= boys, and y= game. Since
there are some boys so we will use ∃, and it will be represented as:
∃x boys(x) → play(x, cricket).

4. Not all students like both Mathematics and Science.


In this question, the predicate is "like(x, y)," where x= student, and y= subject.
Since there are not all students, so we will use ∀ with negation, so following
representation for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].

5. Only one student failed in Mathematics.


In this question, the predicate is "failed(x, y)," where x= student, and y=
subject.
Since there is only one student who failed in Mathematics, so we will use
following representation for this:
∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧
student(y) → ¬failed (x, Mathematics)].
Free and Bound Variables:
The quantifiers interact with variables which appear in a suitable way. There are
two types of variables in First-order logic which are given below:

Free Variable: A variable is said to be a free variable in a formula if it occurs


outside the scope of the quantifier.

Example: ∀x ∃(y)[P (x, y, z)], where z is a free variable.

Bound Variable: A variable is said to be a bound variable in a formula if it occurs


within the scope of the quantifier.

Example: ∀x [A (x) B( y)], here x and y are the bound variables.

Forward Chaining and backward


chaining in AI
In artificial intelligence, forward and backward chaining is one of the important topics, but
before understanding forward and backward chaining lets first understand that from where these
two terms came.

Inference engine:
The inference engine is the component of the intelligent system in artificial intelligence, which
applies logical rules to the knowledge base to infer new information from known facts. The first
inference engine was part of the expert system. Inference engine commonly proceeds in two
modes, which are:

a. Forward chaining
b. Backward chaining

Horn Clause and Definite clause:

Horn clause and definite clause are the forms of sentences, which enables knowledge base to use
a more restricted and efficient inference algorithm. Logical inference algorithms use forward and
backward chaining approaches, which require KB in the form of the first-order definite
clause.

Definite clause: A clause which is a disjunction of literals with exactly one positive
literal is known as a definite clause or strict horn clause.

Horn clause: A clause which is a disjunction of literals with at most one positive
literal is known as horn clause. Hence all the definite clauses are horn clauses.

Example: (¬ p V ¬ q V k). It has only one positive literal k.


It is equivalent to p ∧ q → k.

A. Forward Chaining
Forward chaining is also known as a forward deduction or forward reasoning method
when using an inference engine. Forward chaining is a form of reasoning which start
with atomic sentences in the knowledge base and applies inference rules (Modus
Ponens) in the forward direction to extract more data until a goal is reached.

The Forward-chaining algorithm starts from known facts, triggers all rules whose
premises are satisfied, and add their conclusion to the known facts. This process repeats
until the problem is solved.

Properties of Forward-Chaining:

o It is a down-up approach, as it moves from bottom to top.


o It is a process of making a conclusion based on known facts or data, by starting
from the initial state and reaches the goal state.
o Forward-chaining approach is also called as data-driven as we reach to the goal
using available data.
o Forward -chaining approach is commonly used in the expert system, such as
CLIPS, business, and production rule systems.

B. Backward Chaining:
Backward-chaining is also known as a backward deduction or backward reasoning
method when using an inference engine. A backward chaining algorithm is a form of
reasoning, which starts with the goal and works backward, chaining through rules to
find known facts that support the goal.

Properties of backward chaining:

o It is known as a top-down approach.


o Backward-chaining is based on modus ponens inference rule.
o In backward chaining, the goal is broken into sub-goal or sub-goals to prove the facts
true.
o It is called a goal-driven approach, as a list of goals decides which rules are selected and
used.
o Backward -chaining algorithm is used in game theory, automated theorem proving tools,
inference engines, proof assistants, and various AI applications.
o The backward-chaining method mostly used a depth-first search strategy for proof.
Unification in AI (Artificial
Intelligence)
Unification is a fundamental process that involves finding a common solution
or "unified" form for expressions containing variables.

It is the process of making different expressions or terms identical by


assigning values to variables in a way that allows them to match or unify.

Unification plays a crucial role in knowledge representation, logic


programming, and natural language processing, as it enables AI systems to
reason, infer, and handle uncertainty by reconciling disparate pieces of
information.

Unification in the Context of Logic and Predicate Logic:

Unification in logic, particularly in predicate logic, is the process of finding a


common substitution for variables in logical expressions, making the
expressions equivalent. In predicate logic, expressions are often composed of
predicates, constants, variables, and logical operators.

The Role of Unification in AI:

1. Natural Language Processing (NLP): Unification is used in NLP for


various tasks, such as parsing and semantic analysis. In parsing, unification
helps identify the relationships between words in a sentence, allowing the
system to build syntactic and semantic structures.

For example, unification can help determine that "he" refers to a specific
person or entity mentioned earlier in a text.

2. Logic Programming: Unification is a cornerstone of logic programming


languages like Prolog. In logic programming, unification is used to match
query predicates with database predicates. It enables the system to find
solutions to logical queries by unifying the query with known facts and rules.
For example, in a Prolog program, unification helps establish whether a given
set of conditions satisfies a rule, thus making it a fundamental mechanism for
rule-based reasoning.
3. Symbolic Reasoning: In symbolic reasoning and theorem proving,
unification is employed to determine whether two logical expressions are
equivalent or if one can be transformed into the other by substituting values
for variables. This is crucial for verifying the validity of logical statements and
making logical inferences. Unification is an essential component of resolution-
based theorem proving methods.

4. Semantic Web and Knowledge Representation: Unification plays a


significant role in the Semantic Web, where it helps link and integrate diverse
pieces of data from various sources. It facilitates knowledge representation by
unifying different data representations, making them compatible and
interoperable.

5. Expert Systems: Unification is used in expert systems to match user


queries with the knowledge stored in the system's database. It helps
determine which rules or pieces of information are relevant to a specific
problem or query, facilitating the expert system's decision-making process.

In essence, unification enables AI systems to reconcile, integrate, and reason


about information, making it a fundamental process for knowledge
representation and reasoning. Its applications extend to various AI domains,
allowing systems to perform tasks that involve matching, resolution, and
inference.

Unification in AI Examples of How Unification Works in Logic:

Consider a simple example of unification in predicate logic:

Given two expressions:

1. P(x, a, b)

2. P(y, z, b)

We want to find a substitution that unifies these expressions.

1. Start by matching the predicates. In this case, P is the same in both expressions.

2. Now, compare the arguments:

 x matches with y (x/y substitution).


 a matches with z (a/z substitution).

 b matches with b (no substitution needed).

The unification substitution for these expressions is:

 x/y
 a/z

Applying these substitutions to the original expressions, we obtain:


1. P(y, a, b)

2. P(y, z, b)

The expressions are now unified, and both are equivalent.

Unification is a fundamental process in logic and AI, allowing us to find common ground
between logical expressions and resolve logical problems efficiently. It is a key component
in automated reasoning, logic programming, and knowledge representation.

Resolution in FOL
Resolution
Resolution is a theorem proving technique that proceeds by building refutation proofs,
i.e., proofs by contradictions. It was invented by a Mathematician John Alan Robinson in
the year 1965.

Resolution is used, if there are various statements are given, and we need to prove a
conclusion of those statements. Unification is a key concept in proofs by resolutions.
Resolution is a single inference rule which can efficiently operate on the conjunctive
normal form or clausal form.

Clause: Disjunction of literals (an atomic sentence) is called a clause. It is also known as
a unit clause.

Conjunctive Normal Form: A sentence represented as a conjunction of clauses is said


to be conjunctive normal form or CNF.

Steps for Resolution:


1. Conversion of facts into first-order logic.
2. Convert FOL statements into CNF(Conjunctive normal form is an approach to Boolean
logic that expresses formulas as conjunctions of clauses with an AND or OR).
3. Negate the statement which needs to prove (proof by contradiction)
4. Draw resolution graph (unification).

You might also like