1 views

Uploaded by Bunty Parekh

Hmm

- A Further Note on Hetucakradamaru 8-9
- Paper
- Robotics (17)
- logic
- Knowledge representation
- Artificial Intelligence
- Pmr English 2009 Types of Connectors
- INFERENCE 3.2.3
- Neural Fuzzy Systems Lecture
- L1
- Prolog Tutorial
- Paper8-Development of Knowledge Base Expert System for Natural Treatment of Diabetes Disease
- Business Mathematics Logic
- Artificial Intelligence Research Paper
- 23
- Fuzzy Decision Making_2
- Assumptions and Conclusions
- Generosity of Formal Language-stall
- PLJ Volume 23 Number 1 -02- Editorial - A Word More on Moncado v. Peoples Court Et. Al. (1)
- Logic

You are on page 1of 48

Knowledge in AI

• To solve complex problems we need:

1. Large amount of knowledge

2. Mechanism for representation and manipulation

of existing knowledge to create new solution.

• Knowledge in AI studies can be represented

using logic, structure, semantics, ES rules etc.

• The language of logic can be used for the

representations of facts.

Knowledge Representation

• Knowledge Representation

– Facts: Things we want to represent. Truth in

some relevant world.

– Representation of facts.

Good Knowledge representation should

exhibit

1. Representational Adequacy: Ability to represent all

kinds of knowledge that are needed in the domain.

2. Inferential Adequacy: Ability to manipulate

representational structures such that new

knowledge can be derived/inferred from the old.

3. Inferential efficiency: Ability to incorporate additional

information into an existing knowledge base that

can be used to focus the attention of inference

mechanisms in the most promising direction.

4. Adequistional efficiency: Ability to easily acquire

new information.

Approaches to KR

1. Simple relational knowledge:

• Provides very weak inferential capabilities.

• May serve as the input to powerful inference engines.

Player Height Weight handed

Peter 6-0 180 right

Ajay 5-10 170 left

John 6-2 215 left

Vickey 6-3 205 right

particular bowler” .

10

Approaches to KR

2. Inheritable knowledge:

• Objects are organized into classes and classes are

organized in a generalization hierarchy.

• Inheritance is a powerful form of inference, but not

adequate.

• Ex. Property inheritance inference mechanism.

isa handed

Adult male Person Right

instance

Works_at

Approaches to KR

3. Inferential knowledge:

• Facts represented in a logical form, which facilitates

reasoning.

• An inference engine is required.

2. “All men are mortal”

Implies:

3. “Marcus is mortal” 12

Approaches to KR

4. Procedural knowledge:

• Representation of “how to make it” rather than “what

it is”.

• May have inferential efficiency, but no inferential

adequacy and acquisitional efficiency.

• Ex. Writing LISP programs

8

Logic

• Logic is an “algebra” for manipulating only two values:

true (T) and false (F)

• Nevertheless, logic can be quite challenging

his talk will cover:

– Propositional logic--the simplest kind

– Predicate logic (predicate calculus)--an extension of

propositional logic

– Resolution theory--a general way of doing proofs in predicate

logic

– Possibly: Conversion to clause form

– Possibly: Other logics (just to make you aware that they exist)

Propositional logic

Propositional logic consists of:

The logical values true and false (Tand F)

Propositions: “Sentences,” which

Are atomic (that is, they must be treated as indivisible units, with no

internal structure), and

Have a single logical value, either true or false

Operators, both unary and binary; when applied to logical

values, yield logical values

The usual operators are and, or, not, and implies

Truth tables

• Logic, like arithmetic, has operators, which apply to one, two,

or more values (operands)

• A truth table lists the results for each possible

arrangement of operands

• Order is important: x op y may or may not give the same

result as y op x

The rows in a truth table list all possible sequences of truth

values for n operands, and specify a result for each sequence

1

Propositional logic

• Statements used in mathematics.

• Proposition :is a declarative sentence whose value is

either true or false.

• We can easily represent real world facts as logical propositions

written as well-formed formulas (wff’s).

