0% found this document useful (0 votes)
24 views57 pages

AI Unit 3 notes

First-Order Logic (FOL) is an extension of propositional logic that allows for the representation of complex statements and relationships in artificial intelligence. It includes components such as syntax, semantics, quantifiers, and inference rules, enabling detailed knowledge representation and reasoning. FOL can express statements about objects, relations, and functions, making it a powerful tool for formalizing natural language statements.

Uploaded by

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

AI Unit 3 notes

First-Order Logic (FOL) is an extension of propositional logic that allows for the representation of complex statements and relationships in artificial intelligence. It includes components such as syntax, semantics, quantifiers, and inference rules, enabling detailed knowledge representation and reasoning. FOL can express statements about objects, relations, and functions, making it a powerful tool for formalizing natural language statements.

Uploaded by

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

First Order Logic

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. 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 ∀, ∃

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.

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.
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.

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)].

Syntax and Semantics for FOL


Observe first that logic is not the study of truth, but of the relationship between the truth of one statement and
that of another. That is, in logic, we do not care whether a statement like “If angels exist then necessarily all of
them fit on the head of a needle” (suitably formalized) is indeed true in reality1, but if the if-part were true
(resp., false), then what does that say about the truth value of the then-part of the statement? And likewise for a
whole bunch of such sentences. Others do care what is represented formally with such a logic language, but we
will defer that to Block II.
To be able to study those aspects of logic, we need a language that is unambiguous; natural language is not.
You may have encountered propositional logic already, and first order predicate logic (FOL) is an extension of
that, which enables us to represent more knowledge in more detail. Here, I will give only a brief glimpse of it.
Eventually, you will need to be able to recognize, understand, and be able to formalize at least a little bit in
FOL. Of all the definitions that will follow shortly, there are four important ideas to grasp: the syntax of a
language, the model-theoretic semantics of a language, what a theory means in the context of logic, and the
notion of deduction where we apply some rules to what has been represented explicitly so as to derive
knowledge that was represented only implicitly. We will address each in turn.

First, there are two principal components to consider for the language:

Definition 3.1.1: Syntax

Syntax has to do with what ‘things’ (symbols, notations) one is allowed to use in the language and in what way;
there is/are a(n):

 Alphabet
 Language constructs
 Sentences to assert knowledge

Definition 3.1.2: Semantics

Semantics: Formal meaning, which has to do what those sentences with the alphabet and constructs are
supposed to mean.

Their details are presented in the remainder of this section.

Syntax
The lexicon of a first order language contains the following:

 Connectives and Parentheses: ¬¬, →→, ↔↔, ∧∧, ∨∨, ( and );


 Quantifiers: ∀∀ (universal) and ∃∃ (existential);
 Variables: x,y,z,... ranging over particulars (individual objects);
 Constants: a,b,c,... representing a specific element;
 Functions: f,g,h,... with arguments listed as f(x1,...xn);
 Relations: R,S,.... with an associated arity.

There is an (countably infinite) supply of symbols (signature): variables, functions, constants, and relations.

In other words: we can use these things to create ‘sentences’, like we have in natural language, but then
controlled and with a few extra figurines. Let us look first at how we can formalise a natural language sentence
into first order logic.

Example 3.1:

From Natural Language to First order logic (or vv.). Consider the following three sentences:

– “Each animal is an organism”

– “All animals are organisms”

– “If it is an animal then it is an organism”


This can be formalised as:

∀x(Animal(x)→Organism(x))

Observe the colour coding in the natural language sentences: ‘each’ and ‘all’ are different ways to say “ ∀∀”
and the ‘is a’ and ‘are’ in the first two sentences match the “→→”, and the combination of the “∀∀” and
“→→” in this particular construction can be put into natural language as ‘if ... then’.

Instead of talking about all objects of a particular type, one also can assert there are at least some of them; e.g.,

– “Aliens exist”

could be formalised as

∃xAlien(x)

with the ‘exist’ matching the ∃, and

– “There are books that are heavy”

(well, at least one of them is) as:

∃x(Book(x)∧heavy(x))

where the ‘there are’ is another way to talk about “∃∃” and the ‘that’ hides (linguistically) the “∧∧”. A
formulation like “There is at least one book, and it is heavy” is a natural language rendering that is closer to the
structure of the axiom.

A sentence—or, more precisely, its precise meaning—such as “Each student must be registered for a degree
programme” requires a bit more consideration. There are at least two ways to say the same thing in the way the
sentence is formulated (we leave the arguments for and against each option for another time):

1. ∀x,y(registeredfor(x,y)→Student(x)∧DegreeProgramme(y))

“if there is a registered for relation, then the first object is a student and the second one a degree
programme”

∀x(Student(x)→∃yregisteredfor(x,y))

“Each student is registered for at least one y”, where the y is a degree programme (taken from the first
axiom)

2. ∀x(Student(x)→∃y(registeredfor(x,y)∧DegreeProgramme(y)))

“’Each student is registered for at least one degree programme’

But all this is still just syntax (it does not say what it really means), and it looks like a ‘free for all’ on how we
can use these symbols. This is, in fact, not the case, and the remainder of the definitions will make this more
precise, which will be illustrated in Example 2.1.2 afterward.

There is a systematic to the axioms in the examples, with the brackets, arrows, etc. Let us put this more
precisely now. We start from the basic elements and gradually build it up to more complex things.
Inference in First Order Logic

Inference in First-Order Logic


Inference in First-Order Logic is used to deduce new facts or sentences from existing sentences. Before
understanding the FOL inference rule, let's understand some basic terminologies used in FOL.
Substitution:

Substitution is a fundamental operation performed on terms and formulas. It occurs in all inference
systems in first-order logic. The substitution is complex in the presence of quantifiers in FOL. If we
write F[a/x], so it refers to substitute a constant "a" in place of variable "x".

Note: First-order logic is capable of expressing facts about some or all objects in the universe.

Equality:

First-Order logic does not only use predicate and terms for making atomic sentences but also uses
another way, which is equality in FOL. For this, we can use equality symbols which specify that the two
terms refer to the same object.

Example: Brother (John) = Smith.

As in the above example, the object referred by the Brother (John) is similar to the object referred
by Smith. The equality symbol can also be used with negation to represent that two terms are not the
same objects.

Example: ¬(x=y) which is equivalent to x ≠y.

FOL inference rules for quantifier:


As propositional logic we also have inference rules in first-order logic, so following are some basic
inference rules in FOL:

o Universal Generalization
o Universal Instantiation
o Existential Instantiation
o Existential introduction

1. Universal Generalization:

o Universal generalization is a valid inference rule which states that if premise P(c) is true for any arbitrary
element c in the universe of discourse, then we can have a conclusion as ∀ x P(x).

o It can be represented as: .


o This rule can be used if we want to show that every element has a similar property.
o In this rule, x must not appear as a free variable.

Example: Let's represent, P(c): "A byte contains 8 bits", so for ∀ x P(x) "All bytes contain 8 bits.", it
will also be true.

2. Universal Instantiation:
o Universal instantiation is also called as universal elimination or UI is a valid inference rule. It can be applied
multiple times to add new sentences.
o The new KB is logically equivalent to the previous KB.
o As per UI, we can infer any sentence obtained by substituting a ground term for the variable.
o The UI rule state that we can infer any sentence P(c) by substituting a ground term c (a constant within
domain x) from ∀ x P(x) for any object in the universe of discourse.

o It can be represented as: .

Example:1.

IF "Every person like ice-cream"=> ∀x P(x) so we can infer that


"John likes ice-cream" => P(c)

Example: 2.

Let's take a famous example,

"All kings who are greedy are Evil." So let our knowledge base contains this detail as in the form of FOL:

∀x king(x) ∧ greedy (x) → Evil (x),

So from this information, we can infer any of the following statements using Universal Instantiation:

o King(John) ∧ Greedy (John) → Evil (John),


o King(Richard) ∧ Greedy (Richard) → Evil (Richard),
o King(Father(John)) ∧ Greedy (Father(John)) → Evil (Father(John)),

3. Existential Instantiation:

o Existential instantiation is also called as Existential Elimination, which is a valid inference rule in first-order
logic.
o It can be applied only once to replace the existential sentence.
o The new KB is not logically equivalent to old KB, but it will be satisfiable if old KB was satisfiable.
o This rule states that one can infer P(c) from the formula given in the form of ∃x P(x) for a new constant
symbol c.
o The restriction with this rule is that c used in the rule must be a new term for which P(c ) is true.

