2. Intelligent agents should have capacity for:
• Perceiving : Acquiring information from environment.
• Knowledge Representation : Representing its understanding of
the world.
• Reasoning : Inferring the implications of what it knows and of the
choices it has.
• Acting: Choosing what it want to do and carry it out.
3. Knowledge based system
• Representation of knowledge and the reasoning process are
central to the entire field of artificial intelligence.
• The primary component of a knowledge-based agent is its
knowledge-base.
• Human beings are essentially knowledge based creatures.
• Experiences/ rules to solve a problem
• A knowledge-base is a set of sentences. Each sentence is
expressed in a language called the knowledge representation
language
4. Inferencing
• Mechanisms to derive new sentences from old ones.
This process is known as inferencing or reasoning.
• Inference must obey the primary requirement that the
new sentences should follow logically from the
previous ones.
5. Logic
• Logic is the primary vehicle for representing and reasoning
about knowledge.
• Provides way to represent+ reasoning
• A logic consists of two parts, a language and a method
of reasoning.
• The logical language, in turn, has two aspects, syntax
and semantics.
• Thus, to specify or define a particular logic, one needs
to specify three things:
6. • Syntax: The atomic symbols of the logical language, and the rules for
constructing well formed, non-atomic expressions (symbol structures) of the
logic.
• Syntax specifies the symbols in the language and how they can be combined to
form sentences. Hence facts about the world are represented as sentences in
logic.
• Semantics: The meanings of the atomic symbols of the logic, and the rules for
determining the meanings of non-atomic expressions of the logic.
• It specifies what facts in the world a sentence refers to. Hence, also specifies
how you assign a truth value to a sentence based on its meaning in the world.
• Syntactic Inference Method: The rules for determining a subset of logical
expressions, called theorems of the logic. It refers to mechanical method for
computing (deriving) new (true) sentences from existing sentences
7.
8. Logical systems with different syntax and semantics.
• There are a number of logical systems
• Propositional logic :
• Simplest kind of logic
• All objects described are fixed or unique "John is a student"
student(john)
• Here John refers to one unique person.
• First order predicate logic:
• Objects described can be unique or variables to stand for a
unique object .
• "All Men are mortal" For All(M) [Men(M) -> Mortal(M)]
• Here M can be replaced by many different unique Men.
9. • Temporal Logic:
• Represents truth over time.
• Modal Logic:
• Represents doubt
• Higher order logics:
• Allows variable to represent many relations between objects.
10. Propositional Logic
• In propositional logic (PL) a user defines a set of propositional
symbols, like P and Q.
• User defines the semantics of each of these symbols.
• For example, P means "It is hot"
• Q means "It is humid"
• R means "It is raining"
11. • A sentence (also called a formula or well-formed formula) is
defined as:
• 1. A symbol
• 2. If S is a sentence, then ~S is a sentence, where "~" is the
"not" logical operator
• 3. If S and T are sentences, then (S v T), (S ^ T), (S => T), and
(S <=> T) are sentences, where the four logical connectives
correspond to "or," "and," "implies," and "if and only if,"
respectively
12. • Examples of PL sentences:
• (P ^ Q) => R (here meaning "If it is hot and humid, then it is
raining")
• Q => P (here meaning "If it is humid, then it is hot")
• Q (here meaning "It is humid.")
13. • Interpretation of the sentence :
• Given the truth values of all of the constituent symbols in a
sentence, that sentence can be "evaluated" to determine its
truth value (True or False). This is called an interpretation of
the sentence.
• Model : A model is an interpretation (i.e., an assignment of
truth values to symbols) of a set of sentences such that each
sentence is True. A model is just a formal mathematical
structure that "stands in" for the world.
• Tautology : A valid sentence (also called a tautology) is a
sentence that is True under all interpretations. Hence, no
matter what the world is actually like or what the semantics is,
the sentence is True. For example "It's raining or it's not
raining."
14. If you listen you will hear what I’m saying
You are listening
Therefore, you hear what I am saying
Valid Arguments in Propositional Logic
Is this a valid argument?
Let p represent the statement “you listen”
Let q represent the statement “you hear what I am saying”
The argument has the form:
15. Valid Arguments in Propositional Logic
is a tautology (always true)
This is another way of saying that
16. Valid Arguments in Propositional Logic
When we replace statements/propositions with propositional variables
we have an argument form.
Defn:
An argument (in propositional logic) is a sequence of propositions.
All but the final proposition are called premises.
The last proposition is the conclusion
The argument is valid iff the truth of all premises implies the conclusion is true
An argument form is a sequence of compound propositions
17. Valid Arguments in Propositional Logic
The argument form with premises
and conclusion
is valid when is a tautology
We prove that an argument form is valid by using the laws of inference
But we could use a truth table. Why not?
18. Rules of Inference for Propositional Logic
modus ponens
modus ponens (Latin) translates to “mode that affirms”
The 1st
law
19. Rules of Inference for Propositional Logic modus ponens
If it’s a nice day we’ll go to the Park. Assume the hypothesis
“it’s a nice day” is true. Then by modus ponens it follows that
“we’ll go to the Park”.
21. • Constructive Dilemma
• (P→Q) ∧ (R →S)
• P ∨ R
• ∴Q ∨ S
• Destructive Dilemma
• (P→Q) ∧ (R →S)
• ~Q ∨ ~S
• ∴~P ∨ ~R
• DeMorgan's law is also applicable in logic machines.
22. You might think of this as some sort of game.
You are given some statement, and you want to see if it is a
valid argument and true
You translate the statement into argument form using propositional
variables, and make sure you have the premises right, and clear what
is the conclusion
You then want to get from premises/hypotheses (A) to the conclusion (B)
using the rules of inference.
So, get from A to B using as “moves” the rules of inference
Another view on what we are doing
23. Using the resolution rule (an example)
1. Tom is skiing or it is not snowing.
2. It is snowing or Bart is playing hockey.
3. Consequently Tom is skiing or Bart is playing hockey.
We want to show that (3) follows from (1) and (2)
24. Using the resolution rule (an example)
1. Tom is skiing or it is not snowing.
2. It is snowing or Bart is playing hockey.
3. Consequently Tom is skiing or Bart is playing hockey.
propositions
hypotheses
Consequently Tom is skiing or Bart is playing hockey
Resolution rule
25. Rules of Inference & Quantified Statements
All men are Mortal, said Jane
John is a man
Therefore John is Mortal
Above is an example of a rule called “Universal Instantiation”.
We conclude P(c) is true, where c is a particular/named element
in the domain of discourse, given the premise
27. Rules of Inference & Quantified Statements
All men are Mortal said Jane
John is a man
Therefore John is Mortal
premises
premises
28.
29. Using the rules of inference to build arguments An example
It is not sunny this afternoon and it is colder than yesterday.
If we go swimming it is sunny.
If we do not go swimming then we will take a canoe trip.
If we take a canoe trip then we will be home by sunset.
We will be home by sunset
30. Using the rules of inference to build arguments An example
1. It is not sunny this afternoon and it is colder than yesterday.
2. If we go swimming it is sunny.
3. If we do not go swimming then we will take a cycle trip.
4. If we take a cycle trip then we will be home by sunset.
5. We will be home by sunset
propositions hypotheses