Examples:

• “The sky is blue.” [Atomic Proposition]

• “The sky is blue and the plants are green.”

[Molecular/Complex Proposition]

• “Today is a rainy day” [Atomic Proposition]

• “Today is Sunday” [Atomic Proposition]

• “ 2*2=4” [Atomic Proposition]

12

World

A world is a collection of prepositions and logical

expressions relating those prepositions

Example:

Propositions: JohnLovesMary, MaryIsFemale, MaryIsRich

Expressions:

MaryIsFemale MaryIsRich JohnLovesMary

A proposition “says something” about the world, but

since it is atomic (you can’t look inside it to see

component parts), propositions tend to be very

specialized and inflexible

13

Model

A model is an assignment of a truth value to each proposition, for

example:

JohnLovesMary: T, MaryIsFemale: T, MaryIsRich: F

An expression is satisfiable if there is a model for which the

expression is true

For example, the above model satisfies the expression

MaryIsFemale MaryIsRich JohnLovesMary

An expression is valid if it is satisfied by every model

This expression is not valid:

But this expression is valid:

MaryIsFemale MaryIsFemale JohnLovesMary

14

Terminologies in propositional algebra

• Statement: sentence that can be true/false.

• Properties:

Satisfiability: a sentence is satisfy able if there is an

interpretation for which it is true.

Eg.”we wear woolen cloths”

sentence is true.

Eg. “Japan is capital of India”

Eg. “Delhi is the capital of India”

Inference Rules:

Implication elimination

A particularly important rule allows you to get rid of the

implication operator, :

X Y X Y

We will use this later on as a necessary tool for

simplifying logical expressions

The symbol means “is logically equivalent to”

Conjunction elimination

Another important rule for simplifying logical

expressions allows you to get rid of the conjunction

(and) operator, :

This rule simply says that if you have an and operator at

the top level of a fact (logical expression), you can

break the expression up into two separate facts:

MaryIsFemale MaryIsRich

becomes:

MaryIsFemale

MaryIsRich

Inference by computer

To do inference (reasoning) by computer is basically a search

process, taking logical expressions and applying inference

rules to them

Which logical expressions to use?

Which inference rules to apply?

Usually you are trying to “prove” some particular statement

Example:

it_is_raining it_is_sunny

it_is_sunny I_stay_dry

it_is_rainy I_take_umbrella

I_take_umbrella I_stay_dry

To prove: I_stay_dry

Forward and backward

reasoning

Situation: You have a collection of logical expressions

(premises), and you are trying to prove some additional

logical expression (the conclusion)

You can:

Do forward reasoning: Start applying inference rules to the

logical expressions you have, and stop if one of your results is

the conclusion you want

Do backward reasoning: Start from the conclusion you want,

and try to choose inference rules that will get you back to the

logical expressions you have

With the tools we have discussed so far, neither is

feasible

Example

Given:

it_is_raining it_is_sunny

it_is_sunny I_stay_dry

it_is_raining I_take_umbrella

I_take_umbrella I_stay_dry

You can conclude:

it_is_sunny it_is_raining

I_take_umbrella it_is_sunny

I_take_umbrella I_stay_dry

Etc., etc. ... there are just too many things you can conclude!

BASICS for Predicate Logic

• Logical expressions are built out of components

– Objects (Constants)

– Variables

– Functions

• The above three are called Terms

– Predicates

– Connectives

– Quantifiers

Objects

• Symbols that denote specific things or

individuals

– JOHN

– MARY

– BASKETBALL

– TRIANGLE

Variables

• Unspecific references to objects: x, y, z

• Functions

– An argument to a function is either an object or a

variable

– Starting with a lowercase letter

– The value of a function is either an object or a variable

– exp(0) = 1

– next-day(THURSDAY) = FRIDAY

– brother(JOHN) = JIM

Predicates

(or functions returning True or False)

• Functions which denote attributes of objects

or relationships between individuals

• - Starting with a uppercase letter

– Loves(JOHN, MARY)

– Man(SOCRATES)