o It can be represented as:

Example:

From the given sentence: ∃x Crown(x) ∧ OnHead(x, John),

So we can infer: Crown(K) ∧ OnHead( K, John), as long as K does not appear in the knowledge base.
o The above used K is a constant symbol, which is called Skolem constant.
o The Existential instantiation is a special case of Skolemization process.

4. Existential introduction

o An existential introduction is also known as an existential generalization, which is a valid inference rule in
first-order logic.
o This rule states that if there is some element c in the universe of discourse which has a property P, then
we can infer that there exists something in the universe which has the property P.

o It can be represented as:


o Example: Let's say that,
"Priyanka got good marks in English."
"Therefore, someone got good marks in English."

Prepositional Versus First Order Logic


Logical reasoning forms the basis for a huge domain of computer science and mathematics. They
help in establishing mathematical arguments, valid or invalid.
1. Propositional Logic :
A proposition is basically a declarative sentence that has a truth value. Truth value can either be true
or false, but it needs to be assigned any of the two values and not be ambiguous. The purpose of
using propositional logic is to analyze a statement, individually or compositely.
For example :
The following statements :

1. If x is real, then x 2 > 0


2. What is your name?
3. (a+b)2 = 100
4. This statement is false.
5. This statement is true.
Are not propositions because they do not have a truth value. They are ambiguous.
But the following statements :

1. (a+b)2 = a2 + 2ab + b2
2. If x is real, then x 2 >= 0
3. If x is real, then x 2 < 0
4. The sun rises in the east.
5. The sun rises in the west.
Are all propositions because they have a specific truth value, true or false.
The branch of logic that deals with proposition is propositional logic.
2. Predicate Logic :
Predicates are properties, additional information to better express the subject of the sentence. A
quantified predicate is a proposition , that is, when you assign values to a predicate with variables it
can be made a proposition.
For example :
In P(x) : x>5, x is the subject or the variable and ‘>5’ is the predicate.
P(7) : 7>5 is a proposition where we are assigning values to the variable x, and it has a truth value,
i.e. True.
The set of values that the variables of the predicate can assume is called the Universe or Domain of
Discourse or Domain of Predicate.
Difference between Propositional Logic and Predicate Logic :

Propositional Logic Predicate Logic

Propositional logic is the logic that deals with Predicate logic is an expression consisting of
1 a collection of declarative statements which variables with a specified domain. It consists of
have a truth value, true or false. objects, relations and functions between the objects.

2 It is the basic and most widely used logic. Also It is an extension of propositional logic covering
known as Boolean logic. predicates and quantification.

3 A proposition has a specific truth value, either A predicate’s truth value depends on the variables’
true or false. value.

Predicate logic helps analyze the scope of the


subject over the predicate. There are three
4 Scope analysis is not done in propositional quantifiers : Universal Quantifier (∀) depicts for all,
logic. Existential Quantifier (∃) depicting there exists
some and Uniqueness Quantifier (∃!) depicting
exactly one.

Propositions are combined with Logical


Operators or Logical Connectives like
5 Predicate Logic adds by introducing quantifiers to
Negation(¬), Disjunction(∨), Conjunction(∧),
the existing proposition.
Exclusive OR(⊕), Implication(⇒), Bi-
Conditional or Double Implication(⇔).

6 It is a more generalized representation. It is a more specialized representation.

7 It can deal with set of entities with the help of


It cannot deal with sets of entities.
quantifiers.

Unification and Lifting


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)}

Let Ψ1 = King(x), Ψ2 = 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.

E.g. Let's say there are two different expressions, P(x, y), and P(a, f(z)).

In this example, we need to make both above statements identical to each other. For this, we will
perform the substitution. P(x, y)......... (i)
P(a, f(z))......... (ii)

o Substitute x with a, and y with f(z) in the first expression, and it will be represented as a/x and
f(z)/y.
o With both the substitutions, the first expression will be identical to the second expression and
the substitution set will be: [a/x, f(z)/y].

Conditions for Unification:


Following are some basic conditions for unification:

o Predicate symbol must be same, atoms or expression with different predicate symbol can never
be unified.
o Number of Arguments in both expressions must be identical.
o Unification will fail if there are two similar variables present in the same expression.

Unification Algorithm:
Algorithm: Unify(Ψ1, Ψ2)
Step. 1: If Ψ1 or Ψ2 is a variable or constant, then:
a) If Ψ1 or Ψ2 are identical, then return NIL.
b) Else if Ψ1is a variable,
a. then if Ψ1 occurs in Ψ2, then return FAILURE
b. Else return { (Ψ2/ Ψ1)}.
c) Else if Ψ2 is a variable,
a. If Ψ2 occurs in Ψ1 then return FAILURE,
b. Else return {( Ψ1/ Ψ2)}.
d) Else return FAILURE.
Step.2: If the initial Predicate symbol in Ψ1 and Ψ2 are not same, then return FAILURE.
Step. 3: IF Ψ1 and Ψ2 have a different number of arguments, then return FAILURE.
Step. 4: Set Substitution set(SUBST) to NIL.
Step. 5: For i=1 to the number of elements in Ψ1.
a) Call Unify function with the ith element of Ψ1 and ith element of Ψ2, and put the
result into S.
b) If S = failure then returns Failure
c) If S ≠ NIL then do,
a. Apply S to the remainder of both L1 and L2.
b. SUBST= APPEND(S, SUBST).
Step.6: Return SUBST.

Implementation of the Algorithm


Step.1: Initialize the substitution set to be empty.

Step.2: Recursively unify atomic sentences:

a. Check for Identical expression match.


b. If one expression is a variable vi, and the other is a term ti which does not contain variable vi,
then:
a. Substitute ti / vi in the existing substitutions
b. Add ti /vi to the substitution setlist.
c. If both the expressions are functions, then function name must be similar, and the number
of arguments must be the same in both the expression.

For each pair of the following atomic sentences find the most general unifier (If exist).

1. Find the MGU of {p(f(a), g(Y)) and p(X, X)}

Sol: S0 => Here, Ψ1 = p(f(a), g(Y)), and Ψ2 = p(X, X)


SUBST θ= {f(a) / X}
S1 => Ψ1 = p(f(a), g(Y)), and Ψ2 = p(f(a), f(a))
SUBST θ= {f(a) / g(y)}, Unification failed.

Unification is not possible for these expressions.

2. Find the MGU of {p(b, X, f(g(Z))) and p(Z, f(Y), f(Y))}


Here, Ψ1 = p(b, X, f(g(Z))) , and Ψ2 = p(Z, f(Y), f(Y))
S0 => { p(b, X, f(g(Z))); p(Z, f(Y), f(Y))}
SUBST θ={b/Z}

S1 => { p(b, X, f(g(b))); p(b, f(Y), f(Y))}


SUBST θ={f(Y) /X}

S2 => { p(b, f(Y), f(g(b))); p(b, f(Y), f(Y))}


SUBST θ= {g(b) /Y}

