280 likes | 364 Views
Artificial Intelligence BCS-7. By Riaz Ahmad COMSATS WAh Cantt. A Simple Quote.
E N D
Artificial Intelligence BCS-7 By Riaz Ahmad COMSATS WAh Cantt
A Simple Quote 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. But this always takes much too long to be of practical interest. Any device that can reduce this search may be of value. • —Marvin Minsky, Steps Toward Artificial Intelligence
Knowledge Representation The function of any representation scheme is to capture the essential feature of the problem domain and make the information accessible to a problem solving procedure. Expressiveness and efficiency are major dimensions for evaluating knowledge representation language . Optimizing the trade off between expressiveness and efficiency is a major task for designing of intelligent systems.
Last Words to be Remember When applying Artificial Intelligence to search problems, a useful, efficient, and meaningful representation is essential. In other words, the representation should be such that the computer does not waste too much time on pointless computations, it should be such that the representation really does relate to the problem that is being solved.
Semantic Nets The semantic net is a commonly used representation in Artificial Intelligence. A semantic net is a graph consisting of nodes that are connected by edges. The nodes represent objects, and the links between nodes represent relationships between those objects
Semantic nets Semantic nets provide a very intuitive way to represent knowledge about objects and the relationships that exist between those objects. The data in semantic nets can be reasoned about in order to produce systems that have knowledge about a particular domain. Semantic nets do have limitations, such as the inability to represent negations: “Fido is not a cat.” this kind of fact can be expressed easily in first-order predicate logic
Frames Frame-based representation is a development of semantic nets and allows us to express the idea of inheritance. A frame system consists of a set of frames (or nodes), which are connected together by relations. Each frame describes either an instance (an instance frame) or a class (a class frame). Each frame has one or more slots, which are assigned slot values.
When we say, “Fido is a dog,” we really mean, “Fido is an instance of the class dog,” or “Fido is a member of the class of dogs.”
SCRIPTS: • Frame like structures used to represent commonly occurring experiences such as going to movies, shopping in a supermarket, eating in a restaurant, or visiting a dentist. Like a script in a play, script structure is described in terms of actors, events, roles, props and scenes. • Entry conditions • Roles : people in script • Props : objects in script • Scenes • Results
An Example of scripts Example 1 Script name: restaurant Role: Customer Waiter Cook Owner Entry condition : customer is hungry Props : food Table Money Scene1 : Enter Restaurant Customer Goes into rest Customer Move to sit Go to scene2 Scene2 : ORDERING Customer Signals to waiter, Waiter Goes to customer Customer Orders ‘Bring me food’ to waiter Waiter Goes to cook Waiter Give Customer’s order to cook Cook do (Prepare food script) Scene3 : EATING Scene4 : Payment Money Customer Goes to the Counter Owner tells the bill amount Customer Pay money to Owner (go to scene 5) Scene5: Exiting Customer leaves the restaurant Result : Customer not hungry rest. has less food customer has less money owner has more money.
Semantic Trees A semantic tree is a kind of semantic net that has the following properties: Each node (except for the root node, described below) has exactly one predecessor (parent) and one or more successors (children). node A is the predecessor of node B: node A connects by one edge to node B and comes before it in the tree. The successors of node B, nodes D and E, connect directly (by one edge each) to node B and come after it in the tree.
The nonsymmetrical nature of this relationship means that a semantic tree is a directed graph.
Search Trees • Searching a semantic net involves traversing the net systematically (or in • some cases, not so systematically), examining nodes, looking for a goal • node. Clearly following a cyclic path through the net is pointless because • following A,B,C,D,A will not lead to any solution that could not be reached • just by starting from A. We can represent the possible paths through a • semantic net as a search tree, which is a type of semantic tree.
Missionaries and Cannibals Three missionaries and three cannibals are on one side of a river, with a canoe. They all want to get to the other side of the river. The canoe can only hold one or two people at a time. At no time should there be more cannibals than missionaries on either side of the river, as this would probably result in the missionaries being eaten.
The Traveling Salesman A sales man must visit each of a set of cities and then return home. The aim of the problem is to find the shortest path that lets the salesman visit each city. Let us imagine that our salesman is touring the following American cities: A Atlanta B Boston C Chicago D Dallas E El Paso Our salesman lives in Atlanta and must visit all of the other four cities before returning home
In total there will be (n 1)! possible paths for a Traveling Salesman problem with n cities.
Partial search tree for Traveling Salesman problem with five cities