– Sunny(THURDAY)

Connectives

• Logical operators which computes truth values

• ^ AND

• OR

• ¬ NOT

• IMPLIES

• Quantifiers

– Logical operators which assert the scope of a

predicate

– For All (universal quantifier)

– There Exists (existential quantifier)

Examples for Conversionfrom Natural

Language Sentences to Predicate Logic

– man(Marcus)

• Marcus was a Pompeian

– pompeian(Marcus)

• All Pompeians were Romans

– x: [Pompeian(x) Roman(x)]

• Caesar was a ruler

– ruler(Caesar)

• All Romans were either loyal to Caesar or

hated him

– x :Roman(x) loyalto(x,Caesar)

Hate(x,Caesar)

• Everyone is loyal to someone

– x: y loyalto(x,y)

• People only try to assassinate rulers they

aren't loyal to

– x: y: person(x) ^ ruler(y) ^ tryassassinate(x,y)

¬loyalto(x,y)

• Marcus tried to assassinate Caesar

– tryassassinate(Marcus, Caesar)

• Was Marcus loyal to Caesar?

¬loyalto(Marcus,Caesar)

Inference

• Infer means " to derive as a conclusion from facts or

premises".

• There are 2 common rules for deriving new facts from

rules and known facts. These are Modus Ponens and

Modus Tollens.

• Modus Ponens: most common inference strategy

simple , reasoning based on it is easily understood.

• The rule states that when A is known to be true and if a

rule states " If A then B "

it is valid to conclude that B is true.

• e.g. from “If John loves Mary, Mary is happy” and

“John loves Mary,” “Mary is happy” is inferred.

Resolution

• Resolution produces proofs by refutation

(action of proving).

• That is to prove statement, resolution

attempts to show, that the negation of that

statement contrasts.

• Clause Normal Form (CNF) is the form used by

resolution inference rule.

CNF

• Clause Normal Form (CNF) is a sub-language

of 1st order logic.

• There are satisfiability preserving

transformations from 1st order logic to CNF.

• i.e., if a set of (1st order) formulae are

satisfiable, then their CNF is satisfiable.

• Conversely is also true.

Transforming to CNF (Algorithm Steps):

1. Eliminate ->

2. Reduce the scope of each ¬ to a single term

3. Standardize variables so that each quantifiers binds a

unique variable.

4. Move all the quantifies to the left of the formula without

changing their relative order.

5. Eliminate existential quantifier.

6. Drop the prefix.

7. Convert the matrix into a conjunctions of disjunctions.

8. Create separate clause corresponding to each conjunct.

9. Standardize apart the variables in the set of clauses

generated in step 8.

Transforming to CNF.

• The first operation is to simplify the formulae

so that they contain only

the ∀, ∃, &, | and ~ connectives.

Simplify

Formula Rewrites to

(P | Q) &

P <~> Q

(~P | ~Q)

(P => Q) &

P <=> Q

(Q => P)

P => Q ~P | Q

• The second operation is to move negations

in so that they apply to only atoms.

• This is done by using known logical identities

