Top Banner
STRICTILY AS PER NAGARJUNA UNIVERSITY SYLLABUS ARTIFICIAL INTELLIGENCE Artificial Intelligence Definition of knowledge Large collection of symbols is called as data. Large collection of data is called as information. If you have lot of information it is knowledge. If you have lot of knowledge then you are an intelligent. If you are an intelligent then you have wisdom. Knowledge is defined as the piece of information that helps in decision- making. Intelligence can be defined as the ability to draw useful inferences from the available knowledge. Wisdom is the maturity of the mind that directs its intelligence to achieve desired goals. 1
131

Artificial Intelligence for ANU Students

Nov 15, 2014

Download

Documents

sandhyaraninaga

This is a simple notes for students havaing Artificial Intelligence as their subject.......
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

STRICTILY AS PER NAGARJUNA UNIVERSITY SYLLABUS

ARTIFICIAL INTELLIGENCE

Artificial Intelligence Definition of knowledge Large collection of symbols is called as data. Large collection of data is called as information. If you have lot of information it is knowledge. If you have lot of knowledge then you are an intelligent. If you are an intelligent then you have wisdom. Knowledge is defined as the piece of information that helps in decision-making. Intelligence can be defined as the ability to draw useful inferences from the available knowledge. Wisdom is the maturity of the mind that directs its intelligence to achieve desired goals. Knowledge Relation: Wisdom Intelligence Knowledge Information Data Symbol

1

What is intelligence? An exact definition of intelligence has proven to be extremely elusive. Douglas Hofstadler suggests the following characteristics in a list of essential abilities for intelligence. 1.To respond to situations very flexibility. 2.To make sense out of ambiguous or contradictory messages. 3.To recognize the relative importance of different elements of a situation. 4.To find similarities between situations despite differences, which may separate them. 5.To draw distinctions between situations despite similarities, which may link them. Turing Test: In 1950, Turing published an article in the Mind magazine, which triggered a controversial topic Can a machine think. Turing proposed an imitation game which was later modified to Turing test. In the imitation game the players are three humans- a male, a female and an interrogator. The interrogator who is shielded from the other two, asks questions to both of them and based on their typewritten answers determines who is female. The aim of the male is to imitate the female and deceive the interrogator and the role of female is to provide replies that would inform the interrogator about her true sex.Room A Room B

Room C

Turing proposed that if the human interrogator in Room C is not able to identify who is in Room A or in Room B, then the machine possesses intelligence. Turing considered this is a sufficient test for attributing thinking capacity to a machine. As of today, Turing test is the ultimate test a machine must pass in order to be called as intelligent test. Importance of Turing test: It gives a standard for determining intelligence. It also helps in eliminating any bias in favour of living organism, because the interrogator focuses slowly on the content of the answers to the questions. Definitions of Artificial Intelligence: There is no universal agreement among AI researchers about exactly what constitutes AI. Various definitions of AI focus on different aspects of this branch of computer science including intelligent behavior, symbolic process, heuristics and pattern matching. Some of the definitions of AI: 1.AI is the study of how to make computer do things, which at the moment people do better. ------Elaine Rich. 2. McCarthy coined the term AI in 1956.

2

Developing computer programs to solve complex problems by applications of processes that analogous to human reasoning processes. This definition has 2 major parts: computer solutions for complex problems and processes that are analogous to human reasoning processes. A.I is the study of mental faculties through the use of computational models. 3.AI is the study of the computations i.e. possible to perceive, reason and action. From the perspective of this definition AI differs from most of psychology because of the greater emphasis on computation and AI differs from most of computers science because of the emphasis on perception, reasoning and action 4.AI is the part of computer science concerned with designing intelligent computer systems that exhibit the characteristics we associate with intelligent in human behavior. --- Arron Barrand Edward A.Feignbaum 5.According to Bruce G Buchanan and Edward shortlife symbolic processing is an essential characteristics of AI. AI is the branch of computer science dealing with symbolic, non-algorithmic methods of problem solving. 6. In an encyclopedia article, Bruce G Buchanan includes heuristics as key elements of AI. AI is the branch of computer science that deals with ways of representing knowledge using symbols rather than numbers and writes rules of thumb or heuristic methods for processing information. -----Bruce G Buchanan, encyclopedia Britannica. A heuristic is a rule of thumb that helps you to determine how is proceed. 7. Another definition of AI focuses on pattern matching techniques. In simplified terms, AI works with pattern matching methods, which attempt to describe objects, events or processes in terms of their qualitative features and logical computational relationships. ---Brattle researches corporation, AI and fifth generation computer technologies. 1.what computers can do better than people? 1. Numerical Computation 2. Information Storage 3. Repetitive operations. 4. Computers are just machines. What people can do better than computer? 1. Intelligence 2. Process 3. Understand 4. Make sense 5. Common sense. Differences between human brains and computers Human brains computer 1. Living device. 1. Non living device. 2. Self-build and creative. 2. Dependent and must be programmed 3. Has continuo nature. 3. Describe in nature. 4. Limited size. 4. Unlimited memory size. 5. Basic unit is nervous. 5. Basic unit is a ram cell. 6. Storage devices are Electro chemicals in nature. 6. Store devices are electronic & magnetic. 7. Number punching is slow. 7. Faster. 8. Speed of transmission is of order of 50 to 8. Speed of transmission is equal to the 100 meters of sec. Speed of electrons & speed of light. 9. Has inducted detective reasoning capabilities. 9. No reasoning power.

3

10. Has an emotion. 11. Has a capacity to learn. 12. Volume is approximately 15 wt. 13. Power consumption 10 wt. 14. Logic adopted is fuzzy logic. 15.most sophisticated device and highly advanced with respect to intelligence.

10. Dumb and no emotions. 11. Must be programmed. 12. Volume is about 2000wats. 13. Power is 500 watts. 14. Logic adopted is binary logic. 15. Only intention and achieved a Certain degree of specification.

Areas of AI research (AI and related fields) and its applications: 1.Expert System: An expert system is a computer program designed to act as an expert in a particular domain also known as knowledge based system . An expert system is a set of programs that manipulate encoded knowledge to solve problems in a specialized domain that normally requires human expertise. The system perform their inference through symbolic computations. Expert systems are currently designed to assist experts not to replace them. They have proven to be useful in diverse are as such as medical diagnosis, chemical analysis, and geological exploration and computer system configuration. Since the expert system field promises a great deal of practical application and commercial potential in the near future .it has begun to attract on enormous amount of attention. 2.Natural language processing: The utility of computer is often limited by communication difficulties. The effective use of a computer traditionally has involved the use of a programming language or set of commands that you must use to communicate with the computer. The goal of natural language processing is to enable people and computers to communicate in a natural (human) language such as English rather in a computer language. The field of N.L.P is divided into 2 sub fields of : 1. Natural language understanding which investigates methods of allowing the computer to comprehend instructions given in ordinary English so computers can understand people more easily. 2. Natural-language generations, which strives to have, computers produce ordinary English language so that people can understand computers more easily. 3. Speech recognition: The focus of N.L.P is to enable computers to communicate interactively with English words and sentences that are typed on paper or displayed on a screen. The primary interactive method of communication used by human is not reading and writing; it is speech. The goal of speech recognition research is to allow computers to understand human speech so that they can hear our voice and recognize the words. We are speaking speech recognition research seeks to advance the goal of natural language processing by simplifying the process of interactive communication between people and computers. 4.Computer vision: It is a simple task to attach a camera to a computer so that the computer can receive visual images .it has proven to be a far more difficult task. However to interpret those images so that the computers can understand exactly what it is seeing. People generally use vision as their primary means of sensing their environmental .we generally see more than we hear, feel, smell of taste .the goal of computer vision research is to give computers this same facility for understanding their surroundings. 5. Robotics:

4

