0% found this document useful (0 votes)
10 views42 pages

Iii Unit

The document discusses the fundamentals of logic, including syntax and semantics, and introduces propositional logic and first-order logic as methods for knowledge representation in artificial intelligence. It explains concepts such as models, logical entailment, inference rules, and the structure of expert systems, which utilize knowledge bases and inference engines to solve complex problems. Additionally, it highlights the importance of satisfiability and reasoning techniques like forward and backward chaining in AI.

Uploaded by

naelahmed888
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)
10 views42 pages

Iii Unit

The document discusses the fundamentals of logic, including syntax and semantics, and introduces propositional logic and first-order logic as methods for knowledge representation in artificial intelligence. It explains concepts such as models, logical entailment, inference rules, and the structure of expert systems, which utilize knowledge bases and inference engines to solve complex problems. Additionally, it highlights the importance of satisfiability and reasoning techniques like forward and backward chaining in AI.

Uploaded by

naelahmed888
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/ 42

THE WUMPUS WORLD

LOGIC
SYNTAX
• the knowledge bases consist of sentences. These sentences are expressed according to
the syntax of the representation language, which specifies all the sentences that are well
formed.
• The notion of syntax is clear enough in ordinary arithmetic: "x + y = 4" is a well-
formed sentence, whereas "x4y+ =" is not.

SEMANTICS
• A logic must also define the semantics or meaning of sentences. The semantics defines
the truth of each sentence with respect to each possible world. For example, the
semantics for arithmetic specifies that the sentence
• “X + Y = 4" is true in a world where x is 2 and is 2, but false in a world where x is 1 and
y is 1. In standard logic, every sentence must be either true or false in each possible
world—there is no "in between."
MODEL
• When we need to be precise, we use the term model in place of ''possible
world." Whereas possible worlds might be thought of as (potentially) real
environments that the agent might or might not be in, models are
mathematical abstractions, each of which simply fixes the truth or
falsehood of every relevant sentence.
• Informally, we may think of a possible world as, for example, having x men
and y women sitting at a table playing bridge, and the sentence x + y = 1 is
true when there are four people in total.
• Formally, the possible models are just all possible assignments of real
numbers to the variables x and y. Each such assignment fixes the truth of
any sentence of arithmetic whose variables are x and y. If a sentence a is
true in model m, we say that m satisfies a or sometimes m is a model
of a. We use the notation M(a) to mean the set of all models of a.
• Now that we have a notion of truth, we are ready to talk about logical
reasoning. This involves the relation of logical entailment between
sentences—the idea that a sentence follows logically from another
sentence. In mathematical notation, we write
• α╞ β

• to mean that the sentence α entails the sentence β. The formal definition
of entailment is this: α╞ β if and only if, in every model in which α is
true, β is also true. Using the notation just introduced, we can write
• α╞ β if and only if M(α) ⊆ M(β) .
PROPOSITIONAL LOGIC: A VERY SIMPLE LOGIC
• Here the statements are made by the propositions
• The propositional logic is also called as Boolean logic
• The sentence/statements are declarative which is either true or false but
not both
• Questions, opinion, and comma are not allowd I propositional logic
• Eg
• Students are studying in college(true proposition)
• 5+3=8(true)
• 4+2=9(false)
• What is your name?(not allowed)
• SYNTAX

• Defines the allowable sentences

• The atomic sentences – the individual syntactic elements consist of a single propositional
symbol

• Each such symbol stands for a propositional that can be true or false

• We will use uppercase names for symbols :P,Q,R and so on

• For example W1,3 stands for the proposition that the Wumpus is in [1,3]
• Complex sentences : Constructed from simpler sentences using logic
connectives(logical operators)
Semantics

• The semantics defines the rules for determining the truth of a sentence with respect to a particular
model. In propositional logic, a model simply fixes the truth value—true or. false—for every
proposition symbol.

• For example, if the sentences in the knowledge base make use of the proposition symbols P1,2, P2,2,
and P3,1, then one possible model is

• M1=finding the pit in Wumpus world

• m1 = {P1,2 = false, P2,2 =,false P3,1 = true} .


Propositional logic-Semantics

• The semantics for propositional logic must specify how to compute the
truth value of any sentences given a model
• This is done recursively
• All sentences are constructed from atomic sentences and the five
connectives
• Specify how to compute the truth of atomic sentences and how to
compute the truth of sentences formed with each of the five
connectives
• Atomic sentences are easy
• Complex sentences: for any sentences s and model m the sentences ~s
is true in m if and only if s is false in m
• The sentences we write will suffice to derive ~P1,2 (there is no pit in [1,2]), as was done informally

• There is no pit in [1,1]


• R1:~P11

• A square is breezy if and only if there is a pit in a neighboring square. This has to be stated for each square; for
now, we include just the relevant squares:
• R2:B11  (P12 V P21)
• R3 : B21  ( P11 V P22 V P31)
PROPOSITIONAL THEOREM PROVING
• Logical Equivalence :
• Satisfiable :
• In propositional logic, a formula is said to be satisfiable if there exists at least one assignment of truth
values to its variables that makes the formula true. If no such assignment exists, the formula is said to
be unsatisfiable.