S2 => { p(b, f(g(b)), f(g(b)); p(b, f(g(b)), f(g(b))} Unified Successfully.


And Unifier = { b/Z, f(Y) /X , g(b) /Y}.

3. Find the MGU of {p (X, X), and p (Z, f(Z))}

Here, Ψ1 = {p (X, X), and Ψ2 = p (Z, f(Z))


S0 => {p (X, X), p (Z, f(Z))}
SUBST θ= {X/Z}
S1 => {p (Z, Z), p (Z, f(Z))}
SUBST θ= {f(Z) / Z}, Unification Failed.

Hence, unification is not possible for these expressions.

4. Find the MGU of UNIFY(prime (11), prime(y))

Here, Ψ1 = {prime(11) , and Ψ2 = prime(y)}


S0 => {prime(11) , prime(y)}
SUBST θ= {11/y}

S1 => {prime(11) , prime(11)} , Successfully unified.


Unifier: {11/y}.

5. Find the MGU of Q(a, g(x, a), f(y)), Q(a, g(f(b), a), x)}

Here, Ψ1 = Q(a, g(x, a), f(y)), and Ψ2 = Q(a, g(f(b), a), x)


S0 => {Q(a, g(x, a), f(y)); Q(a, g(f(b), a), x)}
SUBST θ= {f(b)/x}
S1 => {Q(a, g(f(b), a), f(y)); Q(a, g(f(b), a), f(b))}

SUBST θ= {b/y}
S1 => {Q(a, g(f(b), a), f(b)); Q(a, g(f(b), a), f(b))}, Successfully Unified.

Unifier: [a/a, f(b)/x, b/y].

6. UNIFY(knows(Richard, x), knows(Richard, John))

Here, Ψ1 = knows(Richard, x), and Ψ2 = knows(Richard, John)


S0 => { knows(Richard, x); knows(Richard, John)}
SUBST θ= {John/x}
S1 => { knows(Richard, John); knows(Richard, John)}, Successfully Unified.
Unifier: {John/x}.
Lifting in AI:
Lifting, in the context of artificial intelligence, refers to the process of elevating or generalizing an
operation or concept from a lower level to a higher level of abstraction. This concept is particularly
relevant in knowledge representation, planning, and reasoning systems where the goal is to create
models that are applicable to a broader set of entities or situations.

The primary motivation behind lifting is to achieve a level of abstraction that allows AI systems to
operate on a more generalized scale. It involves identifying commonalities among specific instances
and creating representations or rules that can be applied to a class of similar situations. This
abstraction facilitates the handling of complexity and variability within a domain.

Consider the example of lifting in the context of planning. Instead of creating specific plans for
individual scenarios, lifting involves developing more abstract plans that can be applied to a range of
situations. This enables the AI system to reason about actions and goals at a higher level, promoting
flexibility and adaptability.

In knowledge representation, lifting might involve generalizing relationships or properties to apply to


a broader set of entities. For instance, a rule specifying the color of specific objects, such as
HasColor(Apple, Red) and HasColor(Banana, Yellow) , can be lifted to a more general rule like HasColor(X,
Y) , making it applicable to any object in the domain.

Lifting is crucial for creating AI systems that can handle diverse and dynamic environments. It allows
for the development of more flexible and robust models, reducing the need for domain-specific
knowledge engineering and promoting the generalization of learned concepts.

In conclusion, lifting is a key concept in AI that involves the abstraction and generalization of
operations or concepts, enabling AI systems to operate at higher levels of generality and adaptability,
which is essential for handling the complexities of real-world scenarios.

Forward &Backward Chaining

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.

Consider the following famous example which we will use in both approaches:

Example:
"As per the law, it is a crime for an American to sell weapons to hostile nations. Country A, an
enemy of America, has some missiles, and all the missiles were sold to it by Robert, who is an
American citizen."

Prove that "Robert is criminal."

To solve the above problem, first, we will convert all the above facts into first-order definite clauses,
and then we will use a forward-chaining algorithm to reach the goal.

Facts Conversion into FOL:

o It is a crime for an American to sell weapons to hostile nations. (Let's say p, q, and r are
variables)
American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1)
o Country A has some missiles. ?p Owns(A, p) ∧ Missile(p). It can be written in two definite
clauses by using Existential Instantiation, introducing new Constant T1.
Owns(A, T1) ......(2)
Missile(T1) .......(3)
o All of the missiles were sold to country A by Robert.
?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4)
o Missiles are weapons.
Missile(p) → Weapons (p) .......(5)
o Enemy of America is known as hostile.
Enemy(p, America) →Hostile(p) ........(6)
o Country A is an enemy of America.
Enemy (A, America) .........(7)
o Robert is American
American(Robert). ..........(8)

Forward chaining proof:


Step-1:
In the first step we will start with the known facts and will choose the sentences which do not have
implications, such as: American(Robert), Enemy(A, America), Owns(A, T1), and Missile(T1). All
these facts will be represented as below.

Step-2:

At the second step, we will see those facts which infer from available facts and with satisfied premises.

Rule-(1) does not satisfy premises, so it will not be added in the first iteration.

Rule-(2) and (3) are already added.

Rule-(4) satisfy with the substitution {p/T1}, so Sells (Robert, T1, A) is added, which infers from the
conjunction of Rule (2) and (3).

Rule-(6) is satisfied with the substitution(p/A), so Hostile(A) is added and which infers from Rule-(7).

Step-3:

At step-3, as we can check Rule-(1) is satisfied with the substitution {p/Robert, q/T1, r/A}, so we can
add Criminal(Robert) which infers all the available facts. And hence we reached our goal statement.

Hence it is proved that Robert is Criminal using forward chaining approach.


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.

Example:
In backward-chaining, we will use the same above example, and will rewrite all the rules.

o American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1)


Owns(A, T1) ........(2)
o Missile(T1)
o ?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4)
o Missile(p) → Weapons (p) .......(5)
o Enemy(p, America) →Hostile(p) ........(6)
o Enemy (A, America) .........(7)
o American(Robert). ..........(8)

Backward-Chaining proof:
In Backward chaining, we will start with our goal predicate, which is Criminal(Robert), and then infer
further rules.

Step-1:

At the first step, we will take the goal fact. And from the goal fact, we will infer other facts, and at last,
we will prove those facts true. So our goal fact is "Robert is Criminal," so following is the predicate of
it.

Step-2:
At the second step, we will infer other facts form goal fact which satisfies the rules. So as we can see in
Rule-1, the goal predicate Criminal (Robert) is present with substitution {Robert/P}. So we will add all
the conjunctive facts below the first level and will replace p with Robert.

Here we can see American (Robert) is a fact, so it is proved here.

Step-3:t At step-3, we will extract further fact Missile(q) which infer from Weapon(q), as it satisfies Rule-
(5). Weapon (q) is also true with the substitution of a constant T1 at q.

Step-4:

At step-4, we can infer facts Missile(T1) and Owns(A, T1) form Sells(Robert, T1, r) which satisfies
the Rule- 4, with the substitution of A in place of r. So these two statements are proved here.
Step-5:

At step-5, we can infer the fact Enemy(A, America) from Hostile(A) which satisfies Rule- 6. And hence
all the statements are proved true using backward chaining.

Following is the difference between the forward chaining and backward chaining:

o Forward chaining as the name suggests, start from the known facts and move forward by
applying inference rules to extract more data, and it continues until it reaches to the goal,
whereas backward chaining starts from the goal, move backward by using inference rules to
determine the facts that satisfy the goal.
o Forward chaining is called a data-driven inference technique, whereas backward chaining is
called a goal-driven inference technique.
o Forward chaining is known as the down-up approach, whereas backward chaining is known as
a top-down approach.
o Forward chaining uses breadth-first search strategy, whereas backward chaining uses depth-
first search strategy.
o Forward and backward chaining both applies Modus ponens inference rule.
o Forward chaining can be used for tasks such as planning, design process monitoring,
diagnosis, and classification, whereas backward chaining can be used for classification and
diagnosis tasks.
o Forward chaining can be like an exhaustive search, whereas backward chaining tries to avoid the
unnecessary path of reasoning.
o In forward-chaining there can be various ASK questions from the knowledge base, whereas in
backward chaining there can be fewer ASK questions.
o Forward chaining is slow as it checks for all the rules, whereas backward chaining is fast as it
checks few required rules only.

S. Forward Chaining Backward Chaining


No.

1. Forward chaining starts from known facts Backward chaining starts from the goal and
and applies inference rule to extract more works backward through inference rules to find
data unit it reaches to the goal. the required facts that support the goal.

2. It is a bottom-up approach It is a top-down approach

3. Forward chaining is known as data-driven Backward chaining is known as goal-driven


inference technique as we reach to the goal technique as we start from the goal and divide
using the available data. into sub-goal to extract the facts.

4. Forward chaining reasoning applies a Backward chaining reasoning applies a depth-


breadth-first search strategy. first search strategy.

5. Forward chaining tests for all the available Backward chaining only tests for few required
rules rules.

6. Forward chaining is suitable for the planning, Backward chaining is suitable for diagnostic,
monitoring, control, and interpretation prescription, and debugging application.
application.

7. Forward chaining can generate an infinite Backward chaining generates a finite number of
number of possible conclusions. possible conclusions.
8. It operates in the forward direction. It operates in the backward direction.

9. Forward chaining is aimed for any Backward chaining is only aimed for the required
conclusion. data.

Resolution

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.

Note: To better understand this topic, firstly learns the FOL in AI.

The resolution inference rule:


The resolution rule for first-order logic is simply a lifted version of the propositional rule. Resolution
can resolve two clauses if they contain complementary literals, which are assumed to be standardized
apart so that they share no variables.

Where li and mj are complementary literals.

This rule is also called the binary resolution rule because it only resolves exactly two literals.

Example:
We can resolve two clauses which are given below:

[Animal (g(x) V Loves (f(x), x)] and [¬ Loves(a, b) V ¬Kills(a, b)]

Where two complimentary literals are: Loves (f(x), x) and ¬ Loves (a, b)

These literals can be unified with unifier θ= [a/f(x), and b/x] , and it will generate a resolvent clause:
[Animal (g(x) V ¬ Kills(f(x), x)].

Steps for Resolution:


1. Conversion of facts into first-order logic.
2. Convert FOL statements into CNF
3. Negate the statement which needs to prove (proof by contradiction)
4. Draw resolution graph (unification).

To better understand all the above steps, we will take an example in which we will apply resolution.

Example:

a. John likes all kind of food.


b. Apple and vegetable are food
c. Anything anyone eats and not killed is food.
d. Anil eats peanuts and still alive
e. Harry eats everything that Anil eats.
Prove by resolution that:
f. John likes peanuts.

Step-1: Conversion of Facts into FOL

In the first step we will convert all the given statements into its first order logic.

Step-2: Conversion of FOL into CNF

In First order logic resolution, it is required to convert the FOL into CNF as CNF form makes easier for
resolution proofs.

o Eliminate all implication (→) and rewrite


a. ∀x ¬ food(x) V likes(John, x)
b. food(Apple) Λ food(vegetables)
c. ∀x ∀y ¬ [eats(x, y) Λ ¬ killed(x)] V food(y)
d. eats (Anil, Peanuts) Λ alive(Anil)
e. ∀x ¬ eats(Anil, x) V eats(Harry, x)
f. ∀x¬ [¬ killed(x) ] V alive(x)
g. ∀x ¬ alive(x) V ¬ killed(x)
h. likes(John, Peanuts).
o Move negation (¬)inwards and rewrite
a. ∀x ¬ food(x) V likes(John, x)
b. food(Apple) Λ food(vegetables)
c. ∀x ∀y ¬ eats(x, y) V killed(x) V food(y)
d. eats (Anil, Peanuts) Λ alive(Anil)
e. ∀x ¬ eats(Anil, x) V eats(Harry, x)
f. ∀x ¬killed(x) ] V alive(x)
g. ∀x ¬ alive(x) V ¬ killed(x)
h. likes(John, Peanuts).
o Rename variables or standardize variables
a. ∀x ¬ food(x) V likes(John, x)
b. food(Apple) Λ food(vegetables)
c. ∀y ∀z ¬ eats(y, z) V killed(y) V food(z)
d. eats (Anil, Peanuts) Λ alive(Anil)
e. ∀w¬ eats(Anil, w) V eats(Harry, w)
f. ∀g ¬killed(g) ] V alive(g)
g. ∀k ¬ alive(k) V ¬ killed(k)
h. likes(John, Peanuts).
o Eliminate existential instantiation quantifier by elimination.
In this step, we will eliminate existential quantifier ∃, and this process is known as Skolemization. But in
this example problem since there is no existential quantifier so all the statements will remain same in
this step.
o Drop Universal quantifiers.
In this step we will drop all universal quantifier since all the statements are not implicitly quantified so
we don't need it.
a. ¬ food(x) V likes(John, x)
b. food(Apple)
c. food(vegetables)
d. ¬ eats(y, z) V killed(y) V food(z)
e. eats (Anil, Peanuts)
f. alive(Anil)
g. ¬ eats(Anil, w) V eats(Harry, w)
h. killed(g) V alive(g)
i. ¬ alive(k) V ¬ killed(k)
j. likes(John, Peanuts).

Note: Statements "food(Apple) Λ food(vegetables)" and "eats (Anil, Peanuts) Λ alive(Anil)" can be
written in two separate statements.
o Distribute conjunction ∧ over disjunction ¬.
This step will not make any change in this problem.

Step-3: Negate the statement to be proved

In this statement, we will apply negation to the conclusion statements, which will be written as
¬likes(John, Peanuts)

Step-4: Draw Resolution graph:

Now in this step, we will solve the problem by resolution tree using substitution. For the above problem,
it will be given as follows:

Hence the negation of the conclusion has been proved as a complete contradiction with the given set
of statements.

Explanation of Resolution graph:


o In the first step of resolution graph, ¬likes(John, Peanuts) , and likes(John, x) get resolved(canceled)
by substitution of {Peanuts/x}, and we are left with ¬ food(Peanuts)
o In the second step of the resolution graph, ¬ food(Peanuts) , and food(z) get resolved (canceled) by
substitution of { Peanuts/z}, and we are left with ¬ eats(y, Peanuts) V killed(y) .
o In the third step of the resolution graph, ¬ eats(y, Peanuts) and eats (Anil, Peanuts) get resolved by
substitution {Anil/y}, and we are left with Killed(Anil) .
o In the fourth step of the resolution graph, Killed(Anil) and ¬ killed(k) get resolve by
substitution {Anil/k}, and we are left with ¬ alive(Anil) .
o In the last step of the resolution graph ¬ alive(Anil) and alive(Anil) get resolved.

Knowledge Representation

What is knowledge representation?


Humans are best at understanding, reasoning, and interpreting knowledge. Human knows things, which
is knowledge and as per their knowledge they perform various actions in the real world. But how
machines do all these things comes under knowledge representation and reasoning. Hence we
can describe Knowledge representation as following:

o Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence which
concerned with AI agents thinking and how thinking contributes to intelligent behavior of
agents.
o It is responsible for representing information about the real world so that a computer can
understand and can utilize this knowledge to solve the complex real world problems such as
diagnosis a medical condition or communicating with humans in natural language.
o It is also a way which describes how we can represent knowledge in artificial intelligence.
Knowledge representation is not just storing data into some database, but it also enables an
intelligent machine to learn from that knowledge and experiences so that it can behave
intelligently like a human.

What to Represent:
Following are the kind of knowledge which needs to be represented in AI systems:

o Object: All the facts about objects in our world domain. E.g., Guitars contains strings, trumpets
are brass instruments.
o Events: Events are the actions which occur in our world.
o Performance: It describe behavior which involves knowledge about how to do things.
o Meta-knowledge: It is knowledge about what we know.
o Facts: Facts are the truths about the real world and what we represent.
o Knowledge-Base: The central component of the knowledge-based agents is the knowledge
base. It is represented as KB. The Knowledgebase is a group of the Sentences (Here, sentences
are used as a technical term and not identical with the English language).

Knowledge: Knowledge is awareness or familiarity gained by experiences of facts, data, and situations.
Following are the types of knowledge in artificial intelligence:

Types of knowledge
Following are the various types of knowledge:

1. Declarative Knowledge:

o Declarative knowledge is to know about something.


o It includes concepts, facts, and objects.
o It is also called descriptive knowledge and expressed in declarativesentences.
o It is simpler than procedural language.

2. Procedural Knowledge

o It is also known as imperative knowledge.


o Procedural knowledge is a type of knowledge which is responsible for knowing how to do
something.
o It can be directly applied to any task.
o It includes rules, strategies, procedures, agendas, etc.
o Procedural knowledge depends on the task on which it can be applied.
3. Meta-knowledge:

o Knowledge about the other types of knowledge is called Meta-knowledge.

4. Heuristic knowledge:

o Heuristic knowledge is representing knowledge of some experts in a filed or subject.


o Heuristic knowledge is rules of thumb based on previous experiences, awareness of approaches,
and which are good to work but not guaranteed.

5. Structural knowledge:

o Structural knowledge is basic knowledge to problem-solving.


o It describes relationships between various concepts such as kind of, part of, and grouping of
something.
o It describes the relationship that exists between concepts or objects.

The relation between knowledge and intelligence:


Knowledge of real-worlds plays a vital role in intelligence and same for creating artificial intelligence.
Knowledge plays an important role in demonstrating intelligent behavior in AI agents. An agent is only
able to accurately act on some input when he has some knowledge or experience about that input.

Let's suppose if you met some person who is speaking in a language which you don't know, then how
you will able to act on that. The same thing applies to the intelligent behavior of the agents.

As we can see in below diagram, there is one decision maker which act by sensing the environment
and using knowledge. But if the knowledge part will not present then, it cannot display intelligent
behavior.

AI knowledge cycle:
An Artificial intelligence system has the following components for displaying intelligent behavior:

o Perception
o Learning
o Knowledge Representation and Reasoning
o Planning
o Execution