A robot is an Electro mechanical device that can be programmed to perform manual tasks. The robotic industries association formally defines a robot as a re programmable multi functional manipulator designed to move material, parts, roots or specialized devices through variable programmed motions for the performance of a variety of tasks. Not at all robotics is considered to be the part of AI .a robot that performs only the actions it has been pre programmed to perform is considered to be a dumb robot processing no more intelligence. An intelligent robot includes some kind of sensory apparatus such as a camera that allows it to respond to changes in its environment, rather than just to allow instructions mindlessly. Intelligent computer assisted instruction (ICAI): CAI has been in use for many years bringing the power of the computer to bear on the educational process. now AI methods are being applied to the development of intelligent computer assisted instruction in an attempt to create computerized tutors that shape their teaching techniques to fit the learning patterns of individual students. Automatic programming: In simple terms programming is the process of telling the computer exactly what you want it to do. Developing a computer program frequently requires a great deal of time. A program must be designed, written, tested, debugged and evaluated all as part of the program development process. The goal of automatic programming is to create special programs that act as intelligent tool to assist programmers and expedite each phase of the programming process. The ultimate aim of automatic programming is computer system that could develop programs by itself, in response to and in accordance with the specifications of a program developer. Planning and decision support: When you have a goal, either you rely on luck and providence to achieve that goal or you design and implement a plan .the realization of a complex goal may require the construction of a formal and detailed plan. Intelligent planning programs are designed to provide active assistance in the planning process and are expected to be particularly helpful to managers with decision-making responsibilities. From the perspective of goals AI can be viewed as part of engineering and part of science. The engineering goal of AI is to solve real world problems using AI as an armamentarium of ideas about presenting knowledge; using knowledge and assembling system explain various sorts of intelligence. Applications of AI should be judged according to whether there is well-defined task, an implemented program and a set of identifiable principles. AI can help us to solve difficult real world problems, creating new opportunities in business, engineering and many other application areas. Characteristics of AI problems: 1. The problems that AI tackles have combinational explosion of solutions. 2. AI programs manipulate symbolic information to a larger extent, in contrast to conventional programs, which deal with numeric processing. 3. To cope with the combinational explosion of solutions, AI programs use heuristics to search tree. 4. In order to classify system as an AI program, the fundamental criterion is that it must have vast quantities of knowledge must be represented in such a form that the system work on it can easily manipulate it. 5. AI programs deal with real life problems to a large extent. The assist humans in taking right decisions. Just a human expert has the capacity to handle uncertain, incomplete and irrelevant information. 6. A very vital characteristic of an AI program is its ability to learn. Differences between AI and conventional program.

5

Features 1. Processing type 2. Technique used 3. Solution steps 4. Answers sought 5. Control/Data separation 6. Knowledge 7. Modification 8. Involves 9. Process Problems representation in AI:

AI Programming Symbolic Heuristic search not explicit Satisfactory Separate Imprecise Frequent Large Knowledge base Inferential

Conventional Programming (software) Numeric algorithmic search Precise Optional Intermingled Precise Rare large database Repetitive

Before a solution can be found, the prime condition is that the problem must be very precisely defined. To build a system to solve a particular problem, we need to do four things. 1. Define the problem precisely: this definition must include precise specifications of what the initial situations will be as well as what final situations constitute acceptable solutions to the problem. 2. Analyze the problem. 3. Isolate and represent the last knowledge that is necessary to solve the problem. 4. Choose the last problem solving techniques and apply it to the particular problem. The most common methods of problem representation in AI are 1. State space representation 2. Problem reduction State space representation: A set of all possible states for a given problem is known as the state space of the problem. State space representations are highly beneficial in AI because they provide all possible states, operations and goals. If the entire state space representation for a problem is given, it is possible to trace the path from the initial state to the Goal State and identify the sequence of operators necessary for doing it. The major deficiency of this method is that it is not possible to visualize all states for a given problem. To overcome the deficiencies of this method, problem reduction technique comes handy. Example1: Water Boiled Boiling Water Added coffee Decation Coffee Added sugar Palatable coffee Milk powder Milk

6

Example2: A Water Jug Problem: You are given two Jugs, a 4-gallon one and a 3-gallon one. Neither have any measuring markers on it. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 gallons of water into the 4-gallon jug? The state space for this problem can be described as the set of ordered pairs of integers (x, y), such that x=0, 1,2,3, or 4 and y = 0,1,2, 0r 3; x represents the number of gallons of water in the 4-gallon jug, and y represents the quality of water in the 3-gallon jug. The Start State is (0,0). The goal state is (2,n) for any value of n (since the problem does not specify how many gallons need to be in the 3-gallon jug). 1 2. 3 4 5 6 7 8 9. 10 11 12. (x, y) If x < 4 (x, y) If y < 3 (x, y) If x >0 (4,y) (x,3) (x d, y) (x, y - d) (0, y) (x, 0) Fill the 4-gallon jug. Fill the 3-gallon jug. Pour some water out of the 4-gallon jug pour some water out of the 3-Gallon jug Empty the 4-gallon jug on the ground Empty the 3-gallon jug on the ground

(x, y) If y > 0 (x, y) If x > 0 (x, y) If y > 0 (x, y) If x + y> 4 and y > 0

(4,y (4 -x)) pour some water from the 3-Gallon jug in to the 4 - gallon jug until the 4 -gallon jug is full. pour water from the 4 -Gallon jug in to the 3 -gallon jug until the 3 -gallon jug is full. pour all the water from the 3-Gallon jug in to the 4- gallon jug pour all the water from the 4-Gallon jug in to the 3- gallon jug pour all 2 gallons from the 3-Gallon jug in to the 4-Gallon jug. Empty the 2 gallons in the 4.gallons in the 4-gallon jug on the Ground.

(x, y) (x-(3-y),3) If x + y> 3 and x > 0 (x, y) (x+y,0) If x + y 0 (x, y) (x+y,0) If x + y < 3 and x > 0 (0,2) (2,0) (2,y) (0,y)

Production rules for the water jug problem. Gallons of water in the 4-gallon jug. 0 0 3 3 4 0 2 Gallons of water in the 3-gallon jug 0 3 0 3 2 2 0 Rule Applied 2 9 2 7 5 0r 12 9 or 11

7

One solution for the water jug problem. 0 4 1 1 0 4 2 2 0 0 3 0 1 1 3 0 2 1 8 6 10 1 8 6

Second solution for the water jug problem

Problem Reduction: In this method a complex problem is broken down or decomposed into a set of preemptive sub problems. Solutions for these preemptive subprograms are easily obtained. The solutions for all the sub-problems collectively give the solution for the complex problem. Example: We want to evaluate (x2+3x+sin2xcos2x)dx

We can solve this by breaking down into smaller problems. (X2 + 3x + sin2x cos2x) dx x2 dx x3 /3 3x dx 3 x2/2 dx 3 x2 /2 sin2x cos2x dx (1-cos2x)cos2x dx (cos2x cos4x) dx

The individual values can be combined (Integrated) to get the final result. Major components of AI : Any AI system has four major components. 1. 2. 3. 4. Knowledge representation Heuristic search AI programming languages and tools AI hardware

What are the underlying assumption about intelligence. Newal and Siman proposed some hypothesis Physical symbol system hypothesis Physical symbol system consists of set of entities called symbols, with the help of these entities to make symbol structure (expression). Thus, a symbol structure is composed of a number of instances of symbols related in some physical way.

8

A physical symbol system is a machine that produces through time an evolving collection of symbol structures.

Creation Modification Set of operators Reproduction Destruction P.S.S. has the necessary and sufficient means to exhibit intelligence. Intelligence requires knowledge Experience gives knowledge Intelligence requires knowledge Less desirable properties of knowledge There appears to be no way to prove or disprove it on logical grounds. So it must be subjected to empirical validation. We may find that it is false. We may find that the bulk of the evidence says that it is true. But the only way to determine its truth is by experimentation. The importance of the physical symbol system hypothesis is twofold. It is a significant theory of the nature of human intelligence and so is of great interest to psychologists. It also forms the basis of the belief that it is possible to build programs that can perform intelligent tasks now performed by people. Properties of AI: 1. 2. 3. 4. 5. Must capture generalization. It must be understood be people, who must provide knowledge to it. It can be easily modified to reflect overview. It can be used in great money situations even if it is totally accurate or computable. It must overcome its own sheer bulk by narrowing down the range of possibilities. AI Problems AI Techniques What is an AI Techniques? It is voluminous It is hard to characterize accurately It is constantly changing It differs from data by being organized in a way that corresponds to the ways it will be used. Organization of knowledge is situation dependent The three important AI Techniques: Non AI Problems Non AI Techniques

9

Search: Provides a way of solving problems for which no more direct approach is available as well as a frame work into which any direct techniques that are available can be embedded. Use of knowledge: Provides a way of solving complex problems by exploiting the structures of the objects that are involved. Abstraction: Provides a way of separating important features and variations from unimportant ones that would otherwise overwhelm any process. Problem Characteristics: Heuristic search is a very general method applicable to a large class of problems. In order to choose the most appropriate methods for a particular problem it is necessary to analyze the problem along several key dimensions. 1. 2. 3. 4. Is the problem decomposable? Can solution steps be ignored or undone? Is the problems universe predicate? Is a good solution to the problem obvious without comparison to all other possible solutions? (Is a good solution absolute or relative?) 5. Is the solution a state or a path? 6. What is the role of knowledge? 7. Does the task require interaction with a person? 1. Is the problem decomposable? A decomposable problem: We want to evaluate (x2+3x+sin2xcos2x)dx We can solve this by breaking down into smaller problems. (X2 + 3x + sin2x cos2x) dx x2 dx x3 /3 + + 3x dx 3x dx 3 x2 /2 + + sin2x cos2x dx (1-cos2x)cos2x dx (cos2x cos4x) dx A BB

+

The individual values can be combined (Integrated) to get the final result. A non-decomposable problem: Blocks World problem On (C, A) Operators available:1. 2. C A

On (B, C) and On (A, B)

C

Clear (x) [ block x has nothing on it] On(x,table) [ Pick up x and put it on table] Clear(x) and clear(y) On(x, y) [put x on y]

10

