You are on page 1of 13

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 quantifiers:

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

25

05r

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

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.


What is the Role of Planning in
Artificial Intelligence?
Artificial intelligence is an important technology in the future. Whether it is intelligent
robots, self-driving cars, or smart cities, they will all use different aspects of artificial
intelligence!!! But Planning is very important to make any such AI project.

Even Planning is an important part of Artificial Intelligence which deals with the tasks
and domains of a particular problem. Planning is considered the logical side of acting.

Everything we humans do is with a definite goal in mind, and all our actions are oriented
towards achieving our goal. Similarly, Planning is also done for Artificial Intelligence.

For example, Planning is required to reach a particular destination. It is necessary to


find the best route in Planning, but the tasks to be done at a particular time and why
they are done are also very important.

That is why Planning is considered the logical side of acting. In other words, Planning is
about deciding the tasks to be performed by the artificial intelligence system and the
system's functioning under domain-independent conditions.

What is a Plan?
We require domain description, task specification, and goal description for any planning
system. A plan is considered a sequence of actions, and each action has its
preconditions that must be satisfied before it can act and some effects that can be
positive or negative.

So, we have Forward State Space Planning (FSSP) and Backward State Space
Planning (BSSP) at the basic level.
1. Forward State Space Planning (FSSP)
FSSP behaves in the same way as forwarding state-space search. It says that given an
initial state S in any domain, we perform some necessary actions and obtain a new state
S' (which also contains some new terms), called a progression. It continues until we
reach the target position. Action should be taken in this matter.

o Disadvantage: Large branching factor


o Advantage: The algorithm is Sound

2. Backward State Space Planning (BSSP)


BSSP behaves similarly to backward state-space search. In this, we move from the target
state g to the sub-goal g, tracing the previous action to achieve that goal. This process
is called regression (going back to the previous goal or sub-goal). These sub-goals
should also be checked for consistency. The action should be relevant in this case.

o Disadvantages: not sound algorithm (sometimes inconsistency can be found)


o Advantage: Small branching factor (much smaller than FSSP)

So for an efficient planning system, we need to combine the features of FSSP and BSSP,
which gives rise to target stack planning which will be discussed in the next article.

What is planning in AI?


Planning in artificial intelligence is about decision-making actions performed by robots
or computer programs to achieve a specific goal.
Execution of the plan is about choosing a sequence of tasks with a high probability of
accomplishing a specific task.

Block-world planning problem

o The block-world problem is known as the Sussmann anomaly.


o The non-interlaced planners of the early 1970s were unable to solve this problem.
Therefore it is considered odd.
o When two sub-goals, G1 and G2, are given, a non-interleaved planner either produces a
plan for G1 that is combined with a plan for G2 or vice versa.
o In the block-world problem, three blocks labeled 'A', 'B', and 'C' are allowed to rest on a
flat surface. The given condition is that only one block can be moved at a time to achieve
the target.

The start position and target position are shown in the following diagram.

Components of the planning system

The plan includes the following important steps:

o Choose the best rule to apply the next rule based on the best available guess.
o Apply the chosen rule to calculate the new problem condition.
o Find out when a solution has been found.
o Detect dead ends so they can be discarded and direct system effort in more useful
directions.
o Find out when a near-perfect solution is found.

Target stack plan


o It is one of the most important planning algorithms used by STRIPS.
o Stacks are used in algorithms to capture the action and complete the target. A
knowledge base is used to hold the current situation and actions.
o A target stack is similar to a node in a search tree, where branches are created with a
choice of action.

The important steps of the algorithm are mentioned below:

1. Start by pushing the original target onto the stack. Repeat this until the pile is empty. If
the stack top is a mixed target, push its unsatisfied sub-targets onto the stack.
2. If the stack top is a single unsatisfied target, replace it with action and push the action
precondition to the stack to satisfy the condition.

iii. If the stack top is an action, pop it off the stack, execute it and replace the knowledge
base with the action's effect.

Bayes’ Theorem is named after Reverend Thomas Bayes. It is a very


important theorem in mathematics that is used to find the probability of an
event, based on prior knowledge of conditions that might be related to that
event. It is a further case of conditional probability. For example, there are 3
bags, each containing some white marble and some black marble in each bag.
If a white marble is drawn at random. What is the probability to find that this
white marble is from the first bag? In cases like such, we use Bayes’ Theorem.
It is used where the probability of occurrence of a particular event is calculated
based on other conditions which are also called conditional probability.
What is Bayes’ Theorem?
Bayes theorem is also known as the Bayes Rule or Bayes Law. It is used to
determine the conditional probability of event A when event B has already
happened. The general statement of Bayes’ theorem is “The conditional
probability of an event A, given the occurrence of another event B, is equal to
the product of the event of B, given A and the probability of A divided by the
probability of event B.” i.e.
P(A|B) = P(B|A)P(A) / P(B)
where,
P(A) and P(B) are the probabilities of events A and B
P(A|B) is the probability of event A when event B happens
P(B|A) is the probability of event B when A happens

