Knowledge Representation

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

AE1APS Algorithmic Problem Solving John Drake
CSC411Artificial Intelligence 1 Chapter 3 Structures and Strategies For Space State Search Contents Graph Theory Strategies for Space State Search Using.
Knowledge Representation
October 1, 2012Introduction to Artificial Intelligence Lecture 8: Search in State Spaces II 1 A General Backtracking Algorithm Let us say that we can formulate.
CS 484 – Artificial Intelligence
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
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
Structures and Strategies for State Space Search
1 Solving Problems by Searching. 2 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space.
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.
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.
Solving Problems by Searching
State-Space Searches.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
1 State Space of a Problem Lecture 03 ITS033 – Programming & Algorithms Asst. Prof.
Artificial Intelligence LECTURE 3 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
Knowledge Representation CPTR 314. The need of a Good Representation  The representation that is used to represent a problem is very important  The.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Artificial Intelligence LECTURE 2 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
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.
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.
Introduction to Artificial Intelligence CS 438 Spring 2008.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Knowledge Representation Fall 2013 COMP3710 Artificial Intelligence Computing Science Thompson Rivers University.
Chapter 5. Advanced Search Fall 2011 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
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.
A Brief History of AI Fall 2013 COMP3710 Artificial Intelligence Computing Science Thompson Rivers University.
G5AIAI Introduction to AI
Search Methodologies Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Artificial Intelligence Knowledge Representation.
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.
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
Chapter 12. Probability Reasoning Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Solving problems by searching
Knowledge Representation
Chapter 7. Propositional and Predicate Logic
Artificial Intelligence
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Chapter 9. Rules and Expert Systems
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
ECE 448 Lecture 4: Search Intro
Introduction to Artificial Intelligence
Problem Solving by Searching
Problem Solving as Search
Artificial Intelligence (CS 370D)
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSE 4705 Artificial Intelligence
Lectures on Graph Algorithms: searching, testing and sorting
Graphs.
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Artificial Intelligence
A General Backtracking Algorithm
Chapter 7. Propositional and Predicate Logic
Chapter 5. Advanced Search
Comp3710 Artificial Intelligence Thompson Rivers University
Chapter 9. Rules and Expert Systems
State-Space Searches.
ARTIFICIAL INTELLIGENCE
COMP3710 Artificial Intelligence Thompson Rivers University
State-Space Searches.
Search.
Search.
State-Space Searches.
Presentation transcript:

Knowledge Representation COMP3710 Artificial Intelligence Computing Science Thompson Rivers University

Knowledge Representation Course Outline Part I – Introduction to Artificial Intelligence Part II – Classical Artificial Intelligence, and Searching Knowledge Representation Searching Search Methodoloties Advanced Search Genetic Algorithms (relatively new study area) Knowledge Represenation and Automated Reasoning Propositinoal and Predicate Logic Inference and Resolution for Problem Solving Rules and Expert Systems Part III – Machine Learning Part IV – Some Advanced Topics TRU-COMP3710 Knowledge Representation

Knowledge Representation Unit Outcomes … TRU-COMP3710 Knowledge Representation

Knowledge Representation Reference Chapter 3. Knowledge Representation TRU-COMP3710 Knowledge Representation

Knowledge Representation Unit Outline Introduction The Need for a Good Representation Example: Semantic Nets Inheritance Example: Frames Object-Oriented Programming Search Spaces Semantic Trees Search Trees Combinatorial Explosion Problem Reduction Goal Trees TRU-COMP3710 Knowledge Representation

The Need for a Good Representation If, for a given problem, we have a means of checking a proposed solution, then we can solve the problem by testing all possible answers. – Marvin Minsky How to make a system solve a problem? A computer needs a formal representation (model) of a problem in order to solve it. A representation must be: Efficient – not wasteful in time or resources. Useful – allows the computer to solve the problem. Meaningful – really relates to the problem. Any good idea? TRU-COMP3710 Knowledge Representation

Example: Semantic Nets A semantic net is a graph with nodes, connected by edges. The nodes represent objects or properties. The edges represent relationships between the objects. TRU-COMP3710 Knowledge Representation

Knowledge Representation Inheritance Inheritance is the process by which a subclass inherits properties from a superclass. Example: Mammals give birth to live young. Fido is a mammal. Therefore fido gives birth to live young. 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). Can we expand semantic nets to include inheritance? TRU-COMP3710 Knowledge Representation

Knowledge Representation Example: Frames A sort of extension of semantic nets with inheritance A frame system consists of a number of frames, connected by edges, like a semantic net. Class frames describe classes. Instance frames describe instances. Each frame has a number of slots. Each slot can be assigned a slot value. How to implement? TRU-COMP3710 Knowledge Representation

Object-Oriented Programming Object oriented programming languages such as Java, C++. Use ideas such as: inheritance multiple inheritance overriding default values procedures and demons TRU-COMP3710 Knowledge Representation

Knowledge Representation Search Spaces [Q] Do we always need to use such representations (models) in the previous slides? Representation is really problem-specific. Many problems in AI can be represented as search spaces. A search space is a representation of the set of all possible choices (or states) in a given problem, one or more of which are the goal to the problem. A search space is a set of all possible states, where a state (oac node) is a set of values of all instances, and states are connected by paths that represent actions. [Q] Then state spaces are ??? Trees and graphs [Q] Are search spaces always limited? Not really Finite state machine (FSM)? TRU-COMP3710 Knowledge Representation