A proposed solution: Decomposition produces two smaller problems 1. Is simple the start state. Simply put B and C. 2. Is not simple. We have to clear off A by removing C before we can pick up A and put it on B this can be done easily. 1.We now try to combine the two sub-solutions into one solution we fail regardless of which one do first, we will not be able to so the second. I.e. 1 and 2 are independent. 2. Can solution steps be ignored or undone? 1. Theorem Proving: Suppose we want to prove a mathematical theorem we proceed by first proving a lemma that we think will be useful. Eventually, we realize that the lemma is not of help at all. Are we in trouble? No. All we have lost is the effort that was spent. The 8 puzzle: The 8-puzzle is a square in which is placed eight square tiles. The remaining 9 th square is uncovered. Each tile has a number on it. A tile that is adjacent to the blank space can be slid into that space. A game consists of a starting position and specified into the goal position by sliding the tiles around. 3. Chess: Suppose we made a wrong move and we realized it a couple of moves later.2.

We cannot go back to correct the move. The three problems are of three classes. 1. Ignorable: (Ex: Theorem proving) in which solution steps can be ignored. 2. Recoverable: (Ex: 8-puzzle) in which solution steps can be undone. 3. Irrecoverable: (Ex: Chess) in which solution steps cannot be undone. Ignorable problems can be solved using a simple control structure that never back tracks. Recoverable problems can be solved using a simple control structure that backtracks. A great deal of effort is needed to solve irrecoverable problems. 3. Is the universe predicate? Predictable in 8-puzzle (certain outcome) Unpredictable in bridge (uncertain outcome) Playing bridge: But we can do fairly well since we have available accurate estimates of the probabilities of each of the possible outcomes. Controlling a robot arm: The outcome is uncertain for a variety of reasons. Some one might move something in to the path of the arm. The gears of the arm might stick. A slight error could cause the arm to knock over a whole stack of this. Helping a lawyer decide how much to defend his client against a murder charge. Here we probably cannot even list all the possible outcomes, much less assess their probabilities.

4.Is a good solution absolute or relative? Ex: Consider a database of facts 1. Marcus was a man. 2. Marcus was a pompein11

3. Marcus was born in 40 AD 4. All men are mortal 5. All pompeians died whan the volcano erupted in 79 AD 6. No mortal lives longer than 150 years 7. It is now 1998 AD Question: Is Marcus alive? There are two solutions First solution is 1. Marcus was a man 2. All men are mortal 3. Marcus us mortal from 1 and 4 4. Marcus was born in 40 AD 5. It is now 1998 AD 6. Marcus age is 1958 year -4 and 5 7. No mortal lives longer than 150 years. 8. Marcus is dead -6 and 7

Second solution is 7. It is now 1998 AD 5.All pompeians died in 79 AD 9. All pompeians are dead now -7 and 5 2. Marcus was a pompiean 10.Marcus is dead -9 and 2 So, to answer the question Is Marcus alive we can choose any one of the two solutions. Since each path will lead to answer. If we do follow one path successfully to the answer there is no reason to go back and see if some other path might also lead to a solution. Now consider TSP: Boston Boston ----New York Miami 1450 Dallas 1700 S.F. 3000 Path 1 : Boston---250---->New York---1450---->Miami---3050---->Dallas---4750---->S.F---7750---->Boston Path 2 : Boston---3000---->S.F.---4700---->Dallas---6200---->New York---7400---->Miami---8850---->Boston We cant say one path is the shortest one unless we try other paths also. 1. Marcus any path problems can be solved in a reasonable amount of time. 2. TSP best path problems_ computationally harder than any path problems. 250 250 1200 1500 2900 -------1600 3300 New York 1450 1200 1600 ----1700 Miami 1700 1500 3300 1700 ------Dallas 3000 2900 San Fransisco

12