• For example, the formula P∧Q is satisfiable because it can be made true by setting both P and Q to
true. However, the formula P∧¬P is unsatisfiable because there is no assignment of truth values to P
that can make the formula true (since it asserts both P and its negation).

• Satisfiability is a fundamental concept in computer science, particularly in the area of formal methods
and automated reasoning. Problems such as the Boolean satisfiability problem (SAT) involve
determining whether a given propositional formula is satisfiable. SAT solvers are important tools used
in various applications, including software verification, hardware design, and artificial intelligence.
Inference and Proofs
• Inference and proofs are fundamental concepts in logic and mathematics,
particularly in the context of propositional logic and formal reasoning.
• Inference refers to the process of deriving logical conclusions from given
premises. Inference rules dictate how new propositions can be inferred from
existing propositions.
• Proofs are systematic demonstrations that a given proposition (conclusion)
follows logically from a set of premises, using a series of valid inference steps.
• Standard patterns of inferences that can be applied to derive chains of conclusions
that eads to the desired goals. These patters of inferences are called inferences
rules
The usefull inference rules are
• Modus Ponens
• And elimination
Inference Rules-AND elimination
• And Elmination
• From a conjunction any of the conjuncts can be inferred
• α˄β= α

• For example, from ( WurnpusAhead ˄ WumpusAlive), WumpusAlive can be inferred.


Inference Rules-Modus Ponens

• Modus Ponens
• Given S1=>S2 and S1, derive S2
• Whenever sentences of the form α=>β and α are given, then sentence
β can be inferred
α ⇒ β, ˄α
β
• Example (WumpusAhead^Wumpusalive)=> Shoot and
(WumpusAhead^Wumpusalive),
• SHOOT can be inferred
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.
• "Some humans are intelligent", or
• "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:
• First-order logic is another way of knowledge representation in artificial intelligence. It is
an extension to propositional logic.
• FOL is sufficiently expressive to represent the natural language statements in a concise
way.
• 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.
• 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:
• Objects: A, B, people, numbers, colors, wars, theories, squares, pits, wumpus, ......
• 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
• Function: mul,div,sqrt, Father of, best friend, third inning of, end of, ......
• As a natural language, first-order logic also has two main parts:
• Syntax
• 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:
• Atomic sentences:
• 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.
• We can represent atomic sentences as Predicate (term1, term2, ......,
term n).
• Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).
•For all x
•For each x
•For every x
There exists a 'x.'
For some 'x.'
For at least one 'x.'
Forward and Backward Chaining in AI

• Forward and backward chaining in AI, two building elements of Expert Systems,
aid in the creation of systems that handle both basic and complex issues by
mimicking human-like reasoning.

• Furthermore, these have been improved to produce a hybrid chaining inference


method that combines the benefits of both forward and backward chaining in AI.

• In brief, these techniques are at the heart of different modern machines, allowing
them to accomplish previously unthinkable jobs.
• Introduction to the Expert System
• An expert system is a subject wherein Artificial Intelligence generates the
behavior and judgment of a person or a group of specialists.
• It obtains vital information from its knowledge base and interprets it by
the user's problem.
• The knowledge base's data is primarily contributed by humans who are
specialists in a specific subject. Non-experts, on the other hand, use
applications to gather knowledge.
• It is used in medical diagnostics, budgeting, coding, entertainment, and
other fields.
• An expert system, when broken down, is AI software that utilizes
information stored in a knowledge base to address problems.
• This usually necessitates the use of a human expert, so it aims to keep
the expertise of humans in its knowledge base.
• As a result, expert systems are computer software designed to solve
complex problems in a specific domain at a higher level of human
intellect and expertise.
• Expert systems have five components:
• Knowledge Base: In an expert system, the knowledge base reflects information and rules.
It includes information on particular domains as well as rules for solving issues and
forming procedures about the domain.

• Inference Engine: The inference engine's most fundamental purpose is to obtain


pertinent information from the knowledge base, analyze it, and discover a solution to the
user's problem. Inference engines are also capable of explaining and troubleshooting.

• Knowledge acquisition and learning module: The purpose of this component is to make
it possible for expert systems to gather more information from different resources and
record it in the knowledge base.

• User Interface: This component is required for a non-expert person to communicate with
the expert system and discover answers.

• Explanation module: This section, as the name implies, assists in giving the user a
summary of the reached conclusion.
• Inference Engine
• The first stage in understanding the fundamentals of Forward Chaining and
Backward Chaining in AI is to comprehend the Inference Engine, which employs
these two methods of thinking.

• It is an integral part wherein logical rules are implemented to the knowledge base
to obtain new information or make a choice, as described in the preceding part.
The inference engine employs backward and forward chaining methods as
strategies for suggesting answers or deriving knowledge in the expert system.

You might also like