The above diagram is showing how an AI system can interact with the real world and what components
help it to show intelligence. AI system has Perception component by which it retrieves information from
its environment. It can be visual, audio or another form of sensory input. The learning component is
responsible for learning from data captured by Perception comportment. In the complete cycle, the
main components are knowledge representation and Reasoning. These two components are involved
in showing the intelligence in machine-like humans. These two components are independent with each
other but also coupled together. The planning and execution depend on analysis of Knowledge
representation and reasoning.

Approaches to knowledge representation:


There are mainly four approaches to knowledge representation, which are given below:

1. Simple relational knowledge:

o It is the simplest way of storing facts which uses the relational method, and each fact about a
set of the object is set out systematically in columns.
o This approach of knowledge representation is famous in database systems where the
relationship between different entities is represented.
o This approach has little opportunity for inference.

Example: The following is the simple relational knowledge representation.


Player Weight Age

Player1 65 23

Player2 58 18

Player3 75 24

2. Inheritable knowledge:

o In the inheritable knowledge approach, all data must be stored into a hierarchy of classes.
o All classes should be arranged in a generalized form or a hierarchal manner.
o In this approach, we apply inheritance property.
o Elements inherit values from other members of a class.
o This approach contains inheritable knowledge which shows a relation between instance and
class, and it is called instance relation.
o Every individual frame can represent the collection of attributes and its value.
o In this approach, objects and values are represented in Boxed nodes.
o We use Arrows which point from objects to their values.
o Example:

3. Inferential knowledge:

o Inferential knowledge approach represents knowledge in the form of formal logics.


o This approach can be used to derive more facts.
o It guaranteed correctness.
o Example: Let's suppose there are two statements:
a. Marcus is a man
b. All men are mortal
Then it can represent as;

man(Marcus)
∀x = man (x) ----------> mortal (x)s

4. Procedural knowledge:

o Procedural knowledge approach uses small programs and codes which describes how to do
specific things, and how to proceed.
o In this approach, one important rule is used which is If-Then rule.
o In this knowledge, we can use various coding languages such as LISP language and Prolog
language.
o We can easily represent heuristic or domain-specific knowledge using this approach.
o But it is not necessary that we can represent all cases in this approach.

Requirements for knowledge Representation system:


A good knowledge representation system must possess the following properties.

1. 1. Representational Accuracy:
KR system should have the ability to represent all kind of required knowledge.
2. 2. Inferential Adequacy:
KR system should have ability to manipulate the representational structures to produce new
knowledge corresponding to existing structure.
3. 3. Inferential Efficiency:
The ability to direct the inferential knowledge mechanism into the most productive directions
by storing appropriate guides.
4. 4. Acquisitional efficiency- The ability to acquire the new knowledge easily using automatic
methods.

Handling Uncertainty: Non Monotonic


Reasoning

Monotonic Reasoning:
In monotonic reasoning, once the conclusion is taken, then it will remain the same even if we add some
other information to existing information in our knowledge base. In monotonic reasoning, adding
knowledge does not decrease the set of prepositions that can be derived.

To solve monotonic problems, we can derive the valid conclusion from the available facts only, and it
will not be affected by new facts.

Monotonic reasoning is not useful for the real-time systems, as in real time, facts get changed, so we
cannot use monotonic reasoning.

Monotonic reasoning is used in conventional reasoning systems, and a logic-based system is


monotonic.

Any theorem proving is an example of monotonic reasoning.

Example:

o Earth revolves around the Sun.

It is a true fact, and it cannot be changed even if we add another sentence in knowledge base like, "The
moon revolves around the earth" Or "Earth is not round," etc.

Advantages of Monotonic Reasoning:

o In monotonic reasoning, each old proof will always remain valid.


o If we deduce some facts from available facts, then it will remain valid for always.

Disadvantages of Monotonic Reasoning:

o We cannot represent the real world scenarios using Monotonic reasoning.


o Hypothesis knowledge cannot be expressed with monotonic reasoning, which means facts
should be true.
o Since we can only derive conclusions from the old proofs, so new knowledge from the real world
cannot be added.

6. Non-monotonic Reasoning
In Non-monotonic reasoning, some conclusions may be invalidated if we add some more information
to our knowledge base.

Logic will be said as non-monotonic if some conclusions can be invalidated by adding more knowledge
into our knowledge base.

Non-monotonic reasoning deals with incomplete and uncertain models.

"Human perceptions for various things in daily life, "is a general example of non-monotonic reasoning.

Example: Let suppose the knowledge base contains the following knowledge:
o Birds can fly
o Penguins cannot fly
o Pitty is a bird

So from the above sentences, we can conclude that Pitty can fly.

However, if we add one another sentence into knowledge base "Pitty is a penguin", which concludes
"Pitty cannot fly", so it invalidates the above conclusion.

Advantages of Non-monotonic reasoning:

o For real-world systems such as Robot navigation, we can use non-monotonic reasoning.
o In Non-monotonic reasoning, we can choose probabilistic facts or can make assumptions.

Disadvantages of Non-monotonic Reasoning:

o In non-monotonic reasoning, the old facts may be invalidated by adding new sentences.
o It cannot be used for theorem proving.

Probabilistic Reasoning

Probabilistic reasoning:
Probabilistic reasoning is a way of knowledge representation where we apply the concept of probability
to indicate the uncertainty in knowledge. In probabilistic reasoning, we combine probability theory with
logic to handle the uncertainty.

We use probability in probabilistic reasoning because it provides a way to handle the uncertainty that
is the result of someone's laziness and ignorance.

In the real world, there are lots of scenarios, where the certainty of something is not confirmed, such
as "It will rain today," "behavior of someone for some situations," "A match between two teams or two
players." These are probable sentences for which we can assume that it will happen but not sure about
it, so here we use probabilistic reasoning.

Need of probabilistic reasoning in AI:

o When there are unpredictable outcomes.


o When specifications or possibilities of predicates becomes too large to handle.
o When an unknown error occurs during an experiment.

In probabilistic reasoning, there are two ways to solve problems with uncertain knowledge:

o Bayes' rule
o Bayesian Statistics

As probabilistic reasoning uses probability and related terms, so before understanding probabilistic
reasoning, let's understand some common terms:

Probability: Probability can be defined as a chance that an uncertain event will occur. It is the numerical
measure of the likelihood that an event will occur. The value of probability always remains between 0
and 1 that represent ideal uncertainties.

ADVERTISEMENT

ADVERTISEMENT

1. 0 ≤ P(A) ≤ 1, where P(A) is the probability of an event A.


1. P(A) = 0, indicates total uncertainty in an event A.
1. P(A) =1, indicates total certainty in an event A.

We can find the probability of an uncertain event by using the below formula.

o P(¬A) = probability of a not happening event.


o P(¬A) + P(A) = 1.

Event: Each possible outcome of a variable is called an event.

Sample space: The collection of all possible events is called sample space.

Random variables: Random variables are used to represent the events and objects in the real world.

Prior probability: The prior probability of an event is probability computed before observing new
information.

Posterior Probability: The probability that is calculated after all evidence or information has taken into
account. It is a combination of prior probability and new information.

Use Of Certainty Factors

Certainty Factor
The Certainty factor is a measure of the degree of confidence or belief in the truth of a
proposition or hypothesis. In AI, the certainty factor is often used in rule-based systems to
evaluate the degree of certainty or confidence of a given rule.
Certainty factors are used to combine and evaluate the results of multiple rules to make a
final decision or prediction. For example, in a medical diagnosis system, different symptoms
can be associated with different rules that determine the likelihood of a particular disease.
The certainty factors of each rule can be combined to produce a final diagnosis with a degree
of confidence.
In Artificial Intelligence, the numerical values of the certainty factor represent the degree of
confidence or belief in the truth of a proposition or hypothesis. The numerical scale typically
ranges from -1 to 1, and each value has a specific meaning:

 -1: Complete disbelief or negation: This means that the proposition or hypothesis is
believed to be false with absolute certainty.
 0: Complete uncertainty: This means that there is no belief or confidence in the truth
or falsehood of the proposition or hypothesis.
 +1: Complete belief or affirmation: This means that the proposition or hypothesis is
believed to be true with absolute certainty.

Values between 0 and 1 indicate varying degrees of confidence that the proposition or
hypothesis is true.
Values between 0 and -1 indicate varying degrees of confidence that the proposition or
hypothesis is false.
For example, a certainty factor of 0.7 indicates a high degree of confidence that the
proposition or hypothesis is true, while a certainty factor of -0.3 indicates a moderate degree
of confidence that the proposition or hypothesis is false.
Practical Applications of Certainty Factor
Certainty factor has practical applications in various fields of artificial intelligence, including:

1. Medical diagnosis: In medical diagnosis systems, certainty factors are used to


evaluate the probability of a patient having a particular disease based on the presence
of specific symptoms.
2. Fraud detection: In financial institutions, certainty factors can be used to evaluate the
likelihood of fraudulent activities based on transaction patterns and other relevant
factors.
3. Customer service: In customer service systems, certainty factors can be used to
evaluate customer requests or complaints and provide appropriate responses.
4. Risk analysis: In risk analysis applications, certainty factors can be used to assess the
likelihood of certain events occurring based on historical data and other factors.
5. Natural language processing: In natural language processing applications, certainty
factors can be used to evaluate the accuracy of language models in interpreting and
generating human language.

Limitations of Certainty Factor


Although the certainty factor is a useful tool for representing and reasoning about uncertain or
incomplete information in artificial intelligence, there are some limitations to its use. Here are
some of the main limitations of the certainty factor:

1. Difficulty in assigning accurate certainty values: Assigning accurate certainty


values to propositions or hypotheses can be challenging, especially when dealing with
complex or ambiguous situations. This can lead to faulty results and outcomes.
2. Difficulty in combining certainty values: Combining certainty values from multiple
sources can be complex and difficult to achieve accurately. Different sources may have
different levels of certainty and reliability, which can lead to inconsistent or conflicting
results.
3. Inability to handle conflicting evidence: In some cases, conflicting evidence may be
presented, making it difficult to determine the correct certainty value for a proposition or
hypothesis.
4. Limited range of values: The numerical range of the certainty factor is limited to -1 to
1, which may not be sufficient to capture the full range of uncertainty in some
situations.
5. Subjectivity: The Certainty factor relies on human judgment to assign certainty values,
which can introduce subjectivity and bias into the decision-making process.

Fuzzy Logic

What is Fuzzy Logic?


The 'Fuzzy' word means the things that are not clear or are vague. Sometimes, we cannot decide in
real life that the given problem or statement is either true or false. At that time, this concept provides
many values between the true and false and gives the flexibility to find the best solution to that
problem.

Example of Fuzzy Logic as comparing to Boolean Logic

Fuzzy logic contains the multiple logical values and these values are the truth values of a variable or
problem between 0 and 1. This concept was introduced by Lofti Zadeh in 1965 based on the Fuzzy
Set Theory. This concept provides the possibilities which are not given by computers, but similar to
the range of possibilities generated by humans.
In the Boolean system, only two possibilities (0 and 1) exist, where 1 denotes the absolute truth value
and 0 denotes the absolute false value. But in the fuzzy system, there are multiple possibilities present
between the 0 and 1, which are partially false and partially true.

The Fuzzy logic can be implemented in systems such as micro-controllers, workstation-based or large
network-based systems for achieving the definite output. It can also be implemented in both hardware
or software.

Characteristics of Fuzzy Logic


Following are the characteristics of fuzzy logic:

1. This concept is flexible and we can easily understand and implement it.
2. It is used for helping the minimization of the logics created by the human.
3. It is the best method for finding the solution of those problems which are suitable for
approximate or uncertain reasoning.
4. It always offers two values, which denote the two possible solutions for a problem and statement.
5. It allows users to build or create the functions which are non-linear of arbitrary complexity.
6. In fuzzy logic, everything is a matter of degree.
7. In the Fuzzy logic, any system which is logical can be easily fuzzified.
8. It is based on natural language processing.
9. It is also used by the quantitative analysts for improving their algorithm's execution.
10. It also allows users to integrate with the programming.

Architecture of a Fuzzy Logic System


In the architecture of the Fuzzy Logic system, each component plays an important role. The
architecture consists of the different four components which are given below.

1. Rule Base
2. Fuzzification
3. Inference Engine
4. Defuzzification

Following diagram shows the architecture or process of a Fuzzy Logic system:


1. Rule Base
Rule Base is a component used for storing the set of rules and the If-Then conditions given by the
experts are used for controlling the decision-making systems. There are so many updates that come in
the Fuzzy theory recently, which offers effective methods for designing and tuning of fuzzy controllers.
These updates or developments decreases the number of fuzzy set of rules.

2. Fuzzification
Fuzzification is a module or component for transforming the system inputs, i.e., it converts the crisp
number into fuzzy steps. The crisp numbers are those inputs which are measured by the sensors and
then fuzzification passed them into the control systems for further processing. This component divides
the input signals into following five states in any Fuzzy Logic system:

o Large Positive (LP)


o Medium Positive (MP)
o Small (S)
o Medium Negative (MN)
o Large negative (LN)

3. Inference Engine
This component is a main component in any Fuzzy Logic system (FLS), because all the information is
processed in the Inference Engine. It allows users to find the matching degree between the current
fuzzy input and the rules. After the matching degree, this system determines which rule is to be added
according to the given input field. When all rules are fired, then they are combined for developing the
control actions.

4. Defuzzification
Defuzzification is a module or component, which takes the fuzzy set inputs generated by
the Inference Engine, and then transforms them into a crisp value. It is the last step in the process of
a fuzzy logic system. The crisp value is a type of value which is acceptable by the user. Various
techniques are present to do this, but the user has to select the best one for reducing the errors.

Membership Function
The membership function is a function which represents the graph of fuzzy sets, and allows users to
quantify the linguistic term. It is a graph which is used for mapping each element of x to the value
between 0 and 1.

This function is also known as indicator or characteristics function.

This function of Membership was introduced in the first papers of fuzzy set by Zadeh. For the Fuzzy set
B, the membership function for X is defined as: μB:X → [0,1]. In this function X, each element of set B is
mapped to the value between 0 and 1. This is called a degree of membership or membership value.

Applications of Fuzzy Logic


Following are the different application areas where the Fuzzy Logic concept is widely used:

1. It is used in Businesses for decision-making support system.


2. It is used in Automative systems for controlling the traffic and speed, and for improving the
efficiency of automatic transmissions. Automative systems also use the shift scheduling
method for automatic transmissions.
3. This concept is also used in the Defence in various areas. Defence mainly uses the Fuzzy logic
systems for underwater target recognition and the automatic target recognition of thermal
infrared images.
4. It is also widely used in the Pattern Recognition and Classification in the form of Fuzzy logic-
based recognition and handwriting recognition. It is also used in the searching of fuzzy images.
5. Fuzzy logic systems also used in Securities.
6. It is also used in microwave oven for setting the lunes power and cooking strategy.
7. This technique is also used in the area of modern control systems such as expert systems.
8. Finance is also another application where this concept is used for predicting the stock market,
and for managing the funds.
9. It is also used for controlling the brakes.
10. It is also used in the industries of chemicals for controlling the ph, and chemical distillation
process.
11. It is also used in the industries of manufacturing for the optimization of milk and cheese
production.
12. It is also used in the vacuum cleaners, and the timings of washing machines.
13. It is also used in heaters, air conditioners, and humidifiers.
Advantages of Fuzzy Logic
Fuzzy Logic has various advantages or benefits. Some of them are as follows:

1. The methodology of this concept works similarly as the human reasoning.


2. Any user can easily understand the structure of Fuzzy Logic.
3. It does not need a large memory, because the algorithms can be easily described with fewer
data.
4. It is widely used in all fields of life and easily provides effective solutions to the problems which
have high complexity.
5. This concept is based on the set theory of mathematics, so that's why it is simple.
6. It allows users for controlling the control machines and consumer products.
7. The development time of fuzzy logic is short as compared to conventional methods.
8. Due to its flexibility, any user can easily add and delete rules in the FLS system.

Disadvantages of Fuzzy Logic


Fuzzy Logic has various disadvantages or limitations. Some of them are as follows:

1. The run time of fuzzy logic systems is slow and takes a long time to produce outputs.
2. Users can understand it easily if they are simple.
3. The possibilities produced by the fuzzy logic system are not always accurate.
4. Many researchers give various ways for solving a given statement using this technique which
leads to ambiguity.
5. Fuzzy logics are not suitable for those problems that require high accuracy.
6. The systems of a Fuzzy logic need a lot of testing for verification and validation.

By TutorialsPoint:-

What is Fuzzy Logic?


Fuzzy Logic (FL) is a method of reasoning that resembles human reasoning. The
approach of FL imitates the way of decision making in humans that involves all
intermediate possibilities between digital values YES and NO.

The conventional logic block that a computer can understand takes precise input and
produces a definite output as TRUE or FALSE, which is equivalent to human’s YES or NO.

