1 Chapter 3 Knowledge Representation. 2 Chapter 3 Contents l The need for a good representation l Semantic nets l Inheritance l Frames l Object oriented.

Slides:



Advertisements
Similar presentations
Cooperating Intelligent Systems
Advertisements

Heuristic Search techniques
UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Chapter 4: Trees Part II - AVL Tree
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
More Graphs COL 106 Slides from Naveen. Some Terminology for Graph Search A vertex is white if it is undiscovered A vertex is gray if it has been discovered.
CS 484 – Artificial Intelligence
State Spaces Introduction to Artificial Intelligence Dr. Robin Burke.
State-Space Searches. State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Artificial Intelligence
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
Toy Problem: Missionaries and Cannibals
1 Chapter 3 Knowledge Representation. 2 Chapter 3 Contents l The need for a good representation l Semantic nets l Inheritance l Frames l Object oriented.
Structures and Strategies for State Space Search
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. ETC - 1 What comes next? Recursion (Chapter 15) Recursive Data Structures.
1 Solving Problems by Searching. 2 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space.
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
1 Chapter 15 Introduction to Planning. 2 Chapter 15 Contents l Planning as Search l Situation Calculus l The Frame Problem l Means-Ends Analysis l The.
Representation  A farmer wants to move himself, a hunrgry silver fox, a hungry, fat goose, and a sack of tasty grain across a river. Unfortunately, his.
1 Structures and Strategies for State Space Search 3 3.0Introduction 3.1Graph Theory 3.2Strategies for State Space Search 3.3Using the State Space to Represent.
CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 1 State-Space Search Outline: Demonstration with T* State spaces, operators, moves A Puzzle: The.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Solving Problems by Searching
State-Space Searches.
Knowledge Representation Semantic Network dan Frame.
1 Decrease-and-Conquer Approach Lecture 06 ITS033 – Programming & Algorithms Asst. Prof. Dr. Bunyarit Uyyanonvara IT Program, Image and Vision Computing.
1 Chapter 24 Developing Efficient Algorithms. 2 Executing Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
Artificial Intelligence LECTURE 3 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
13.2 Recursive Definitions Objective 1) Provide the recursive definition for sequences; 2) Identify the type of a sequence from a recursive definition.
Knowledge Representation CPTR 314. The need of a Good Representation  The representation that is used to represent a problem is very important  The.
1 CO Games Development 1 Week 11 Search Methods Gareth Bellaby.
Artificial Intelligence LECTURE 2 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
1 Chapter 15 Introduction to Planning. 2 Chapter 15 Contents l Planning as Search l Situation Calculus l The Frame Problem l Means-Ends Analysis l The.
Problem Representation
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
PROBLEM SOLVING – BASIC SEARCH METHODS 12/8/2015Dr. Sunil Kumar 1.
Problem Solving Agents
Problem Reduction So far we have considered search strategies for OR graph. In OR graph, several arcs indicate a variety of ways in which the original.
Problem Solving as Search. Problem Types Deterministic, fully observable  single-state problem Non-observable  conformant problem Nondeterministic and/or.
1 Solving Problems by Searching. 2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search.
M180: Data Structures & Algorithms in Java Trees & Binary Trees Arab Open University 1.
Computer Sciences Department1.  Property 1: each node can have up to two successor nodes (children)  The predecessor node of a node is called its.
Chapter 10: Trees A tree is a connected simple undirected graph with no simple circuits. Properties: There is a unique simple path between any 2 of its.
Knowledge Representation Fall 2013 COMP3710 Artificial Intelligence Computing Science Thompson Rivers University.
Introduction to State Space Search
1 Chapter 3 Knowledge Representation. 2 Chapter 3 Contents l The need for a good representation l Semantic nets l Inheritance l Frames l Object oriented.
G5AIAI Introduction to AI
1 Introduction to Artificial Intelligence l Topic 1. A Brief History to Artificial Intelligence n Why we focus on “weak AI”? n Who is Turing? l Topic 2.
Definition and Technologies Knowledge Representation.
Recursively Defined Sequences Lecture 40 Section 8.1 Wed, Apr 11, 2007.
CSC317 1 At the same time: Breadth-first search tree: If node v is discovered after u then edge uv is added to the tree. We say that u is a predecessor.
Artificial Intelligence & Knowledge Representation National Institute Of Science & Technology Sudeep Misra [1] Artificial Intelligence and Knowledge Representation.
Knowledge Representation
DAST Tirgul 7.
Problem solving by Searching
Decrease-and-Conquer Approach
DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++
Problem Solving as Search
ITEC 2620M Introduction to Data Structures
Knowledge Representation
Semantic Nets and Frames
HW 1: Warmup Missionaries and Cannibals
State-Space Searches.
State-Space Searches.
State-Space Searches.
Presentation transcript:

1 Chapter 3 Knowledge Representation

2 Chapter 3 Contents l The need for a good representation l Semantic nets l Inheritance l Frames l Object oriented programming l Search trees l Combinatorial explosion l Problem reduction

3 The Need for a Good Representation l A computer needs a representation of a problem in order to solve it. l A representation must be: nEfficient – not wasteful in time or resources. nUseful – allows the computer to solve the problem. nMeaningful – really relates to the problem.

4 Semantic Nets l A graph with nodes, connected by edges. l The nodes represent objects or properties. l The edges represent relationships between the objects.

5 A Simple Semantic Net

6 Inheritance l Inheritance is the process by which a subclass inherits properties from a superclass. l Example: nMammals give birth to live young. nFido is a mammal. nTherefore fido gives birth to live young. l In some cases, as in the example above, inherited values may need to be overridden. (Fido may be a mammal, but if he’s male then he probably won’t give birth).

7 Frames l A frame system consists of a number of frames, connected by edges, like a semantic net. l Class frames describe classes. l Instance frames describe instances. l Each frame has a number of slots. l Each slot can be assigned a slot value.

8 Frames: A Simple Example

9 Procedures and Demons l A procedure is a set of instructions associated with a frame (or a slot). l The procedure can be run upon request. l A demon is a procedure that is run automatically, usually triggered by an event such as when a value is: nRead nWritten nCreated nChanged

10 Object Oriented Programming l Object oriented programming languages such as Java, C++. l Use ideas such as: ninheritance nmultiple inheritance noverriding default values nprocedures and demons l Languages such as IBM’s APL2 use a frame based data structure.

11 Search Trees l Semantic trees – a type of semantic net. l Used to represent search spaces. l Root node has no predecessor. l Leaf nodes have no successors. l Goal nodes (of which there may be more than one) represent solutions to a problem.

12 Search Trees: An Example l A is the root node. l L is the goal node. l H, I, J, K, M, N and O are leaf nodes. l There is only one complete path: l A, C, F, L

13 Example: Missionaries and Cannibals l Three missionaries and three cannibals l Want to cross a river using one canoe. l Canoe can hold up to two people. l Can never be more cannibals than missionaries on either side of the river. l Aim: To get all safely across the river without any missionaries being eaten.

14

15 Original Version of the Problem l Three missionaries and three cannibals come to a river and find a boat that holds two. l If the cannibals ever outnumber the missionaries on either bank, the missionaries will be eaten. l How shall they cross?

16 A Representation l The first step in solving the problem is to choose a suitable representation. l We will show number of cannibals, missionaries and canoes on each side of the river. l Start state is therefore: n3,3,10,0,0

17 A Simpler Representation l In fact, since the system is closed, we only need to represent one side of the river, as we can deduce the other side. l We will represent the finishing side of the river, and omit the starting side. l So start state is: n0,0,0

18 Operators Now we have to choose suitable operators that can be applied: 1.Move one cannibal across the river. 2.Move two cannibals across the river. 3.Move one missionary across the river. 4.Move two missionaries across the river. 5. Move one missionary and one cannibal.

19 The Search Tree l Cycles have been removed. l Nodes represent states, edges represent operators. l There are two shortest paths that lead to the solution.

20 Different Versions? l What will happen if we have four cannibals and four missionary ?

21 Combinatorial Explosion l Problems that involve assigning values to a set of variables can grow exponentially with the number of variables. l This is the problem of combinatorial explosion. l Some such problems can be extremely hard to solve (NP-Complete, NP-Hard). l Selecting the correct representation can help to reduce this, as can using heuristics (see chapter 4).

22 Problem Reduction l Breaking a problem down into smaller sub- problems (or sub-goals). l Can be represented using goal trees (or and- or trees). l Nodes in the tree represent sub-problems. l The root node represents the overall problem. l Some nodes are and nodes, meaning all their children must be solved.

23 Problem Reduction: Example l E.g. to solve the Towers of Hanoi problem with 4 disks, you can first solve the same problem with 3 disks. l The solution is thus to get from the first diagram on the left, to the second, and then to apply the solution recursively.