5. Is the solution a state or path? Natural language understanding: The bank president ate dish of pasta salad with the fork. Several components in this sentence, each of which in solution, may have more than one interpretation. But, the whole sentence must give only meaning. Source of Ambiguity: Bank financial institutions (or) side of rivers only one of these may have a president. Dish object of the verb eat, a dish was eaten? The Pasta Salad in the dish was eaten. Pasta salad a salad containing pasta. Dog food doesnt normally contain dog. So some search is required to find the interpretation of the sentence. But these will be anyone interpolation. Ex: Water jug problem. The solution is not just the state (2,0) but the path from (0,0) to (2,0). 6.What are the role of knowledge? Chess: Knowledge required is very little (a set of rules for legal moves, a control mechanism that implements an appropriate search procedure, knowledge of good tactics by a perfect program. Newspaper: Now consider the problem of scanning daily newspaper to decide which are supporting the democrats and which are supporting the republicans in some upcoming election. Again assuming unlimited computing power, how much knowledge would be required by a computer trying to solve this problem? This time the answer is a great deal. 1. The names of the candidates in each party. 2. The fact that if the major thing you want to see done is has taxes lowered, you are probably supporting republicans. 3. The fact that if the major thing you want to see done is improved education for minority students, you are probably supporting the democrats. 4. The fact that if you opposed to big government you are probably supporting the republican. And so on. These two problems chess and newspaper story understanding, illustrate the difference between the problems for which a lot of knowledge is important only to constrain the search for solution and those for which a lot of knowledge is required even to be able to recognize a solution.

7. Does the task require interaction with a person. Two types of problems. 1. Solitary: The computer is given a problem description and produces an answer with no intermediate communication and with no demand for an explanation of the reasoning process.

13

2. Conversational: These are intermediate communication between a person and the computer (either to provide additional assistance to computer or to provide additional information to the user or both). Definition of Production System: Production system is a mechanism that describes and performs the search process. It consists of 1. 2. 3. 4. A set of rules. One or more knowledge or database. A control strategy that specifies the order of the rules to be applied. A rule applied.

Requirements of a good control strategy: 1. The first requirement is that it can cause motion. Consider the water jug problem. Suppose we implemented the simple control strategy of starting each time at the top of the list of rules and choosing the first applicable one. 2. The second requirement is that it be systematic. The requirement that a control strategy be systematic corresponds to the need for global motion as well as for local motion. Production System Characteristics: We have argued that production systems are a good way to describe the operations that can be performed in a search for a solution to a problem. 1. Can production systems, like problems, be described by a set of characteristics that shed some light on how they can easily be implemented? 2. If so, what relationships are there between problem types and the types of production system best suited to solving the problems? Definitions of classes of production systems: A monotonic production system: It is a production system in which the application of a rule never prevents the later application of another rule that could also have been applied at the time first rule was selected. A non-monotonic production system: A non-monotonic production system is one in which this is not true. Partially commutative production system: A partially commutative production system is a production system with the property that if the application of a particular sequence of rules transforms state x into state y then any permutation of those rules that is allowable (i.e. each rules preconditions are satisfied when it is applied) also transforms state x into state y. Partially commutative, monotonic production systems are useful for solving ignorable problems. A commutative production system: A commutative production system is a production system that is both monotonic and partially commutative. The significance if these categories of production systems lie in the relationship between the categories and appropriate implementation strategies.

14

Monotonic Partially Commutative Non Partially commutative Theorem proving Chemical synthesis

Non-monotonic Robot navigation Bridge

Partially commutative, monotonic production systems are important from an implementation standpoint because they can be implemented with out the ability to backtrack to previous states when it is discovered that an incorrect path has been followed. Although it is often useful to implement such systems with backtracking in order to guarantee a systematic search, the actual database representing the problem state need not be restored. Non-monotonic, partially commutative systems, on the other hand are useful for problems in which changes occur but can be reversed and in which order of operations is not critical. Commutative production systems are useful for many problems in which irreversible changes occur. These are likely to produce the same node many times in the search process. Searching Techniques Every AI program has to do the process of searching for the solution steps are not explicit in nature. This searching is needed for solution steps are not known before hand and have to be found out. Basically to do a search process the following steps are needed. 1. The initial state description of the problem. 2. A set of legal operators that changes the state. 3. The final or goal state. The searching process in AI can be broadly classified into two major parts. 1. Brute force searching techniques (Or) Uninformed searching techniques. 2. Heuristic searching techniques (Or) Informed searching techniques. Brute force searching techniques: In which, there is no preference is given to the order of successor node generation and selection. The path selected is blindly or mechanically followed. No information is used to determine the preference of one child over another. These are commonly used search procedures, which explore all the alternatives, during the searching process. They dont have any domain specific knowledge all their need are the initial state , final state and the set of legal operators. Very important brute force searching techniques are 1. Depth First Search 2. Breadth First Search Depth first search: This is a very simple type of brute force searching techniques. The search begins by expanding the initial node i.e. by using an operator generate all successors of the initial node and test them. This procedure finds whether the goal can be reached or not but the path it has to follow has not been mentioned. Diving downward into a tree as quickly as possible performs Dfs searches. Root

A

B

15

D

E

F G H Goal State

I

J

Algorithm: Step1: Put the initial node on a list START. Step2: If START is empty or START = GOAL terminates search. Step3: Remove the first node from START. Call this node a. Step4: If (a= GOAL) terminates search with success. Step5: Else if node a has successors, generate all of them and add them at the beginning Of START. Step6: Go to Step 2. The major draw back of the DFS is the determination of the depth citric with the search has to proceed this depth is called cut of depth. The value of cutoff depth is essential because the search will go on and on. If the cutoff depth is smaller solution may not be found. And if cutoff depth is large time complexity will be more. Advantages: DFS requires less memory since only the nodes on the current path are stored. By chance DFS may find a solution with out examining much of the search space at all.

Breadth First Search (BFS): This is also a brute force search procedure like DFS. We are searching progresses level by level. Unlike DFS which goes deep into the tree. An operator employed to generate all possible children of a node. BFS being a brute force search generates all the nodes for identifying the goal. The amount of time taken for generating these nodes is prepositional to the depth d and branching factor b is given by 0(b)

Root

A D E F

B I G H Goal State J

ALGORITHM: Step 1. Put the initial node on a list START Step 2. If START is empty or goal terminate the search. Step 3. Remove the first node from the Start and call this node a Step 4. If a =GOAL terminate search with success

16

Step 5. Else if node a has successors generate all of them and add them at the tail of START Step 6. Go to step 2. Advantages: 1. BFS will not get trapped exploring a blind alley. 2. If there is a solution then BFS is guaranteed to find it. 3. The amount of time needed to generate all the nodes is considerable because of the time complexity. 4. Memory constraint is also a major problem because of the space complexity. 5. The searching process remembers all unwanted nodes, which are not practical use for the search process. Heuristic Search Techniques: In informed or directed search some information about the problem space is used to compute a preference among the children for exploration and expansion. The process of searching can be drastically reduced by the use of heuristics. Heuristic is a technique that improves the efficiency of search process. Heuristic are approximations used to minimize the searching process. Generally two categories of problems are used in heuristics. 1. Problems for which know exact algorithms are known & one needs to find an appropriate & satisfying the solution for example computer vision. Speech recognition. 2. Problems for which exact solutions are known like rebuke cubes & chess. The following algorithms make use of heuristic evolution 1. Generate & test 2. Hill climbing 3. Best first search 4. A* Algorithm 5. AO* Algorithm 6. Constraint satisfaction 7. Means- ends analysis. 1.Generate and test: The generate & test strategy is the simplest of all the approaches. The generate & test algorithm is a depth first search procedure since complete solutions must be generated before they can be tested. In its most systematic form, it is simply an exhaustive search of the problem space, It is also known as the British museum algorithm. A reference to a method for finding an object in British museums by wandering randomly. Algorithm Step 1: Generate possible solutions. For some problems this means generating a particular point in the problem space. For others it means generating a path from a start state. Step 2: Test to see if these actually a solution by comparing the chosen point or the end point of the chosen path of the set of acceptable good states. Step 3: If a solution has been found, quit, otherwise, return to step 1. Hill Climbing: It is a variant of generate a test in which feed back from the test in which feed back from the test procedure is used to help the generator decide which direction to move in the search space. In a pure generate & test procedure the test function response with only a yes or no. But if the test function is augmented with a heuristic function. That provides a estimate of how close given state is to a goal state. Hill climbing is often used when a good heuristic function is available for evaluating states. But when no other useful knowledge is available. This algorithm is also discrete optimization algorithm uses a simple heuristic function. The amount of distance the node is from the goal node in fact there is a practically no difference between hill climbing & DFS except that the children of the node that has been expanded are shorted by the remaining distance nodes. Root

17

A D E F

B I G H J

Goal State Algorithm: Step1: Step2: Step3: Step4: Step5: Put the initial node on a list START. If (START is empty) or (START = GOAL) then terminate the search. Remove the first node form the start, call this node a. If ( a = GOAL) terminate search with success. ELSE if n ode a has successors generate all of them. Find out how form they are from the goal node. Sort them by the remaining distance from the goal and add them to beginning of the start. Step6: Go to step 2. Problems of hill climbing: Local maximum: A state that is better then all its neighbors but not so when compared to states to states that are farther away.

Local Maximum Plateau: The flat area of the search space in which all neighbors have the same value.

Plateau Ridge: Described as a long and narrow stretch of evaluated ground or a narrow elevation or raised part running along or across a surface.

18

Ridge In order to overcome these problems, adopt one of the following or a combination of the following methods. 1. Backtracking for local maximum. Backtracking helps in undoing what has been done so far and permits to try different path to attain the global peak. 2. A big jump is the solution to escape from the plateau. A huge jump is recommended because in a plateau all neighboring points have the same value. 3. Trying different paths at the same time is the solution for circumventing ridges. Best first Search: Which is a way of combining the advantages of both depth-first-search and breadth-first-search in to a single method. Dfs is good because if allows a solution to be found without all competing branches having to be expanded. Bfs is good because it does not get trapped on dead end paths. One way of combining the two is to follow a single path at a time, but switch paths whenever some competing path looks more promising than the current one does. In this procedure, the heuristic function used here called an evaluation function is an indicator of how far the node is from the goal node. Goal nodes have an evaluation function value of zero. 9 3 6 S B 5 5 C 7 6 Search process of best-first search. Step 1. 2. 3. 4. 5. Node being Expanded S A C B H Children A: 3, B: 6, C: 5 D: 9, E: 8 H: 7 F: 12, G:14 I: 5, J: 6 H Available nodes A: 3, B: 6, C: 5 B: 6, C: 5, D: 9, E: 8 B: 6, D: 9,E: 8,H: 7 D:9,E:8,H:7,F:12,G:14 D:9,E:8,F:12,G:14,I:5, J:6 Node chooses A: 3 C: 5 B: 6 H: 7 I: 5 J I 2 M 14 G 0 L Goal A 8 12 D E K F 1

19

6.

I

K:1, L:0, M:2

D:9,E:8,F:12,G:14,J:6, K:1, L:0,M:2

search stop goal is reached

There is an only minor variation between hill climbing and Best FS. In the former we sorted the children of the first node being generated. Here we have to sort the entire list to identify the next node to be expanded. The paths found by best first search are likely to give solutions faster because it expands a node that seems closer to the goal. However there is no guarantee of this. Algorithm: Step 1: put initial node on a list start. Step 2: if (start is empty) or (start =goal) then terminate search. Step 3: remove the first node from start. Call this node a. Step 4: if (a = goal) then terminate search with success. Step 5: else if node a has successors, generate all of them. Find out how far they are from the goal node. Sort all the children generated so far by the remaining distance from the goal. Step 6: name this list as start one. Step 7: replace start with start one. Step 8: go to step 2. A* algorithm: The best first search algorithm that was just presented is a simplification an algorithm called A* algorithm which was first presented by HART. A part from the evolution function values one can also bring in cost functions indicate how much resources like time, energy, money etc. have been spent in reaching a particular node from the start. While evolution functions deal with the future, cost function deals with the past. Since the cost function values are really expanded they are more concrete than evolution function values. If it is possible for one to obtain the evolution function values then A* algorithm can be used. The basic principle is that the sum the cost and evolution values for a state to get its goodness worth and this is a yard stick instead evolution function value in best first search. The sum of the evolution function value and the cost along the path leading to that state is called fitness number. While best first search uses the evolution function value for expanding the best node A* uses the fitness number for its computations. 14 9 2 D6

A 3 3 2 S 6 6 C 5 5 7 H Step Node being Expanded Children11 18

13

2 B 8 4

8 E F 12 317 18

120

123

K 0 20 L Goal 2 21 M

G 14 7 6

2 I 5 2

623

j Node chooses

Available nodes

20

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. stop

S A B C E D G H F I

A: 6, B: 8, C: 11 D: 14, E: 13 F: 18,G: 17 H: 18

I: 23,J: 23 K: 20,L: 20,M: 21

A: 6, B: 8, C: 11 B: 8, C: 11, D: 14, E: 13 C: 11,D: 14,E: 13,F: 18,G: 17 D: 14,E: 13,F: 18,G: 17,H: 18 D: 14,F: 18,G: 17,H: 18 F: 18,G:17,H: 18 F: 18,H: 18 F:18, I: 23 ,J:23 I: 23,J: 23 J: 23, K: 20,L: 20,M: 21

A: 6 B: 8 C: 11 E: 13 D: 14 G: 17 H: 18 F: 18 I: 23 L: 20 search goal is reached

Algorithm: Step 1: put the initial node on a list start Step 2: if (start is empty) or (start = goal) terminate search. Step 3: remove the first node from the start call this node a Step 4: if (a= goal) terminate search with success. Step 5: else if node has successors generate all of them estimate the fitness number of the successors by totaling the evaluation function value and the cost function value and sort the fitness number. Step 6: name the new list as start 1. Step 7: replace start with start 1. Step 8: go to step 2. Problem Reduction: In this method, a complex problem is broken down or decomposed into a set of primitive sub problems. Solutions for these primitive sub-problems are easily obtained. The solutions for all the sub-problems collectively given the solution for the complex problem. Between the complex problem and the sub-problem, there exist two kinds of relationships, i.e AND relation and OR relation ship. In AND relation ship, the solution for the problem is obtained by solving all the subproblems.(Remember AND gate truth table condition). In OR relationship, the solution for the problem is obtained by solving any of the sub-problems. (Remember AND gate truth table condition). This is why the structure is called an AND-OR graph. The problem reduction is used on problems such as theorem proving, symbolic integration and analysis of industrial schedules. To describe an algorithm for searching an AND-OR graph, need to exploit a value, call futility. If the estimated coast of a solution becomes greater than the value of futility, then give up the search. Futility should be chosen to corresponds to a threshold such that any solution with a cost above it is too expensive to be practical, even if it could every be found.A

9 5 B The AO* ALGORITHM 3C

4

D

21

The problem reduction algorithm we just described is a simplification of an algorithm described in Martelli and Montanari, Martelli and Montanari and Nilson. Nilsson calls it the AO* algorithm , the name we assume. 1. Place the start node s on open. 2. Using the search tree constructed thus far, compute the most promising solution tree T 3. Select a node n that is both on open and a part of T. Remove n from open and place it on closed. 4. If n is a terminal goal node, label n as solved. If the solution of n results in any of ns ancestors being solved, label all the ancestors as solved. If the start node s is solved, exit with success where T is the solution tree. Remove from open all nodes with a solved ancestor. 5. If n is not a solvable node (operators cannot be applied), label n as unsolvable. If the start node is labeled as unsolvable, exit with failure. If any of ns ancestors become unsolvable because n is, label them unsolvable as well. Remove from open all nodes with unsolvable ancestors. 6. Otherwise, expand node n generating all of its successors. For each such successor node that contains more than one sub problem, generate their successors to give individual sub problems. Attach to each newly generated node a back pointer to its predecessor. Compute the cost estimate h* for each newly generated node and place all such nodes that do not yet have descendents on open. Next, recomputed the values of h* at n and each ancestor of n. 7. Return to step 2. If can be shown that AO* will always find a minimum cost solution tree if one exists, provided only that h*(n) 9, C3 can be 0 or 1 => S=9 or 8 C3+S+M can be either 9,10 or 11. It is 9 then no carry, If sum is 11 then O=1. But M is already assigned 1. So O=0 and C3=0. S=9 or 8. Let C3=0 & S=9 C2+E+O=N if C2=0, E=N It is wrong. So c2 =1, 1+E =N. Let E=2 then N=3 923D 10R2 ====== 10 3 2 Y R=9 & C1 = 0 wrong R=8 & C1 = 1 correct 923D 1082 ===== 1032Y to get carry D>8 => D= 8 or 9 clash, Similarly E= 3 & 4 clash Now for E=5 then N=6 956D 10R5 ===== 1065Y C2+6+R = 1 5 C2= 0 => R=9 wrong C2= 1 => R =8 956D 1085 ===== 1065Y Now D+5>9=>D>4 D=6 then Y=1 It is wrong D= 7 then Y=2 It is correct

23

D= 8 or 9 wrong Result: 9 5 6 7 1085 ===== 10652 Values: S=9,E=5, N=6 , D= 7, M=1,O=0,R=8,E=5 M=1,O=0,N=6,E= 5,Y=2. Problem2: DONALD GERALD ========= ROBERT D+D = C1.T C2+A+A = C3.E C4+O+E= C5.O

C1+ L+ L = C2.R C3+N+R= C4.B C5+D+G= R

Let us assume that there are no carries then O+E = O => E = 0 or 9. D+G>=9. Let D=1 then T= 2. Let L=3 then R= 6. Let A=4 then E=8 Now we have to take N and R-values from 5,7,9. But it is not possible. if it we get carry and O+E=0 condition will fail Consider E=9 C+O+E=0 C4=1; E=9 Let D=1=>T=2;L=3 => R=6 A=4 =>E=8 contradiction LetD=5 => T=0 1+L+L=R Let L= 8 then 1+8+8 = 17 => R=7 and L=8. Since E=9; 1+A+A =E=>A=4. Let B=3 then N+R=B N+7=B B should be either 1,2,3 if B=1 means B=11. N=4 with carry But A=4. Let B=2; N=5 But D=5. So B=3, D+G+Carry = R 5+G+1 =7 So G=1. Result: D O N A L D 526485 GERALD 197485 ROBERT 723970 Values:D=5 ;T=0; L=8; R=7;A=4;N=6;B=3;O=2;E=9;G=1. Problem3: CROSS 96233 ROADS 62513 DANGER 158746

24

Values: C=9;R=6,O=2;S=3;A=5; D=1;E=4;N=8;G=7. Means-ends-analysis: We have presented a collection of search strategies that can reason either forward of backward, but for a given problem, one direction or the other must be chosen. Often, however, a mixture of the two directions is appropriate. Such a mixed strategy would make it possible to solve the major parts of a problem first and then go back and solve the small problems that arise in gluing the big pieces together. A technique known as means-ends analysis allows us to do that. The means-ends analysis process centers on the detection of differences between the current state and the Goal State. Once such a difference is isolated, an operator that can reduce the difference must be found. But perhaps that operator cannot be applied to the current state. So we set up a sub problem of getting to a state in which it can be applied. The kind of backward chaining in which operators are selected and then sub-goals are set up to establish the preconditions of the operators is called operator sub-goaling. Just like the other problem solving techniques we have discussed, means-end- analysis relies on a set of rules that can transform one problem state into another. These rules are usually not represented as a left side that describes the conditions that must be met for the rule to be applicable (these conditions are called the rules preconditions) and a right side that describes those aspects of the problem state that will be changed by the application of the rule. Algorithm: 1. Compare CURRENT to GOAL. IF there are no differences between them then return. 2.Otherwise, select the most important difference and reduce it by doing the following until success or failure is signaled. (a) Select an as yet untried operator 0 that is applicable to the current difference. If there are no such operators, them signal failure. (b) Attempt to apply 0 to CURRENT. Generate descriptions of two states: 0-START, a state in which 0s preconditions are satisfied and 0-RESULT, the state that would result if 0 was applied in 0-START. (c) If (FIRST-PART MEA(CURRENT, 0-START)) And (LAST-PART MEA (0-RESULT, GOAL) are successful, then signal success and return the result of concatenating FIRST PART, 0, and LAST-PART. Ex: Initial state: ( (R & (~PQ)&S)) Goal State:( ((Q V P) & R)&~S) (R & (~P Q)

(~PQ) & R

(~~P V Q) & R

(P V Q) & R (Q V P) & R

25

Knowledge Representation Knowledge is an intellectual acquaintance with, or perception of, fact or truth. A representation is a way of describing certain fragments or information so that any reasoning system can easily adopt it for interfacing purpose. Knowledge representation is a study of ways of how knowledge is actually picturised and how effectively it resembles the representation of knowledge in human brain. A knowledge representation system should provide ways of representing complex knowledge and should possess the following characteristics. 1. The representation scheme should have a set of well-defined syntax and semantics. This help in representing various kinds of knowledge. 2. The knowledge representation scheme should have a good expression capacity. A good expressive capability will catalyze the inference mechanism in its reasoning process. 3. From the computer system point of view, the representation must be efficient. By this we mean that it should use only limited resources with out compromising on the expressive power. Representations and mappings: In order to solve the complex problems encountered in AI, one needs both a large amount of knowledge and some mechanisms for manipulating that knowledge to create solutions to new problems. A variety ways of representing knowledge have been exploited in AI programs. Facts: truths in some relevant world. These are the things we want to represent. Representations: Representations of facts in some choose formalism. These are the things we will actually be able to manipulate. One way to think of structuring these entities is as two levels: The knowledge level: The knowledge level at which facts are described. The symbol level: The symbol level at which representations of objects at the knowledge level are defined in terms of symbols that can be manipulated by programs. Facts Internal Representation English Understanding English Representation English generation

Mappings between Facts and Representation We will call these links representation mappings. The forward representation mapping maps from facts to representations. The backward representation mapping goes other way from representation to facts. One representation of facts is so common that it deserves special mention. Natural language (particularly English) sentences. Regardless of the representation for facts that we use in a program, we may also need to be concerned with an English representation of those facts in order to facilitate getting

26

information in to and out of the system. In this case we must also have mapping functions from English sentences to the representation we are actually going to use and from is back to sentences, Consider the English sentence: Spot is a dog. The fact represented by that English sentence can also be represented in logic as: Dog (Spot) Suppose that we also have a logical representation of the fact that all dogs have tails: x: dog (x)-- has tail (x) Then using the deductive mechanism of logic, we may generate the new representation object: Has tail (spot) Using appropriate backward mapping function we could then generate the English sentence: Spot has a tail. It is important to keep in mind that usually the available mapping functions are not one-to-one. In fact, they are often not even functions but rather many-to-many relations. This particularly of the mapping involving English representations of facts. For example the two sentences All dogs have tails and Every dog has a tail could both represent the same fact, namely that every dog has at least one tail. On the other hand the former could represent either the fact that every dog has at least one tail or the fact that each dog has several tails. The latter may represent whither the fact that every dog has at least one tail or the fact that there is a tail that every dog has. As we will see shortly, when we try to convert English sentences in to some other representation, such as logical propositions, we must first decide what facts the sentences represent and then convert those facts in to the new representation. Approaches to knowledge in a particular domain should possess the following four properties. Representational Adequacy: The ability to represent all the kinds. 2.Relationships among Attributes: The attributes that we use to describe objects are themselves entities that we represent. There are four properties. (1) Inverse 2) Existence in an is a hierarchy (3) Techniques reasoning about values (4) Single valued attributes. 1.Inverses: Entities in the world are related to each other in many different way us. But as soon as we decide to describe those relation ships as attributes, we commit to a perspective in which we focus on one object and look for binary relation ships between it and others. We used the attributes instance, is a, and team. Each of those was being described and terminating at the object representing the value of the specified attribute. In many cases, it is important to represent this other view of relationships. There are two good ways to do this. The first is to represent both relation ships in a single representation that ignores focus. Ex: Team = (Sagar, cricket) The second approach is to use attributes that focus on a single entity but to use them in pairs, one the inverse of the other, One associated with sagar: Team = Cricket One associated with cricket: Team member = Sagar.

27

2. Existence in an is_a hierarchy: Just as there are classes of objects and specialized subsets of those classes, there are attributes and specialization of attributes. These are generalization - specialization relationships are important for attributes for the same reason that they are important for other concepts they support inheritance. 3. Techniques for reasoning about values: Some times values of attributes are specified explicitly when acknowledge base is created. But often the reasoning system must reason about values it has not been given explicitly. Several kinds of information can play a role in this reasoning.

Information about the type of the value. Ex:Length must be a number. Constraints on the value often stated in terms of related entities. Ex: Age of a person cannot be greater than the age of persons parent. Rules for computing the value when it is needed. These rules are called backward rules. Such rules have also been called if needed rules Rules describe should taken if a value every became known. These rules are called forward rules or sometimes if added rules.

4. Single valued attributes: A specific but very useful kind of attributes is one that is guaranteed to take a unique value. Knowledge - representation systems have taken several different approaches to providing support for single - valued attributes. Introduce an explicit notation for temporal interval. If two different values are ever asserted for the same temporal interval, signal a contradiction automatically. Assume that the only temporal interval that is of interest is now so if a new value is asserted. Replace the old value. Provide no explicit support. 3.Choosing the granularity of representation: Regardless of the particular representation formalism, we choose, it is necessary to answer the question At what level of details should the world be represented. Another way this question is often phrased is what should be our primitives? should there be a small number of low-level ones or should there be a larger number covering a range of granularities? The major advantage of converting all statements into a representation in terms of a small set of primitives is that the written only in terms of the primitives rather than in terms of the many ways in which the knowledge may originally have appeared. Several AI programs including those described by schank and Abelsan and woks are based on knowledge bases described in terms of a small number of low-level primitives. There are several arguments against the use of low-level primitives. One is the simple high level facts may require a lot of storage when broken down into primitives. A second but related problem is that if knowledge is initially presented to the system in a relatively high level form such as English, and then substantial work must be done to reduce the knowledge into primitive form. A third problem with the use of low-level primitives is that in many domains; it is not at all clear what the premises should be. Ex: John spotted Sue. Who spotted Sue?. Here the direct answer to the question is yes. Did John see Sue?. The obvious answer that we may give is yes. But for AI to reason it out we need to add a fact: Spotted(x,y)sow(x,y). Here we break the idea of spotting into more primitive concept of seeing.

28

1.

Representing sets of objects: It is important to be able to represent sets of objects for several reasons. One is that there are some properties that are true of sets that are not true of the individual members of a set. There are two ways to state a definition of a set and its elements. The first is to list the members. Such a specification is called an extensional definition. The second is to provide a rule that when a particular object is evaluated, returns true or false depending on where the object is in the set or not. Such a rule is called an intensional definition. While it is trivial to determine whether two sets are identical if extensional descriptions are used, it may be very difficult to do so using intension descriptions. Intensional representations have two important properties that extensional an lack. The first is they can be used to describe infinite sets and sets not all of whole elements are explicitly known. Thus we can describe intentionally such sets as prime numbers. The second thing we can do with intensional descriptions is to allow them to depend on parameter that can change, such as time or spatial location. The advantages that an intensional definition has over the extensional definition are: 1. intensional representations can be used to describe infinite sets and sets not all of whose elements are explicitly known. Ex: sets of prime numbers or kings of England. 2. intentional definition allows us to depend on parameters that can change. Ex: the president of the united states used to be a pemocrot.

5. Finding the right structures as needed: In fact, in order to have access to the right structure for describing a particular situation, it is necessary to solve all of the following problems. 1. How to perform an initial selection of the most appropriate structure 2. How to fill in appropriate details from the current situation. 3. How to find a better structure if the one chosen initially terms cut not to be appropriate. 4. What to do if none of the available structures is appropriate. 5. When to create and remember a new structure. General-purpose method for solving all these problems. Some knowledge representation techniques solve it of them. In this section we survey some solutions to two of these problems. Now to select an initial structure to consider and how to find a better structure if one terms out not to be a good match. 1. Selecting an initial structure: Selecting candidate knowledge structures to match a particular problemsolving situation is a hard problem. There are several ways in which it can be done. Their important approaches are the following. 1. Index the structures directly by the significant English words that can be used to describe them. Disadvantages: a. many words may have several different meanings. Ex: I. john flew to newyork. II. john flew the kite. flew here had different meaning in two different contexts. b. it is useful only when there is an English description of the problem. 2. Consider each major concept as a pointer to all of the structures in which it might be involved. Ex: I. the concept steak might point to two scripts, one for restaurant and the other for supermarket.

29

II.

The concept bill might point to as restaurant script or a shopping script. We take the intersection of these sets get the, structure that involves all the content words.

Disadvantages: I. if the problem contains extraneous concepts then the intersection will result as empty. II.. It may require a great deal of computation to compute all the possible sets and then to interest them. 3. Locate one major clue in the problem description and use if to select an initial structure. Disadvantages: I. We cant identify a major clue in some situation. II. It is difficult to anticipate which clues are important and which are not. 2. Revising the choice when necessary: Depending on the representation we are using, the details of the matching process will vary. If may require variables to be bound to objects. If may require attributes to have their values. Compared in any case, if values that satisfy the required restrictions as imposed by the knowledge structure can be found, they are put into the appropriate places in the structures. If no appropriate structure can be found them a new structure must be selected. The way in which the attempt to instantiated this first structure failed may provide useful can as to which one to try next if on the other hand, appropriate values can be found, them the current structure can be taken to be appropriate for describing the current situation. FRAME PROBLEM Frame problem is a problem of representing the facts that change as well as those that do not change. For ex. Consider a table with plant on it under a window. Suppose we move it to the center of the room. Here we must infer that plant is now in the center, but the window is not. Frame axioms are used to describe all the things that do not change when an operator is applied in state to goto another state say n+1. Ex: colour(x,y,s1) ^move (x,s1,s2) colour(x,y,s2) This axiom says that an object x has a colour y in state 1. moving x from state 1 to state 2 will not change the color of the object x. once a change of state occurs how we undo the changes if we need to back track the two ways that are provided are I. Do not modify the initial state description. At each node, simply store an indication of the specific change that should be made. In order to refer to the current state, we start from the initial state and look back all the nodes on the path from start state to current state. II. Make the changes to the initial state as they occur but every node where a change takes place, gives what to do to undo the move or change if we need to back track. Different kinds knowledge: Simple relational knowledge. Inheritable knowledge. Inferential knowledge. Procedural knowledge. Epistemology. Meta knowledge

30

One can represent information about an object or an event by means of a database manipulated about an object or an event by means of a database management system even though holds information, do not hold the facility for representing and manipulating of facts like All carnivorous have sharp teeth. Cheetah is a carnivore. Hence cheetah has sharp teeth from the first two statements, the last one can be informed. In a DBMS until one specifies that cheetah has a sharp tooth. It is not possible to get this information. Database 1. Collection of data representing facts 2. Large volume of data and facts change over time 3. Operates on a single object 4. Updates are performed by clerical personnel 5. Correctness of facts can be determined by comparing the data value with real world observations 6. All information needed to be explicitly stated 7. Maintained for operational purpose 8. Represented by relational or network hierarchical model 9. Predominant way of interaction is by transaction programs and report generators Different kinds of knowledge representations: Declarative representation of knowledge: This controversy raged in 1970s where in there was a heavy debate on which type of representation should be used in AI programs. A Declarative representation declares every piece of knowledge and permits the reasoning system to use the rules of inference like modus ponens, modus tokens, etc., to come out with new piece of information. Ex: All Carnivorous have sharp teeth. Cheetah is a carnivore. This can be represented using a declarative representation as x (carnivore(x) sharp teeth(x)) Carnivore (cheetah) Knowledge Base 1. Has information at higher level of Abstraction 2. Significantly smaller than database and changes are gradual 3. Operates on a class of objects rather than a single object 4. Updates are performed by domain experts 5. Correctness in a sense is very elusive 6. Has the power of inferencing 7. Used for data analysis and planning 8. Knowledge representation is by logic or rules or frames or semantic rules. 9. Has to have a consultation with the system and provide needed data to obtain the solution

31

Using these two representations, it is possible to deduce that cheetah has sharp teeth. Advantages: 1. Declarative approaches are flexible. 2. Each piece of knowledge is an independent chunk on its own. Hence modularity is higher. 3. It is enough that you represent the knowledge only once. For all x (carnivore (x)sharp teeth (x)) The variable x engulfs on wide variety of animals, which are carnivorous in nature. Procedural representation of knowledge: This represents knowledge as procedures and the inferencing mechanism manipulates these procedures to arrive at the result. Procedure carnivore (x); If (x = cheetah) then return true else return false End procedure carnivore (x) Procedure sharp_teeth (x); If carnivore (x) then return true else return false End procedure sharp_teeth (x) Advantages: Procedural representations also have many advantages. First and foremost, heuristic knowledge can be easily represented which is vital. Secondly, one has the control over search, which is not available in declarative knowledge representation. A knowledge representation scheme should have both procedural and declarative schemes for effective organization of the knowledge base. Knowledge may be declarative or procedural. Procedural knowledge is compiled knowledge related to the performance of some task. For example, the steps used to solve and algebraic equation are expressed as procedural knowledge. Declarative knowledge on the other hand is passive knowledge expressed as statements of facts about the world. Personnel data in a database is typical of declarative knowledge such data are explicit pieces of independent knowledge. We define knowledge as justified belief. Two other knowledge terms, which we shall use occasionally, is epistemology and meta knowledge. Epistemology is the study of the nature knowledge whereas meta knowledge is knowledge that is what we know. Different kinds of widely known knowledge representation: 1. Semantic Nets 2. Frames 3. Conceptual dependency 4. Scripts Semantic Networks: Network representations provide a means of structuring and exhibiting the structure in knowledge. In a network, pieces of knowledge are clustered together into coherent semantic groups. Networks also provide a more natural way to map to and from natural language than do other representation schemes. Network representation gives a pictorial presentation of objects, their attributes and the relationships that exist between them and other entities. These are also known as associative networks. Associative networks are directed graph with label nodes and arcs or arrows. A semantic network or semantic net is a structure for representing knowledge as a pattern of interconnected nodes and arcs. It is also defined as a graphical representation of knowledge. The knowledge used in

32

constructing a network is based on selected domain primitives for objects and relations as well as some general primitives. Knowledge is defined as the piece of information that helps in decision-making. Intelligence can be defined as the ability to draw useful inferences from the available knowledge. Wisdom is the maturity of the mind that directs its intelligence to achieve desired goals. Knowledge Relation: Wisdom

Intelligence ms sexists and that node have to center to all of them. Individual or instance nodes explicitly state that they are specific instances of a generic node. HCL Horizon-III is an individual node because it is a very specific instance of the mini-computer system.

Line-printer

Bharathiar University Computer Center

Mini-computer system

HCL Horizon-III

30 Hammer-bank Dumb-terminal

Coimbatore

Bharathiar University

Y

keyboard

monitor

1. Generic node to generic nodeTwo-wheeler

Is-a

Moving-vehicle

2. Individual node to generic nodeHCL Horizon III

Is-a

Mini-computer system

An is-a link is a special type of link because it provides facilities to link a generic node and a generic node and individual node and a generic node. Another major feature of the is-a link is that it generates hierarchical structure with the network.33

This is a link has another major property which is called inheritance. The property of inheritance is that the properties, which a most a generic node possesses, are transmitted to various specific instances of the generic node. Reasoning using semantic networks: Reasoning using semantic networks is an easy task. All that has to be done is to specify the start node. From the initial node, other nodes are pursued using the links until the final node is reached. To answer the question What is the speed of the line printer? from the above figure. The reasoning mechanism first finds the node of line printer. It identifies the arc that has the characteristics speed since it points to the value 300, the answer is 30. The is a link structure can be easily represented using predicate logic. Road vehicle is a land vehicle. x: road-vehicle (x) land-vehicle (x) 1. Marcus is a man Man (Marcus) Marcus man (in predicate logic) (in semantic net)

Partitioned Semantic net: Suppose we want to represent simple quantified expressions in semantic nets. One way to do this is to partition the semantic net into a hierarchical set of spaces, each of which corresponds to the scope of one or more variables. Ex:The dog bit the mail carrier.Dog Isa assailant d b Bite Mail-carrier isa victim m

isa

The nodes dog, bite and mail carrier represent the class of dog, biting and mail carriers respectively, while the nodes d, b and m represent a particular biting and a particular mail carrier. This fact can be easily be represented by a single net with no partitioning. But now suppose that we want to represent the fact Every dog has bitten a mail carrier.

SAGS Dogs Isa Bite isa Mail carrier isa

Assailant 34 victim

g

d

b

m

To represent this fact, it is necessary to encode the scope of the universally quantified x. The node g stands for the assertion given above. Node g is an instance of the special class GS of general statement about the world. Every element of GS has as least two attributes. A form, which states the relation that is being asserted, and one or more connections, one for each of the universally quantified variables. There is only one such variable d., which and stand for any element of the class dogs. The other two variables in the form, b and m are under stood to be existentially quantified. In other words, for every dog d, there exists a betting event b, and mail Carrie n, such that d is the assailant of b and m is the victim. Every dog in town has bitten the constableSA Dogs GS Town-Dogs Bite Constable

g d

Isa Assailant b

isa victim C

In this net, the node c representing the victim lies out side the form of the general statement. Thus it is not viewed as an existentially quantified variable whose value may depend on the value of d, instead it is interpreted as standing for a specific entity. (in this case, a particular constant), just as do other nodes in a standard, non partitioned. Every dog has bitten every mail carrierSA Dogs isa d assailant b Bite isa victim Mail-carrier isa m

GS 35

g

Would be represented. In this case, g has two links, one pointing to d, which represents any dog, and one pointing to m, representing any mail carrier. An inclusion hierarchy relates the spaces of a partitioned semantic net to each other For example, in above space SI is included in space SA. Whenever a search process operates in a partitioned semantic net, it can explore nodes and arcs in the space from which it starts and in other spaces that contain the starting point, but it cannot go downwards, except in special circumstances, such as when a form are is being traversed. So, returning to above figure, from node d it can be determined that d must be a dog. But if we were to start at the node dogs and search for all known instances of dogs by traversing is a links, we would not find d since it and the link to it are in the space SI, Which is at a lower level than space SA, which Contains Dogs. This is important, since d does not stand for a particular dog; it is merely a variable that can be instantiated with a value that represents a dog. Example: Every batter hit a ball. Forall x: Batter(x) there exist:Ball(Y)and hit(x,y)

SAGS Batter Isa g B H Hit isa B Ball isa

Assailant

victim

All the batters like the pitcher.

For all x: Batter(x)like(pitcher)

Batters GS

Like

Pitcher

g

Isa B Assailant

isa L victim P

36

Conceptual Graphs: A conceptual graph is a graphical portrayal of a mental perception, which consists of basic of primitive concepts and relationships that exists between the concepts. A single conceptual graph is roughly equivalent to a graphical diagram of a natural language sentence where the words are depicted as concepts and relationships. Conceptual graphs may be regarded as formal building blocks for associative networks which when linked together in a coherent way, from a more complex knowledge structure. A concept may be individual or generic. Ex : Joe is eating soup with a spoon Joe and food(soup) are individual (objects) Eat and spoon are genericJoe agent ea t object Food : soup

Instrument Spoon Conceptual graphs offer the means to represent natural language statements accurately and to perform many forms of inference found in common sense reasoning. Frames : Frames were first introduced by Marvin Minsky (1975) and a data structure to represent a mental model of a stereotypical situation such as driving a car, attending a meeting or eating in a restaurant. Frames are general record like structures, which consist of a collection of slots and slot values. The slots may be of any size and any type. Slots typically have names and any number of values. A frame can be defined as a data structure that has slots for various objects and collection of frames consists of expectations for a given situation. A frame structure provides facilities for describing objects, facts about situations, procedures on what to when a situation is encountered because of these facilities a frame provides, frames are used to represent the two types of knowledge. Declarative/factual and procedural. Ex :Name : Computer Centre Air-condition Computer Printer Stationary cupboard Dumb-terminal Dumb-terminal

Name of the frame Slots in the frame

Declarative and Procedural frames: A frame that merely contains description about objects is called a declarative type/factual/situational frame.

37

Name :AC unit Model Capacity Power cons AC unit Name: computer Model CPU Memory Name: printer Model speed Font quality Printer Dumb terminal Computer Stationary cupboard Dumb terminal Name : Computer Center Name: stationary cupboard

Length Breadth Height

Name: terminal Monitor type Keyboard type

A part from the declarative part in a frame, it is also possible to attach slots, which explain how to perform things. In other words it is possible to have procedural knowledge represented in a frame. Such frames which have procedural knowledge embedded in it are called action procedure frames. The action frame has the following slots. 1. Actor slot: which holds information about who is performing the activity. 2. Object slot : this frame information about the item to be operated on 3. Source slot: source slot holds information from where the action has to begin. 4. Destination slot: holds information about the place where action has to end. 5. Task slot: This generates the necessary sub-frames required to perform the operation. Ex :Name: cleaning the jet of carburetor Expert: actor Carburetor: Object Scooter: source Remove carburetor: task1 Scooter: destination Fix carburetor: task3

Clean nozzle: task2

38

The generic frame merely describes that, the expert in order to clean the nozzle of the scooter has to merely perform, the following operations: Removing the carburetor from the scooter Opening it up to expose all parts Cleaning the nozzle Refitting it in the scooter. Here source and destination is scooter. Reasoning using frames: The task of action frames is to provide facility for procedural attachment and help transforming from initial to goal state. It also helps in breaking the entire problem in to sub-tasks, which can be described as top-down methodology. It is possible for one to represent any tasks using these action frames. Reasoning using frames is done by instantiation. Instantiation process begins when the given situation is batches with frames that already exist. The reasoning process tries to match the frame with the situation and latter fills up slots for which values must be assigned. The values assigned to the slot depict a particular situation and but this reasoning process tries to move from one frame to another to match the current situation. This process builds up a wide network of frames, there by facilitating one to build a knowledge base for representing knowledge about common sense. Frame-based representation language: Frame representations have become popular enough that special high level frame-based representation language have been developed. Most of languages use LISP as the host language. They typically have functions to create access, modify updates and display frames. Implementation of frame structures: One way to implement frames is with property lists. An atom is used as the frame name and slots are given as properties. Facets and values with in slots become lists of lists for the slot property. Putprop train((type(value passenger)) (class(value first second sleeper)) (food(restaurant(value hot-meals)) (fast-food(value cold snacks))) land transport)

39

Another way to implement frames is with an association list ( an-a-list), that is, a list of sub lists where each sub list contains a key and one or more corresponding values. The same train frame would be represented using an a-list as (set Q train ((AKO land transport) (type(value passenger)) (class(value first second sleeper)) (food(restaurant(value hot-meals)) (fast-food(value cold snacks))) It is also possible to represent frame like structures using Object oriented programming extensions to LISP languages such as Flavors. Scripts: Scripts are another structures representation scheme introduced by Roger Schank (1977). They are used to represent sequences of commonly accruing events. They were originally developed to capture the meanings of stories or to understand natural language test. A script is a predefined frame-like structure, which contains expectations, inferences and other knowledge that is relevant to a stereotypical situation. Frames represented a general knowledge representation structure, which can accommodate all kinds of knowledge. Scripts on the other hand help exclusive in representing stereotype events that takes place in day-to-day activity. Some such events are 1. Going to hotel, eating something, paying the bill and exiting. 2. Going to theatre, getting a ticket, viewing the film and leaving. 3. Going to super market, with a list of items to be purchased, putting the items needed on a trolley, paying for them. 4. Leaving home for office in a two-wheeler, parking the two-wheeler at the railway station, boarding the train to the place of work and going to the place of work. 5. Going the bank for with drawl, filling the with drawl slip/check, presenting to the cashier, getting the money and leaving the bank. All the situations are stereotype in nature and specific properties of the restricted domain can be exploited with special purpose structures. A script is a knowledge representation structure that is extensively used for describing stereo typed sequences of action. It is a special case of frame structure. These are interested for capturing situations in which behavior is very stylized. Scripts tell people what can happen in a situation, what events follow and what role every actor plays. It is possible to visualize the same and scripts present a way of representing them effectively what a reasoning mechanism exactly understand what happens at that situation. Reasoning with Scripts: Reasoning in a script begins with the creation of a partially filled script named to meet the current situation. Next a known script which matches the current situation is recalled from memory. The script name, preconditions or other key words provide index values with which to search for the appropriate script. An inference is accomplished by filling in slots with inherited and defaults values that satisfy certain conditions. Advantages:

40

1. Permits one to identify what scenes must have been proceed when an event takes place. 2. It is possible using scripts to describe each and every event to the minutest detail so that enough light is thrown on implicitly mentioned events. 3. Scripts provide a natural way of providing a single interpretation from a variety of observations. 4. Scripts are used in natural language understanding system and serve their purpose effectively in areas for which they are applied.

Disadvantages: 1. It is difficult to share knowledge across scripts what is happening in a script is true only for that script. 2. Scripts are designed to represent knowledge in stereo type situations only and hence cannot be generalized. Important components: 1. Entry condition: Basic conditions that must be fulfilled. Here customer is hungry and has money to pay for the eatables. 2. Result: Presents the situations, which describe what, happens after the script has occurred. Here, the customer after satisfying his hungry is no hungrier. The amount of money he has is reduced and the owner of the restaurant has now more money. Captional results can also be stated here like the customer is pleased with the quality of food, quality of service etc., or can be displeased. 3. Properties: These indicate the objects that ate existing in the script. In a restaurant on has tables, chairs, menu, food money, etc.. 4. Roles: What various characters play is brought under the slot of roles. These characters are implicitly involved but some of them play an explicit role. For example waiter and cashier play an explicit role where the cook and owner are implicitly involved. 5. Track: Represents a specific instance of a Scene 1: EnteringRestaurant is a specific instance of a generic pattern. the restaurant hotel. Customer enter into the restaurant . This slot permits one to inherit the characteristics of the generic node. restaurant Customer PTRANS 6. Scenes: Sequences of activities are described in detail.scans the tables. Customer Script: Going to a restaurant Customer ATTEND eyes to the tables Ex1: Going to a restaurant Entry Conditions: Customer is hungry Customer decides where to sit. Customer has money Customer MBUILD to sit there Owner has food Scene 2: Ordering the food Ex 2 : Going to super menu, money Props: Food, tables, market Customer asksEnter market Scene 1: for menu. Customer MTRANS for menu Roles: 1.Explicit:acustomer, waiter, Waiter Shopper Ptrans into market menu brings it. Waiter PTRANS the Script: Going to super market cashier Customer decides choice of food. to shopper Track: Super market Shopper Ptrans shopping cart 2.Implicit:Owner,Coocker Customer MBUILD for items food Roles: Implicit Roles: Owner of supermarket. Scene 2: Shop choice of Track: Restaurant Customer orders that food. Customer MTRANSaisles Producer of items. Shopper MOVES shopper through that food. Results:Explicit Roles: Shopper,attendants, Scene 3: Eating the food Customer is not hungry Shopper ATTENDS eyes to display items Owner has more money Cook gave food to waiter. Cook ATRANS food cart Clerks, cashier. Shopper Ptrans items to shoppers to waiter. Customer Shoppermoneygroceries Waiter gave 3 : Checkto customer. has less needs the food out Entry Conditions : Scene Owner has less food. Waiter ATRANS foodMOVES to check out stand food market open Shopper to customer. Customer eats the food with a spoon. to charges Prop : Shopping cart, display aisles, Shopper ATTENDS eyes Customer INGESTS the foodmoney to cashier market items, checkout stands, cashier, money Shopper Atrans with a spoon. Scene 4: Paying the Atrans bags to shopper Results : Shopper has less money Sacker bill Customer asks Exit market Shopper has grocery items Scene 4 : for bill. Customer MTRANS for bill. Waiter brings it. Waiter PTRANS it. to exit to market Market has less grocery items Shopper Ptrans shopper Customer gave a check to waiter. Market has more money Customer ATRANS a check to waiter. Waiter brings the balance amount. 41 Waiter PTRANS the balance amount. Customer gave tip to waiter. Customer ATRANS to him Customer moves out. Customer PTRANS out .

Conceptual Dependency (CD): Conceptual dependency is a theory of how to represent the kind of knowledge about events that is usually contained in natural sentences. The goal is to represent the knowledge in a way that Facilitates drawing interference from the sentences. Is independent of the language in which the sentences were originally stated. The theory was first described in Schank 1973 and was further developed in Schank 1975. It has been implemented in a variety of programs that read and understand natural language text. Unlike semantic nets provide only a structure in to which nodes representing information at any level can be placed. Conceptual dependency provides both structure and a specific set of primitives, at a particular level of granularity out of which representations of particular pieces of information can be constructed. Conceptual dependency (CD) is a theory of natural language processing which mainly deals with representation of semantics of a language. The main motivation for the development of CD as a knowledge representation techniques are given below. To construct computer programs that can understand natural language. To make inferences from the statements and also to identify conditions in which two sentences can have similar meaning. To provide facilities for the system to take part in dialogues and answer questions. To provide a necessary plank that sentences in one language can be easil