The inventor of fuzzy logic, Lotfi Zadeh, observed that unlike computers, the human
decision making includes a range of possibilities between YES and NO, such as −

CERTAINLY YES
POSSIBLY YES
CANNOT SAY
POSSIBLY NO
CERTAINLY NO

The fuzzy logic works on the levels of possibilities of input to achieve the definite output.

Implementation
 It can be implemented in systems with various sizes and capabilities ranging from
small micro-controllers to large, networked, workstation-based control systems.
 It can be implemented in hardware, software, or a combination of both.

Why Fuzzy Logic?


Fuzzy logic is useful for commercial and practical purposes.

 It can control machines and consumer products.


 It may not give accurate reasoning, but acceptable reasoning.
 Fuzzy logic helps to deal with the uncertainty in engineering.

Fuzzy Logic Systems Architecture


It has four main parts as shown −

 Fuzzification Module − It transforms the system inputs, which are crisp numbers,
into fuzzy sets. It splits the input signal into five steps such as −
LP x is Large Positive

MP x is Medium Positive

S x is Small

MN x is Medium Negative

LN x is Large Negative
 Knowledge Base − It stores IF-THEN rules provided by experts.
 Inference Engine − It simulates the human reasoning process by making fuzzy
inference on the inputs and IF-THEN rules.
 Defuzzification Module − It transforms the fuzzy set obtained by the inference
engine into a crisp value.
The membership functions work on fuzzy sets of variables.

Membership Function

Membership functions allow you to quantify linguistic term and represent a


fuzzy set graphically. A membership function for a fuzzy set A on the universe of
discourse X is defined as μA:X → [0,1].

Here, each element of X is mapped to a value between 0 and 1. It is


called membership value or degree of membership. It quantifies the degree of
membership of the element in X to the fuzzy set A.

 x axis represents the universe of discourse.


 y axis represents the degrees of membership in the [0, 1] interval.

There can be multiple membership functions applicable to fuzzify a numerical


value. Simple membership functions are used as use of complex functions
does not add more precision in the output.

All membership functions for LP, MP, S, MN, and LN are shown as below −
The triangular membership function shapes are most common among various
other membership function shapes such as trapezoidal, singleton, and
Gaussian.

Here, the input to 5-level fuzzifier varies from -10 volts to +10 volts. Hence
the corresponding output also changes.

Example of a Fuzzy Logic System


Let us consider an air conditioning system with 5-level fuzzy logic system. This
system adjusts the temperature of air conditioner by comparing the room
temperature and the target temperature value.
Algorithm

 Define linguistic Variables and terms (start)


 Construct membership functions for them. (start)
 Construct knowledge base of rules (start)
 Convert crisp data into fuzzy data sets using membership functions.
(fuzzification)
 Evaluate rules in the rule base. (Inference Engine)
 Combine results from each rule. (Inference Engine)
 Convert output data into non-fuzzy values. (defuzzification)

Development
Step 1 − Define linguistic variables and terms

Linguistic variables are input and output variables in the form of simple words
or sentences. For room temperature, cold, warm, hot, etc., are linguistic
terms.

Temperature (t) = {very-cold, cold, warm, very-warm, hot}


Every member of this set is a linguistic term and it can cover some portion of
overall temperature values.

Step 2 − Construct membership functions for them

The membership functions of temperature variable are as shown −

Step3 − Construct knowledge base rules

Create a matrix of room temperature values versus target temperature values


that an air conditioning system is expected to provide.

RoomTemp.
Very_Cold Cold Warm Hot Very_Hot
/Target

Very_Cold No_Change Heat Heat Heat Heat

Cold Cool No_Change Heat Heat Heat

Warm Cool Cool No_Change Heat Heat

Hot Cool Cool Cool No_Change Heat

Very_Hot Cool Cool Cool Cool No_Change

Build a set of rules into the knowledge base in the form of IF-THEN-ELSE
structures.

Sr. No. Condition Action

1 IF temperature=(Cold OR Very_Cold) AND target=Warm THEN Heat

2 IF temperature=(Hot OR Very_Hot) AND target=Warm THEN Cool

3 IF (temperature=Warm) AND (target=Warm) THEN No_Change

Step 4 − Obtain fuzzy value


Fuzzy set operations perform evaluation of rules. The operations used for OR
and AND are Max and Min respectively. Combine all results of evaluation to
form a final result. This result is a fuzzy value.

Step 5 − Perform defuzzification

Defuzzification is then performed according to membership function for output


variable.

Application Areas of Fuzzy Logic


The key application areas of fuzzy logic are as given −

Automotive Systems

 Automatic Gearboxes
 Four-Wheel Steering
 Vehicle environment control

Consumer Electronic Goods

 Hi-Fi Systems
 Photocopiers
 Still and Video Cameras
 Television

Domestic Goods

 Microwave Ovens
 Refrigerators
 Toasters
 Vacuum Cleaners
 Washing Machines

Environment Control
 Air Conditioners/Dryers/Heaters
 Humidifiers

Advantages of FLSs
 Mathematical concepts within fuzzy reasoning are very simple.
 You can modify a FLS by just adding or deleting rules due to flexibility of fuzzy
logic.
 Fuzzy logic Systems can take imprecise, distorted, noisy input information.
 FLSs are easy to construct and understand.
 Fuzzy logic is a solution to complex problems in all fields of life, including
medicine, as it resembles human reasoning and decision making.

Disadvantages of FLSs
 There is no systematic approach to fuzzy system designing.
 They are understandable only when simple.
 They are suitable for the problems which do not need high accuracy.

Natural Language Processing: Introduction


Natural Language Processing (NLP) is a field of Artificial Intelligence (AI) that deals with the
interaction between computers and human languages. NLP is used to analyze, understand, and generate
natural language text and speech. The goal of NLP is to enable computers to understand and interpret
human language in a way that is similar to how humans process language.
1. Natural Language Processing (NLP) is a field of computer science and artificial intelligence
that focuses on the interaction between computers and humans using natural language. It
involves analyzing, understanding, and generating human language data, such as text and
speech.
2. NLP has a wide range of applications, including sentiment analysis, machine translation,
text summarization, chatbots, and more. Some common tasks in NLP include:
3. Text Classification: Classifying text into different categories based on their content, such as
spam filtering, sentiment analysis, and topic modeling.
4. Named Entity Recognition (NER): Identifying and categorizing named entities in text, such
as people, organizations, and locations.
5. Part-of-Speech (POS) Tagging: Assigning a part of speech to each word in a sentence, such
as noun, verb, adjective, and adverb.
6. Sentiment Analysis: Analyzing the sentiment of a piece of text, such as positive, negative,
or neutral.
7. Machine Translation: Translating text from one language to another.
NLP involves the use of several techniques, such as machine learning, deep learning, and rule-based
systems. Some popular tools and libraries used in NLP include NLTK (Natural Language Toolkit),
spaCy, and Gensim.
Overall, NLP is a rapidly growing field with many practical applications, and it has the potential to
revolutionize the way we interact with computers and machines using natural language.
NLP techniques are used in a wide range of applications, including:
 Speech recognition and transcription: NLP techniques are used to convert speech to text,
which is useful for tasks such as dictation and voice-controlled assistants.
 Language translation: NLP techniques are used to translate text from one language to
another, which is useful for tasks such as global communication and e-commerce.
 Text summarization: NLP techniques are used to summarize long text documents into
shorter versions, which is useful for tasks such as news summarization and document
indexing.
 Sentiment analysis: NLP techniques are used to determine the sentiment or emotion
expressed in text, which is useful for tasks such as customer feedback analysis and social
media monitoring.
Question answering: NLP techniques are used to answer questions asked in natural language,
which is useful for tasks such as chatbots and virtual assistants.
 NLP is a rapidly growing field and it is being used in many industries such as healthcare,
education, e-commerce, and customer service. NLP is also used to improve the performance
of natural language-based systems like chatbot, virtual assistants, recommendation systems,
and more. With the advancement in NLP, it has become possible for computers to understand
and process human languages in a way that can be used for various applications such as
speech recognition, language translation, question answering, and more.

Syntactic Processing

What is Syntactic Processing?


Syntactic processing is the process of analyzing the grammatical structure
of a sentence to understand its meaning. This involves identifying the different parts of speech in a
sentence, such as nouns, verbs, adjectives, and adverbs, and how they relate to each other in order
to give proper meaning to the sentence.

