21
Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

Embed Size (px)

Citation preview

Page 1: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

Cognitive Computing 2012

The computer and the mind

KNOWLEDGE REPRESENTATION (1)

Mark Bishop

Page 2: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 2

Knowledge representation Classically two forms of knowledge are invoked in the intelligent solution

of complex problems:

General background knowledge; ... of the problem domain.

Specific procedural knowledge; acquired via appropriate ‘knowledge acquisition’ ... defining how to solve the problem; utilised in knowledge processing (or reasoning).

Knowledge about a domain needs to be appropriately represented in the computer:

E.g. Using an example of tiling a chess board with missing corners, Newell and Simon demonstrated how an optimal knowledge representation format can ease the knowledge processing task.

In his essay on the Frame Problem Dennett shows how an intelligent system needs to processes knowledge efficiently – a walking encyclopaedia [knowledge stored seriatim] will still walk off the cliff unless it can extract knowledge about cliffs efficiently on demand.

Four major ‘Knowledge Representation’ techniques used in AI are: Logic, Semantic Networks, Frames and Production Systems.

Page 3: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 3

Representing the world with logic It is a foundational axiom of Logic - as a scheme for Knowledge Representation -

that there are two fundamental links between language and the world.

The first is that declarative sentences are true in some situations and not true in others. The second is that certain words/phrases refer to things in the world.

In ‘Propositional Logic’ we represent our beliefs about the world, (our knowledge), via a set of declarative sentences called ‘propositions’.

Sentences which express such beliefs are called, ‘Declarative sentences’.

A declarative sentence in English is one which that be put in place of ‘X’ in the following English question, “Is it true that, ‘X’ ”?

E.g. Is it true that, ‘Grass is green’?

Not all sentences state beliefs - some are questions and commands. E.g. “Pick up the book”

Page 4: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 4

Logic and belief LOGIC can be used to represent, analyse and reason about consistent

sets of belief.

Reasoning is valid if it moves from a premise to conclusion. Reasoning is valid iff the conclusion is logically entailed by the premises.

Consistency Consistent beliefs are compatible with one another.

i.e. All could be true together.

Inconsistent beliefs could not all be true together.

A single belief is consistent if there is some situation in which it could be true.

A inconsistent single belief is said to be self-contradictory and a contradiction.

Page 5: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 5

Two statements of belief ..

Which of the following shows inconsistent belief?

“I supported Spurs when I was five, West Ham when I was 10 and Arsenal when I was 15”.

On God’s omnipotence, “I believe God is all powerful because he can create a rock that no one can lift”.

Page 6: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 6

On truth – when is a sentence true?

In the Correspondence Theory of Truth, (from Aristotle), a sentence that refers to a true situation is called a fact and (in general) the truth condition is an objective feature of the world.

There is a ‘correspondence’ between the syntax of the sentence and an observed state of reality.

I.e. “Grass is green”, is TRUE because there is a feature of the world called grass with a property of colour, and (in general) the colour of grass corresponds to green.

Page 7: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 7

The coherence theory of truth In the Coherence Theory of Truth a proposition is a member of a body of

propositions and for the proposition to be true it must be, at least consistent and coherent with this body of propositions.

Hence, in the Coherence Theory of Truth, truth conditions are other propositions.

PROBLEM: consider two inconsistent propositions (a & b) which do not belong to a specified set, but are consistent with it; if coherence is consistency, the coherence theorist would have to claim that both propositions are true, but this is impossible.

E..g. set = {God is good; Good is omnipotent}; a = {Today is Monday}; b = {Today is Tuesday}

A second, more plausible, version of the coherence theory states that the coherence relation is some form of entailment. I.e. a proposition coheres with a set of propositions if and only if it is entailed by members of the set.

A third, more plausible, version of the theory (e.g. Bradley) is that coherence is mutual explanatory support between propositions.

Page 8: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

Truth and truth conditions

Thus the two competing theories - correspondence and coherence -give conflicting accounts of the relation between propositions and their truth conditions:

According to one, the relation is coherence, according to the other, it is correspondence.

The two theories also give conflicting accounts of truth conditions:

According to the coherence theory, the truth conditions of propositions consist in other propositions;

According to the other, the correspondence theory the truth conditions of propositions are not (in general) propositions, but rather objective features of the world; empirically derived facts.

10/04/23 (c) Bishop: An introduction to Cognitive Science 8

Page 9: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

Idealism and the coherence theory

Idealists are led to the coherence theory via their metaphysical position.

From the idealists' perspective, reality is something like a collection of beliefs. Consequently, the truth of a belief can only consist in its coherence with other

beliefs.

I.e. Idealists do not believe that there is an ontological distinction between beliefs and what makes beliefs true ...

... whereas in correspondence theory a belief is – most of the time - ontologically distinct from its truth conditions.

10/04/23 (c) Bishop: An introduction to Cognitive Science 9

Page 10: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 10

Truth, sentences and ambiguity

Ambiguity - can a sentence be understood in more than one - very different - way? Lexical ambiguity

Single word with more than one meaning. E.g. “Our mothers bore us.”

Structural ambiguity Context dependant meaning. E.g. “I heard about him at

the pub last night…”

When using logic as a means of knowledge representation care must be taken to avoid and delete any ambiguity in sentences.

Page 11: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 11

True, false and indeterminacy (1) For the purposes of our discussion logical truth is absolute;

it does not have degrees

Nonetheless there are often situations when the strict logical truth of a statement is indeterminate.

(1) Borderline cases / scaling. E.g. ‘David is wise’

Scaling adjectives may entail that a declarative sentence may not be definitely true and not definitely false, but indeterminate.

E.g. Adjectives such as tall, clever, fat etc.

In such situations ‘the sword of truth’ cuts the line somewhere between truth and falsity, but we cannot be sure exactly where.

Page 12: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 12

On truth and falsity (2) (2) Referential Failure

eg. “The King of America is bald”

Rules are sometimes broken. eg. Given there currently is no king of America, the above sentence has no reference and we say referential failure has occurred.

(3) Bizarre Situations eg. “This sentence is false”

Sometimes when a novel situation occurs it is so different from experience that the application of truth is impossible to specify. These are situations where we do not normally apply logic.

By default the convention we will employ is simply that any declarative sentence that is NOT TRUE must be FALSE. eg. “The King of America is bald” is FALSE.

Further, if statement A is “TRUEr” than statement B, then statement B is FALSE.

Page 13: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 13

Misleading sentences

These usually revolve around the common usage of the terms “and”, "all", “some" or “either”.

1. “I shot the sheriff and he fell to the floor”. When in fact the man fell to the floor and then I shot him.

2. After the Christmas party I admit to Katerina, my wife, that, “I did eat some of the crisps in the packet”.

When in fact I ate them all.

LOGIC has STRONG and WEAK conventions for dealing with these examples.

Page 14: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 14

The STRONG conventions

A AND B: implies A and then B.

ALL: implies at least one.

SOME: implies not all.

EITHER: implies not both.

Using the STRONG conventions examples (1 & 2) are FALSE.

The English language usually implies the STRONG conventions.

Page 15: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 15

The WEAK conventions

A AND B: does not imply order of A and B.

ALL: may imply none.

SOME: may imply all.

EITHER: may imply both.

Using the WEAK conventions examples (1 & 2) are TRUE.

Computational logic usually employs the WEAK conventions unless otherwise stated.

Page 16: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 16

Propositional calculus Using Propositional Calculus we represent knowledge about the world via

a set of declarative sentences called propositions.

Propositional Variables A propositional variable stands for some indivisible proposition.

eg. P = 'grass is green'.

Logical Connectives Connectives are rules for combining logical propositions to form new

statements.

The five most common logical connectives are: NOT: ~ or

¬ OR / DISJUNCTION / LOG.SUM: + or v AND / CONJUNCTION / LOG.PROD: . or ^ [MATERIAL] IMPLICATION: or EQUIVALENCE: or

Page 17: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 17

Tautology and fallacy

Tautology An expression which is always true irrespective what values are

assigned to its constituent parts is called a tautology. E.g. (P v ¬P).

Thus, if P = 'grass is green' we get the tautology, "grass is green OR NOT grass is green".

Fallacy (or Contradiction) An expression which is always false irrespective what values are

assigned to its constituent parts is called a fallacy or contradiction. E.g. (P ^ ¬P).

Thus, if P = 'grass is green' we get the contradiction, "grass is green AND NOT grass is green".

Page 18: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 18

Deductive inference Logic is a formal procedure where new facts (conclusions) can be deduced from a given

set using logical Rules of Inference. E.g. If a robot database contains the fact that:

All rectangles have four sides ... 1

... and also that:

A square is a rectangle ... 2

Then by correctly applying the Rules of Inference to the above facts the robot could deduce the following conclusion ...

A square has four sides ... 3

By this process the robot has deduced a new fact from previous information.

When the rules of inference are correctly applied to facts known to be true, any resulting new facts are guaranteed to be true.

Page 19: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 19

Non-deductive inference

If, during one evening at the New Cross House, I find that my drink has disappeared whilst I went to the toilet, I might infer that someone has stolen it rather than, say, a space alien materialised and drank it while I was gone.

Non-deductive inferences cannot be guaranteed true.

Page 20: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 20

Incorrect application of deductive inference If a robot database contains the fact that:

A square has four sides ... 1

... and also that:

A square is a shape ... 2

Then by applying the rules of inference to the above facts it may seem at first sight that we could deduce the following conclusion ...

A shape has four sides ... 3

However the above conclusion [3] is FALSE as the Rules-of-Inference have not been correctly applied.

The ‘is a’ connective is surjective (a one-to-many statement). It indicates set membership. Thus ‘a square’ is one member of the ‘set of shapes’. Hence, “A square is a shape” does not imply “A shape is a square”. Therefore we cannot substitute shape for square in proposition [1] to deduce the conclusion [3].

Page 21: Cognitive Computing 2012 The computer and the mind KNOWLEDGE REPRESENTATION (1) Mark Bishop

10/04/23 (c) Bishop: An introduction to Cognitive Science 21

Pros and cons of logic

Pros of Logical Knowledge Representation: Consistency - results are repeatable. Precision - all deductions correctly made using rules of logic

are ‘guaranteed’ correct. Algorithmic - due to its formal structure logic is easily

mechanised. Naturalness - logical expression of a problem often resembles

our intuitive understanding.

Cons of Logical Knowledge Representation: Formal structure not as flexible as other structures. Not suitable for representing ‘General Knowledge’, since no

provision for uncertainty (cf. fuzzy logic). Difficult to apply heuristics, hence large knowledge bases lead

to Combinatorial Explosion during the search process.