(including De Morgan's laws), which are easily

verified as above.

Move negations in

Formula Rewrites to

~∀X P ∃X ~P

~∃X P ∀X ~P

~(P & Q) (~P | ~Q)

~(P | Q) (~P & ~Q)

~~P P

• The third operation is to move quantifiers

out so that each formula is in the scope of all

the quantifiers in that formula.

Move quantifiers out

Formula Rewrites to

∀X P & Q ∀X (P & Q)

∃X P & Q ∃X (P & Q)

Q & ∀X P ∀X (Q & P)

Q & ∃X P ∃X (Q & P)

∀X P | Q ∀X (P | Q)

∃X P | Q ∃X (P | Q)

Q | ∀X P ∀X (Q | P)

Q | ∃XP ∃X (Q | P)

• The fourth operation is to Skolemize to

remove existential quantifiers.

• This step replaces existentially quantified

variables by Solemn functions and removes all

quantifiers.

Skolemize

Formula Rewrites to

Initially Set γ = {}

∀X P P

and set γ = γ ∪ {X}

∃X P P[X/x(γ)]

where x is a new

Skolem functor

• The fifth operation is to distribute

disjunctions so that the formulae are

conjunctions of disjunctions.

• After distributing disjunctions the formulae

are in conjunctive normal form.

Distribute disjunctions

Formula Rewrites to

(P | Q) &

P | (Q & R)

(P | R)

(Q | P) &

(Q & R) | P

(R | P)

Example

Example

1st order formula

∀Y (∀X (taller(Y,X) | wise(X)) => wise(Y))

Simplify

∀Y (~∀X (taller(Y,X) | wise(X)) | wise(Y))

Move negations in

∀Y (∃X (~taller(Y,X) & ~wise(X)) | wise(Y))

Move quantifiers out

∀Y (∃X ((~taller(Y,X) & ~wise(X)) | wise(Y)))

Skolemize

∃X ((~taller(Y,X) & ~wise(X)) | wise(Y)) γ = {Y}

(~taller(Y,x(Y)) & ~wise(x(Y))) | wise(Y)

Distribute disjunctions

(~taller(Y,x(Y)) | wise(Y)) & (~wise(x(Y)) | wise(Y))

Convert to CNF

{ ~taller(Y,x(Y)) | wise(Y),

~wise(x(Y)) | wise(Y) }

Non-monotonic Reasoning

• In real world some problems are uncertain

and fuzzy.

• The different approaches to handle these are:

– Non-monotonical reasoning: In which the facts

and the rules of inference are extended to make it

possible to reason with incomplete information.

– Statistical Reasoning: In which the representation

is extended to allow some kind of numeric

measure of certainty to be associated with each

statement.

Key issues in non-monotonic reasoning

• How can the knowledge base be extended to

allow inferences to be made on the basis of lack

of knowledge as well as on the presence of it?

• How can the knowledge base be updated

properly when a new fact added to the system? –

To keep proofs called justification.

• How can knowledge be used to help resolve

conflicts when there are several inconsistent non-

monotonic inferences that can be drawn?

Default Reasoning (Non monotonic

reasoning)

• Draw conclusions based on what is most likely

to be true.

• Two common kinds of non-monotonic

reasoning:

– Abduction

– Inheritance

Abduction

Abduction is the qaulitative,everyday reasoning.

Deduction shows that something must be,

induction shows that something exists, and

abduction shows that something mabye.

Abduction is that starting point of all research.

for any expressions A and B if it is consistent to

assume A, do so.

Inheritance

• An object inherits attribute values from all the

classes of which it is a member unless doing

so leads to contradiction, in which case a

value from a more restricted class has

precedence over value from broader class.

Probabilistic Reasoning

• An important goal of many problem solving

systems is to collect evidence as the system

goes along and to modify its behavior on the

basis if the evidence.

• To model this behavior, need statistical theory

of evidence.

Bayes Theorem

• P(H i|E) = the probability that hypothesis Hi is true given

evidence E

that hypothesis Hi is true

is true in the absence of any specific evidence. These

probabilities are called prior probabilities or prios

Example

• S:patient has spots

• M:patient has measles

• F:patient has high fever

we cannot just sum their effects.

• There is a need to represent explicitly the conditional

probability that arises from their conjunction

• In general, given a prior body of evidence e and some

new observation E, we need to compute

P(H|E,e) = P(H|E). P(e|E,H)

P(e|E)

Bayes' theorem is intractable for several

reasons:

– The knowledge acquisition problem is

insurmountable (too great to overcome)

probabilities is too large

too large

- A Further Note on Hetucakradamaru 8-9Uploaded bySammasam Buddha
- PaperUploaded byAftab Rasool Bhatti
- Robotics (17)Uploaded byapi-19801502
- logicUploaded byIlduceGaribaldi
- Knowledge representationUploaded byPiyush Kochhar
- Artificial IntelligenceUploaded bykenshinmanjaro
- Pmr English 2009 Types of ConnectorsUploaded byFoo Chi Khing
- INFERENCE 3.2.3Uploaded byPantatNyanehBurik
- Neural Fuzzy Systems LectureUploaded bydaniel
- L1Uploaded byAnnaGrigoryan
- Prolog TutorialUploaded byRafia Tausif
- Paper8-Development of Knowledge Base Expert System for Natural Treatment of Diabetes DiseaseUploaded byEditor IJACSA
- Business Mathematics LogicUploaded bySufi Khan
- Artificial Intelligence Research PaperUploaded byJo
- 23Uploaded byAnkita Tapadia
- Fuzzy Decision Making_2Uploaded byGanesh Arora
- Assumptions and ConclusionsUploaded byJojoi N Jecah
- Generosity of Formal Language-stallUploaded bytamodeb2
- PLJ Volume 23 Number 1 -02- Editorial - A Word More on Moncado v. Peoples Court Et. Al. (1)Uploaded byKristine
- LogicUploaded byVishal Gaur
- GlossaryUploaded byvlorbik
- Comins v. Van Voorhis Response in Opposition to MSJUploaded bySiouxsie Law
- DreamingUploaded byEphrayim Odor
- criterion c planningUploaded byapi-241145590
- Reaction PaperUploaded byMisna Blasco Zurbano
- 10.1007_BF00247954Uploaded byClaudio Conforti
- PhilUploaded byEvan Simpkins
- philo 105 propositional logic packetUploaded byapi-196193978
- Entrevista Com Francesco BertoUploaded bykkadilson
- Knowing by Imagining by Timothy WilliamsonUploaded byTh

- Legal Knowledge and Analogy: Fragments of Legal Epistemology, Hermeneutics and Linguistics - P. Nerhot.pdfUploaded byFermin Marconi
- Case Study MethodologyUploaded bysankofakanian
- MBA Slides ResearchUploaded bynkhata
- AMCAT ReportUploaded bygauravshastri140
- [Octavio Roca and Matthew Schuh] Powerful Ideas a(B-ok.org)Uploaded byFray Alexus Enriquez Mansueto
- educational psychologyUploaded bymc090201003
- DTRS8-MellesUploaded byAmmar Attar
- Byrd-The Epistemology of ScienceUploaded bysoliloquium47
- Fall 2007Uploaded bybhardin4411
- Emerging ParadigmsUploaded byGustavo Leyes
- Liveable Public SpacesUploaded byrasmussenchristina
- 160495 Artificial Intelligence Template 16x9Uploaded byBunty Parekh
- Taste in ArchitetctureUploaded byFernanda Machado
- The Conceptual Confusion Infecting Every School of ThoughtUploaded byJohn Sobert Sylvest
- Scientific EpistemologyUploaded bynassir
- F. Thomas Burke, D. Micah Hester, Robert B. Talisse Deweys Logical Theory New Studies and Interpretations 2002Uploaded byanil_biswas7809
- Hoorcolleges Deel 2 - Philosophy of PsychologyUploaded byMartijn
- Develop a Distribution NetworkUploaded byswallow_razors
- Charmaz the Power and Potential Grounded TheoryUploaded byVizente Bizantino
- Abduction: A Categorical CharacterizationUploaded bymatt
- The Cynefin Mini Book OnlineUploaded bycass78
- oatley-inference.rtfUploaded byviolet_vortex
- Why is It Rational to Believe Scientific Theories Are TrueUploaded byJohn Steff
- A Critical Evaluation of the Religious Adequacy of Open Theism: Toward an Open Theistic Theology of Petitionary PrayerUploaded byTom
- Logical and Relational LearningUploaded byToepie da Katz
- Epistemic Circularity and Epistemic IncoUploaded bychiqui
- Qualitative Research as Methodical Hermeneutics.pdfUploaded byKrisdaryadiHadisubroto
- Crowdfunding thesisUploaded byjaloumai
- A Cognitive Approach to Narrative PlanningUploaded byTravis Jones
- Logic and Legal ReasoningUploaded byMarivic Samonte Viluan