Iii Unit
Iii Unit
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
• 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
• 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
• 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
• 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
• α˄β= α
• 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
• 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.
• 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.
• 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.