Bayes Theorem Statement


Bayes’ Theorem for n set of events is defined as,
Let E1, E2,…, En be a set of events associated with the sample space S, in which
all the events E1, E2,…, En have a non-zero probability of occurrence. All the
events E1, E2,…, E form a partition of S. Let A be an event from space S for
which we have to find probability, then according to Bayes’ theorem,
P(Ei|A) = P(Ei)P(A|Ei) / ∑ P(Ek)P(A|Ek)
for k = 1, 2, 3, …., n

Conditional Probability
The probability of an event A based on the occurrence of another event B is
termed conditional Probability. It is denoted as P(A|B) and represents the
probability of A when event B has already happened.

Bayes Theorem Formula


For any two events A and B, then the formula for the Bayes theorem is given
by: (the image given below gives the Bayes’ theorem formula)
where,
P(A) and P(B) are the probabilities of events A and B also P(B) is never equal
to zero.
P(A|B) is the probability of event A when event B happens
P(B|A) is the probability of event B when A happens
Bayes Theorem Derivation
The proof of Bayes’ Theorem is given as, according to the conditional
probability formula,
P(Ei|A) = P(Ei∩A) / P(A)…..(i)
Then, by using the multiplication rule of probability, we get
P(Ei∩A) = P(Ei)P(A|Ei)……(ii)
Now, by the total probability theorem,
P(A) = ∑ P(Ek)P(A|Ek)…..(iii)
Substituting the value of P(E i∩A) and P(A) from eq (ii) and eq(iii) in eq(i) we get,
P(Ei|A) = P(Ei)P(A|Ei) / ∑ P(Ek)P(A|Ek)
Note:
Various terms used in Bayes theorem are explained below in this article,
 Hypotheses: Events happening in the sample space E 1, E2,… En is called
the hypotheses
 Priori Probability: P(Ei) is known as the priori probability of hypothesis E i.
 Posteriori Probability: Probability P(E i|A) is considered as the posterior
probability of hypothesis E i
Bayes’ theorem is also known as the formula for the probability of “causes”. As
we know that, the E i‘s are a partition of the sample space S, and at any given
time only one of the events E i occurs. Thus we conclude that the Bayes’
theorem formula gives the probability of a particular E i, given the event A has
occurred.
Difference Between Conditional Probability and
Bayes Theorem
The difference between Conditional Probability and Bayes Theorem can be
understood with the help of the table given below,

Bayes’ Theorem Conditional Probability

Bayes’ Theorem is derived using the definition Conditional Probability is the


of conditional probability. It is used to find the probability of event A when event B
reverse probability. has already occurred.

Formula: P(A|B) = [P(B|A)P(A)] / P(B) Formula: P(A|B) = P(A∩B) / P(B)

Examples of Bayes’ Theorem


Bayesian inference is very important and has found application in various
activities, including medicine, science, philosophy, engineering, sports, law, etc.
and Bayesian inference is directly derived from Bayes’
theorem. Example: Bayes’ theorem defines the accuracy of the medical test by
taking into account how likely a person is to have a disease and what is the
overall accuracy of the test.
Theorem of Total Probability
Let E1, E2,…………..En is mutually exclusive and exhaustive events associated
with a random experiment and lets E be an event that occurs with some E i.
Then, prove that
P(E) = n∑i=1P(E/Ei) . P(Ej)

Certainty Factor in AI
The Certainty Factor (CF) is a numeric value which tells us about how likely an
event or a statement is supposed to be true. It is somewhat similar to what we
define in probability, but the difference in it is that an agent, after finding the
probability of any event to occur cannot decide what to do. Based on the
probability and other knowledge that the agent has, this certainty factor is
decided through which the agent can decide whether to declare the statement
true or false.

The value of the Certainty factor lies between -1.0 to +1.0, where the negative
1.0 value suggests that the statement can never be true in any situation, and the
positive 1.0 value defines that the statement can never be false. The value of
the Certainty factor after analyzing any situation will either be a positive or a
negative value lying between this range. The value 0 suggests that the agent has
no information about the event or the situation.

A minimum Certainty factor is decided for every case through which the agent
decides whether the statement is true or false. This minimum Certainty factor is
also known as the threshold value. For example, if the minimum certainty
factor (threshold value) is 0.4, then if the value of CF is less than this value, then
the agent claims that particular statement false.

You might also like