Let’s start with an example to understand Syntactic Processing:

 New York is the capital of the United States of America.


 Is the United States of America the of New York capital.
If we observe closely, both sentences have the same set of words, but only the first one is
grammatically correct and which have proper meaning. If we approach both sentences with lexical
processing techniques, we can’t tell the difference between the two sentences.

Here, comes the role of syntactic processing techniques which can help to understand the
relationship between individual words in the sentence.

Difference between Lexical Processing and Syntactic Processing

Lexical processing aims at data cleaning and feature extraction, by using techniques such
as lemmatization, removing stopwords, correcting misspelled words, etc. However,
in syntactic processing, our aim is to understand the roles played by each of the words in the
sentence, and the relationship among words and to parse the grammatical structure of sentences to
understand the proper meaning of the sentence.
How Does Syntactic Processing Work?

To understand the working of syntactic processing, lets again start with an example.

For example, consider the sentence “The cat sat on the mat.” Syntactic processing would involve
identifying important components in the sentence such as “cat” as a noun, “sat” as a verb, “on” as
a preposition, and “mat” as a noun. It would also involve understanding that “cat” is the subject of
the sentence and “mat” is the object.

Syntactic processing involves a series of steps, including tokenization, part-of-speech tagging,


parsing, and semantic analysis.

Tokenization is the process of breaking up a sentence into individual words or tokens. Part-of-
speech (PoS) tagging involves identifying the part of speech of each token. Parsing is the process of
analyzing the grammatical structure of a sentence, including identifying the subject, verb, and object.
The semantic analysis involves understanding the meaning of the sentence in context.

There are several different techniques used in syntactic processing, including rule-based methods,
statistical methods, and machine learning algorithms. Each technique has its own strengths and
weaknesses, and the choice of technique depends on the specific task and the available data.

In the subsequent lessons, we will learn the concept of parsing and different parsing techniques, PoS
Tagging, and semantic analysis.

Why Is Syntactic Processing Important in NLP?

Syntactic processing is a crucial component of many NLP tasks, including machine translation,
sentiment analysis, and question-answering. Without accurate syntactic processing, it is difficult for
computers to understand the underlying meaning of human language.

Syntactic processing also plays an important role in text generation, such as in chatbots or
automated content creation. By understanding the grammatical structure of a sentence, computers
can generate more natural and fluent textual content.
Conclusion

Syntactic processing is a fundamental task in NLP, which involves analyzing the grammatical structure
of a sentence to understand its meaning. It is a crucial component of many NLP tasks specifically text
generation and machine translation, and its accuracy is essential for computers to understand
complex human language.

By GFG:-
1. Syntactic Analysis:
There are different rules for different languages. Violation of these rules will give a syntax error.
Here the sentence is transformed into the structure that represents a correlation between the words.
This correlation might violate the rules occasionally. The syntax represents the set of rules that the
official language will have to follow. For example, “To the movies, we are going.” Will give a
syntax error. The syntactic analysis uses the results given by morphological analysis to develop
the description of the sentence. The sentence which is divided into categories given by the
morphological process is aligned into a defined structure. This process is called parsing. For
example, the cat chases the mouse in the garden, would be represented as:

Here the sentence is broken down according to the categories. Then it is described in a
hierarchical structure with nodes as sentence units. These parse trees are parsed while the syntax
analysis run and if any error arises the processing stops and it displays syntax error. The parsing
can be top-down or bottom-up.
 Top-down: Starts with the first symbol and parse the sentence according to the
grammar rules until each of the terminals in the sentence is parsed.
 Bottom-up: Starts with the sentence which is to be parsed and apply all the rules
backwards till the first symbol is reached.

Semantic Processing

Semantic Analysis
In the case of semantic analysis, a computer understands the meaning of a text by analyzing the text as
a whole and not just looking at individual words. The context in which a word is used is very important
when it comes to semantic analysis. Let’s revisit the same example: “Does it all sound like a joke to
you?” While the word “joke” may be positive on its own, something sounding like a joke may not be so.
Thus, the context here is derived by analyzing the whole sentence instead of isolated words.
The semantic analysis does throw better results, but it also requires substantially more training and
computation. We will now understand why.

How does Semantic Analysis work


What’s an Orange?
It could be a fruit, a color, or a place! To know the meaning of Orange in a sentence, we need to know
the words around it.
For example, if the sentence talks about “orange shirt,” we are talking about the color orange. If a
sentence talks about someone from Orange wearing an orange shirt – we are talking about Orange, the
place, and Orange, the color. And, if we are talking about someone from Orange eating an orange while
wearing an orange shirt – we are talking about the place, the color, and the fruit.
You see, the word on its own matters less, and the words surrounding it matter more for the
interpretation. A semantic analysis algorithm needs to be trained with a larger corpus of data to perform
better.
Over the years, NLP has progressed from syntactic analysis to semantic analysis. Think about Google
Search. 10-15 years ago, search results were filled with irrelevant junk. It was easy for SEO practitioners
to load their pages with keywords and rank. It’s not the same case today. Search Engines, like Google,
can interpret content beyond individual words.

Advantages of Semantic Analysis


A strong grasp of semantic analysis helps firms improve their communication with customers without
needing to talk much.
Improved Customer Knowledge
A company can scale up its customer communication by using semantic analysis-based tools. It could
be BOTs that act as doorkeepers or even on-site semantic search engines. By allowing customers to
“talk freely”, without binding up to a format – a firm can gather significant volumes of quality data.
Emphasized Customer-centric Strategy
A successful semantic strategy portrays a customer-centric image of a firm. It makes the customer feel
“listened to” without actually having to hire someone to listen.
Refined SEO Strategy
Modern-day SEO strategy requires a semantic approach. Content is today analyzed by search engines,
semantically and ranked accordingly. It is thus important to load the content with sufficient context and
expertise. On the whole, such a trend has improved the general content quality of the internet.
By GFG:-
1. Semantic Analysis:
The semantic analysis looks after the meaning. It allocates the meaning to all the structures
built by the syntactic analyzer. Then every syntactic structure and the objects are mapped
together into the task domain. If mapping is possible the structure is sent, if not then it is
rejected. For example, “hot ice-cream” will give a semantic error. During semantic
analysis two main operations are executed:
 First, each separate word will be mapped with appropriate objects in the
database. The dictionary meaning of every word will be found. A word might
have more than one meaning.
 Secondly, all the meanings of each different word will be integrated to find a
proper correlation between the word structures. This process of determining the
correct meaning is called lexical disambiguation. It is done by associating each
word with the context.
This process defined above can be used to determine the partial meaning of a sentence.
However semantic and syntax are two completely contrasting concepts. It might be
possible that a syntactically correct sentence is semantically incorrect.
For example, “A rock smelled the colour nine.” It is syntactically correct as it obeys all the
rules of English, but is semantically incorrect. The semantic analysis verifies that a
sentence is abiding by the rules and creates correct information.

The above example shows the Semantic parsing.

Pragmatic Processing
Pragmatic Analysis:
The pragmatic analysis means handling the situation in a much more practical or realistic manner
than using a theoretical approach. As we know that a sentence can have different meanings in
various situations. For example, The average is 18.
The average is 18. (average may be of sequence)
The average is 18. (average may be of a vehicle)
The average is 18. (average may be of a mathematical term)
We can see that for the same input there can be different perceptions. To interpret the meaning of
the sentence we need to understand the situation. To tackle such problems we use pragmatic
analysis. The pragmatic analysis tends to make the understanding of the language much more
clear and easy to interpret.
Implementation:
The five phases discussed above for Language processing are required to follow an order. Each phase
takes its input from the previous phase’s output and sends it along to the next phase for processing.
While this process input can get rejected half-way if it does not follow the rules defining it for the
next phase.

Also, More than one phase can start processing together. This may happen due to ambiguity between
the phases. For instance, consider the sentence
Is the electric vehicle Tesla car?
The above sentence has four noun phrases at the end which will be required to form noun phrases to
give the sentence of the form:
“Is the A B?” where A & B represents the noun phrases we require. While syntax analysis there will
be the following choices available:

While performing the syntactic analysis all of these choices look applicable, but to get the correct
phrases we require to analyze the semantics. When we apply semantic analysis the only options
making sense are “electric vehicle” and “tesla car”. Hence, we can say that these processes are
separated but they can communicate in different ways.
Language is a structure which follows different rules. Natural Language processes the written form
of language concerning the rules developed. The main focus is to erase ambiguity & uncertainty from
the language to make the communication much easier.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy