66

Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Embed Size (px)

Citation preview

Page 1: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different
Page 2: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

ObjectivesLearn the definitions of trees, lattices, and graphsLearn about state and problem spacesLearn about AND-OR trees and goalsExplore different methods and rules of inferenceLearn the characteristics of first-order predicate

logic and logic systems

2

Page 3: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

ObjectivesDiscuss the resolution rule of inference,

resolution systems, and deductionCompare shallow and causal reasoningHow to apply resolution to first-order predicate

logicLearn the meaning of forward and backward

chaining

3

Page 4: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

ObjectivesExplore additional methods of inference

Learn the meaning of Metaknowledge

Explore the Markov decision process

4

Page 5: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

TreesA tree is a hierarchical data structure consisting

of:Nodes – store informationBranches – connect the nodes

The top node is the root, occupying the highest hierarchy.

The leaves are at the bottom, occupying the lowest hierarcy.

5

Page 6: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

TreesEvery node, except the root, has exactly one

parent.

Every node may give rise to zero or more child nodes.

A binary tree restricts the number of children per node to a maximum of two.

Degenerate trees have only a single pathway from root to its one leaf.

6

Page 7: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Figure 3.1 Binary Tree

7

Page 8: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

GraphsGraphs are sometimes called a network or net.A graph can have zero or more links between

nodes – there is no distinction between parent and child.

Sometimes links have weights – weighted graph; or, arrows – directed graph.

Simple graphs have no loops – links that come back onto the node itself.

8

Page 9: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

GraphsA circuit (cycle) is a path through the graph beginning

and ending with the same node.Acyclic graphs have no cycles.Connected graphs have links to all the nodes.Digraphs are graphs with directed links.Lattice is a directed acyclic graph.A Degenerate tree is a tree with only a single path from

the root to its one leaf.

9

Page 10: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Figure 3.2 Simple Graphs

10

Page 11: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Making DecisionsTrees / lattices are useful for classifying objects

in a hierarchical nature.

Trees / lattices are useful for making decisions.

We refer to trees / lattices as structures.

Decision trees are useful for representing and reasoning about knowledge.

11

Page 12: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Binary Decision TreesEvery question takes us down one level in the

tree.A binary decision tree having N nodes:

All leaves will be answers.All internal nodes are questions.There will be a maximum of 2N answers for N

questions.Decision trees can be self learning.Decision trees can be translated into production

rules.

12

Page 13: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Decision Tree Example

13

Page 14: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

State and Problem SpacesA state space can be used to define an object’s

behavior.

Different states refer to characteristics that define the status of the object.

A state space shows the transitions an object can make in going from one state to another.

14

Page 15: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Finite State MachineA FSM is a diagram describing the finite number

of states of a machine.At any one time, the machine is in one particular

state.The machine accepts input and progresses to the

next state.FSMs are often used in compilers and validity

checking programs.

15

Page 16: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Using FSM to Solve Problems

Characterizing ill-structured problems – one having uncertainties.

Well-formed problems:

Explicit problem, goal, and operations are knownDeterministic – we are sure of the next state when an

operator is applied to a state.The problem space is bounded.The states are discrete.

16

Page 17: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Figure 3.5 State Diagram for a Soft Drink Vending Machine Accepting Quarters (Q) and Nickels (N)

17

Page 18: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

18

Page 19: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

AND-OR Trees and Goals1990s, PROLOG was used for commercial

applications in business and industry.PROLOG uses backward chaining to divide

problems into smaller problems and then solves them.

AND-OR trees also use backward chaining.AND-OR-NOT lattices use logic gates to

describe problems.

19

Page 20: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

20

Page 21: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

21

Page 22: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Types of LogicDeduction – reasoning where conclusions must

follow from premises (general to specific)

Induction – inference is from the specific case to the general

Intuition – no proven theory-Recognizing a pattern(unconsciously) ANN

Heuristics – rules of thumb based on experience

Generate and test – trial and error – often used to reach efficiency.

22

Page 23: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Types of LogicAbduction – reasoning back from a true condition to the

premises that may have caused the conditionDefault – absence of specific knowledgeAutoepistemic – self-knowledge…The color of the sky as

it appears to you.Nonmonotonic – New evidence may invalidate previous

knowledgeAnalogy – inferring conclusions based on similarities

with other situations ANNCommonsense knowledge – A combination of all based

on our experience

23

Page 24: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Deductive LogicArgument – group of statements where the last is

justified on the basis of the previous ones

Deductive logic can determine the validity of an argument.

Syllogism – has two premises and one conclusion

Deductive argument – conclusions reached by following true premises must themselves be true

24

Page 25: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Syllogisms vs. RulesSyllogism:

All basketball players are tall.Jason is a basketball player.

Jason is tall.

IF-THEN rule:IF All basketball players are tall and

Jason is a basketball player

THEN Jason is tall.

25

Page 26: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Categorical SyllogismPremises and conclusions are defined using

categorical statements of the form:

26

Page 27: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Categorical Syllogisms

27

Page 28: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Categorical Syllogisms

28

Page 29: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Proving the Validity of Syllogistic Arguments Using Venn Diagrams

1. If a class is empty, it is shaded.2. Universal statements, A and E are always drawn

before particular ones.3. If a class has at least one member, mark it with an *.4. If a statement does not specify in which of two

adjacent classes an object exists, place an * on the line between the classes.

5. If an area has been shaded, no * can be put in it.

Review pages 131 to 135

29

Page 30: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Proving the Validity of Syllogistic Arguments Using Venn Diagrams

30

Invalid

Valid

Page 31: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Proving the Validity of Syllogistic Arguments Using Venn Diagrams

31

Valid

Page 32: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Rules of InferenceVenn diagrams are insufficient for complex

arguments.

Syllogisms address only a small portion of the possible logical statements.

Propositional logic offers another means of describing arguments Variables

32

Page 33: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Direct Reasoning Modus Ponens

33

Page 34: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Truth Table Modus Ponens

34

Page 35: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Some Rules of Inference

35

(Modus Ponens)

Page 36: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Rules of Inference

36

Page 37: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

The Modus Meanings

37

Page 38: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

The Conditional and Its Variants

38

Page 39: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Requirements of a Formal System

1. An alphabet of symbols

2. A set of finite strings of these symbols, the wffs.

3. Axioms, the definitions of the system.

4. Rules of inference, which enable a wff to be deduced as the conclusion of a finite set of other wffs – axioms or other theorems of the logic system.

39

Page 40: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Requirements of a FS Continued

5. Completeness – every wff can either be proved or refuted.

6. The system must be sound – every theorem is a logically valid wff.

40

Page 41: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Logic SystemsA logic system consists of four parts:Alphabet: a set of basic symbols from which

more complex sentences are made.Syntax: a set of rules or operators for

constructing expressions (sentences).Semantics: for defining the meaning of the

sentencesInference rules: for constructing semantically

equivalent but syntactically different sentences

41

Page 42: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

WFF and Wang’s Propositional Theorem Proofer

Well Formed Formula for Propositional CalculusWang’s Propositional Theorem Proofer

Handouts are provided in the class

42

Page 43: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Predicate Logic

Syllogistic logic can be completely described by predicate logic.

The Rule of Universal Instantiation states that an individual may be substituted for a universe.

Compared to propositional logic, it has predicates, universal and existential quantifies.

43

Page 44: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Predicate LogicThe following types of symbols are

allowed in predicate logic:TermsPredicatesConnectivesQuantifiers

44

Page 45: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Predicate LogicTerms:Constant symbols: symbols, expressions, or

entities which do not change during execution (e.g., true / false)

Variable symbols: represent entities that can change during execution

Function symbols: represent functions which process input values on a predefined list of parameters and obtain resulting values

45

Page 46: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Predicate LogicPredicates:Predicate symbols: represent true/false-type

relations between objects. Objects are represented by constant symbols.

46

Page 47: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Predicate LogicConnectives:ConjunctionDisjunctionNegationImplicationEquivalence… (same as for propositional calculus)

47

Page 48: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Predicate LogicQuantifiers:valid for variable symbolsExistential quantifier: “There exists at least

one value for x from its domain.”Universal quantifier: “For all x in its domain.”

48

Page 49: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

First-Order LogicFirst-order logic allows quantified variables

to refer to objects, but not to predicates or functions.

For applying an inference to a set of predicate expressions, the system has to process matches of expressions.

The process of matching is called unification.

49

Page 50: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

PROLOGProgramming in Logic

50

Page 51: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

PROLOG: Horn Clauses

51

Page 52: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

PROLOG: Facts

52

Page 53: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Knowledge Representation

53

Page 54: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

PROLOG: Architecture

54

Page 55: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Family Example: Facts

55

Page 56: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Family Example: Rules

56

Page 57: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

PROLOG Sample Dialogue

57

Page 58: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

PROLOG Sample Inference

58

Page 59: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

PROLOG Sample Inference

59

Page 60: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Shallow and Causal Reasoning

Experiential knowledge is based on experience.In shallow reasoning, there is little/no causal

chain of cause and effect from one rule to another.Advantage of shallow reasoning is ease of

programming.Frames are used for causal / deep reasoning.Causal reasoning can be used to construct a

model that behaves like the real system.

60

Page 61: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

ChainingChain – a group of multiple inferences that

connect a problem with its solutionA chain that is searched / traversed from a

problem to its solution is called a forward chain.A chain traversed from a hypothesis back to the

facts that support the hypothesis is a backward chain.

Problem with backward chaining is find a chain linking the evidence to the hypothesis.

61

Page 62: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Causal Forward Chaining

62

Page 63: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Backward Chaining

63

Page 64: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Some Characteristics of Forward and Backward Chaining

64

Page 65: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

Figure 3.14 Types of Inference

65

Page 66: Objectives Learn the definitions of trees, lattices, and graphs Learn about state and problem spaces Learn about AND-OR trees and goals Explore different

MetaknowledgeThe Markov decision process (MDP) is a good

application to path planning.In the real world, there is always uncertainty, and

pure logic is not a good guide when there is uncertainty.

A MDP is more realistic in the cases where there is partial or hidden information about the state and parameters, and the need for planning.

66