Knowledge Representation Search Trees Trees are easier to handle than graphs. Used to represent search spaces. Root node (i.e., state) has no predecessor. Which node in the above tree? Leaf nodes have no successors. Which nodes in the above tree? Goal nodes (of which there may be more than one) [Q] What is the problem then, when you know what the goal is? How to go to Vancouver from Kamloops? How about the 8-puzzle game? The missionaries and cannibals problem? The paths to goal nodes from the root node may represent solutions to a problem. [Q] What do we have to do when we do not know what the goal is? In some other problems, goal nodes are the solutions. (In this case, goals are not known. But we know what goals are like.) n-Queens problem Graph coloring problem TRU-COMP3710 Knowledge Representation

Knowledge Representation Search Trees H, I, J, K, M, N and O are leaf nodes. A is the root node. L is the goal node. There is only one complete path to L from A: A, C, F, L [Q] How to find the path from the root to the goal node? TRU-COMP3710 Knowledge Representation

Search Trees – Missionaries & Cannibals Three missionaries and three cannibals want to cross a river using one canoe. Canoe can hold up to two people. Can never be more cannibals than missionaries on either side of the river. Aim: To get all safely across the river without any missionaries being eaten. [Q] How to solve? TRU-COMP3710 Knowledge Representation

Search Trees – Missionaries & Cannibals The first step in solving the problem is to choose a suitable representation, i.e., a state (a set of values of all instances) of the problem. Environment and variables in the problem. We will need to trace the number of cannibals, missionaries and canoes on each side of the river. Start state is therefore: (# of cannibals, # of missionaries, # of boats) at the both sides (3,3,1) at the starting side; (0,0,0) at the ending side In fact, since the system is closed, we only need to represent one side of the river, as we can deduce the other side. We will represent the finishing side of the river, and omit the starting side. [Q] So the start state and the goal state are ??? (0,0,0), and (3,3,1) TRU-COMP3710 Knowledge Representation

Search Trees – Missionaries & Cannibals State – (# of cannibals, # of missionaries, # of boats) at the ending side Now we have to choose suitable operators that can be applied: [Q] What are the possible states from (0, 0, 0)? Possible states – (0, 1, 1), (0, 2, 1), (1, 0, 1), (1, 1, 1), (2, 0, 1) [Q] Which ones are safe (i.e., valid)? (1, 0, 1), (1, 1, 1), (2, 0, 1) [Q] Can we build up a search tree through safe (i.e., valid) states? What are the possible valid states from (1, 0, 1), (1, 1, 1) and (2, 0, 1)? TRU-COMP3710 Knowledge Representation

Search Trees – Missionaries & Cannibals Cycles should be removed. [Q] What does this mean? The nodes which are visited already should not be visited again. Nodes represent states, edges represent operators. There are two shortest paths that lead to the goal. [Q] What is a solution here? [Q] How to find a solution? Construct a search tree, and then Run BFS or DFS TRU-COMP3710 Knowledge Representation

Search Trees – Missionaries & Cannibals [Q] We will represent the starting side of the river, and omit the finishing side. Can you find a solution? [Q] How about 4 missionaries and 4 cannibals? Representation of the problem? Search tree? TRU-COMP3710 Knowledge Representation

Search Trees – Combinatorial Explosion Problems that involve assigning values to a set of variables can grow exponentially with the number of variables. [Q] E.g., what is the total number of possible cases with n variables and m values for each variable? [Q] How about the n×n tile puzzle? 9! (n = 3), 16! (n = 4), 25! (n = 5), … This is the problem of combinatorial explosion. Some such problems can be extremely hard to solve (NP-Complete, NP-Hard), i.e., it takes a very long time to solve. [Q] How to solve then? Construct a search tree, and then run DFS [Q] What do we have to do then? Selecting the correct representation can help to reduce this, as can using heuristics (see chapter 4). No initial construction of a search tree; constructing tree while an algorithm is learning [Q] Can you devise a proper representation (i.e., state) for the 3×3 puzzle game? [Q] Can you draw a search tree for the 2×2 puzzle game? Environment? Variables? Click and try me!

Search Trees – Problem Reduction Another idea is to break a problem down into smaller sub-problems (or sub-goals). Nodes in the tree represent sub-problems. The root node represents the overall problem. Some nodes have child nodes, meaning all their children must be solved. E.g. to solve the Towers of Hanoi problem with 4 disks, you can first solve the same problem with 3 disks. The solution is thus to get from the first diagram on the left, to the second, and then to apply the solution recursively. [Q] Can you devise a proper representation (i.e., state) for the problem with 3 disks? [Q] Can you draw a search tree? TRU-COMP3710 Knowledge Representation

Knowledge Representation Review How to represent a problem? Search tree States? Goal states? What is a solution? How to solve the combinatorial explosion problem, i.e., how to search the goal state quickly? One possible idea – Problem reduction TRU-COMP3710 Knowledge Representation