Showing posts with label Stanford University. Show all posts
Showing posts with label Stanford University. Show all posts

Friday, August 22, 2008

Lisp (programming language)

Lisp (or LISP) is a family of computer programming languages with a long history and a distinctive, fully parenthesized syntax. Originally specified in 1958, Lisp is the second-oldest high-level programming language in widespread use today; only Fortran is older. Like Fortran, Lisp has changed a great deal since its early days, and a number of dialects have existed over its history. Today, the most widely known general-purpose Lisp dialects are Common Lisp and Scheme.

Lisp was originally created as a practical mathematical notation for computer programs, based on Alonzo Church's lambda calculus. It quickly became the favored programming language for artificial intelligence (AI) research. As one of the earliest programming languages, Lisp pioneered many ideas in computer science, including tree data structures, automatic storage management, dynamic typing, object-oriented programming, and the self-hosting compiler.

The name Lisp derives from "List Processing Language". Linked lists are one of Lisp languages' major data structures, and Lisp source code is itself made up of lists. As a result, Lisp programs can manipulate source code as a data structure, giving rise to the macro systems that allow programmers to create new syntax or even new domain-specific programming languages embedded in Lisp.

The interchangeability of code and data also gives Lisp its instantly recognizable syntax. All program code is written as s-expressions, or parenthesized lists. A function call or syntactic form is written as a list with the function or operator's name first, and the arguments following; for instance, a function f that takes three arguments might be called using (f x y z).

From Wikipedia, the free encyclopedia

The People behind AI

John McCarthy -- Father of AI, also developed the LISP language.
Marvin Minsky -- Founder of the MIT AI laboratory.
Alan Turing -- Known for the Turing test; Researched computer-nature relationship.
Norbert Wiener -- Developed the field of cybernetics.

Rich and poor entities

Consider my next trip to Japan. Considered as a plan it is a discrete object with limited detail. I do not yet even plan to take a specific flight or to fly on a specific day. Considered as a future event, lots of questions may be asked about it. For example, it may be asked whether the flight will depart on time and what precisely I will eat on the airplane. We propose characterizing the actual trip as a rich entity and the plan as a poor entity. Originally, I thought that rich events referred to the past and poor ones to the future, but this seems to be wrong. It's only that when one refers to the past one is usually referring to a rich entity, while the future entities one refers to are more often poor. However, there is no intrinsic association of this kind. It seems that planning requires reasoning about the plan (poor entity) and the event of its execution (rich entity) and their relations.

(McCarthy and Hayes 1969) defines situations as rich entities. However, the actual programs that have been written to reason in situation calculus might as well regard them as taken from a finite or countable set of discrete states.

Possible worlds are also examples of rich entities as ordinarily used in philosophy. One never prescribes a possible world but only describes classes of possible worlds.

Rich entities are open ended in that we can always introduce more properties of them into our discussion. Poor entities can often be enumerated, e.g. we can often enumerate all the events that we consider reasonably likely in a situation. The passage from considering rich entities in a given discussion to considering poor entities is a step of nonmonotonic reasoning.

It seems to me that it is important to get a good formalization of the relations between corresponding rich and poor entities. This can be regarded as formalizing the relation between the world and a formal model of some aspect of the world, e.g. between the world and a scientific theory.

ARTIFICIAL INTELLIGENCE, LOGIC AND FORMALIZING COMMON SENSE

John McCarthy
Computer Science Department
Stanford University
Stanford, CA 94305
jmc@cs.stanford.edu
http://www-formal.stanford.edu/jmc/

1990

Introduction



This is a position paper about the relations among artificial intelligence (AI), mathematical logic and the formalization of common-sense knowledge and reasoning. It also treats other problems of concern to both AI and philosophy. I thank the editor for inviting it. The position advocated is that philosophy can contribute to AI if it treats some of its traditional subject matter in more detail and that this will advance the philosophical goals also. Actual formalisms (mostly first order languages) for expressing common-sense facts are described in the references.

Common-sense knowledge includes the basic facts about events (including actions) and their effects, facts about knowledge and how it is obtained, facts about beliefs and desires. It also includes the basic facts about material objects and their properties.

One path to human-level AI uses mathematical logic to formalize common-sense knowledge in such a way that common-sense problems can be solved by logical reasoning. This methodology requires understanding the common-sense world well enough to formalize facts about it and ways of achieving goals in it. Basing AI on understanding the common-sense world is different from basing it on understanding human psychology or neurophysiology. This approach to AI, based on logic and computer science, is complementary to approaches that start from the fact that humans exhibit intelligence, and that explore human psychology or human neurophysiology.

This article discusses the problems and difficulties, the results so far, and some improvements in logic and logical languages that may be required to formalize common sense. Fundamental conceptual advances are almost certainly required. The object of the paper is to get more help for AI from philosophical logicians. Some of the requested help will be mostly philosophical and some will be logical. Likewise the concrete AI approach may fertilize philosophical logic as physics has repeatedly fertilized mathematics.

There are three reasons for AI to emphasize common-sense knowledge rather than the knowledge contained in scientific theories.

(1) Scientific theories represent compartmentalized knowledge. In presenting a scientific theory, as well as in developing it, there is a common-sense pre-scientific stage. In this stage, it is decided or just taken for granted what phenomena are to be covered and what is the relation between certain formal terms of the theory and the common-sense world. Thus in classical mechanics it is decided what kinds of bodies and forces are to be used before the differential equations are written down. In probabilistic theories, the sample space is determined. In theories expressed in first order logic, the predicate and function symbols are decided upon. The axiomatic reasoning techniques used in mathematical and logical theories depend on this having been done. However, a robot or computer program with human-level intelligence will have to do this for itself. To use science, common sense is required.

Once developed, a scientific theory remains imbedded in common sense. To apply the theory to a specific problem, common-sense descriptions must be matched to the terms of the theory. For example, tex2html_wrap_inline276 does not in itself identify d as the distance a body falls in time t and identify g as the acceleration due to gravity. (McCarthy and Hayes 1969) uses the situation calculus discussed in that paper to imbed the above formula in a formula describing the common-sense situation, for example

equation20

Here x is the falling body, and we are presuming a language in which the functions height, time, etc. are formalized in a way that corresponds to what the English words suggest. s and s' denote situations as discussed in that paper, and F(s,s') asserts that the situation s' is in the future of the situation s.

(2) Common-sense reasoning is required for solving problems in the common-sense world. From the problem solving or goal-achieving point of view, the common-sense world is characterized by a different informatic situation than that within any formal scientific theory. In the typical common-sense informatic situation, the reasoner doesn't know what facts are relevant to solving his problem. Unanticipated obstacles may arise that involve using parts of his knowledge not previously thought to be relevant.

(3) Finally, the informal metatheory of any scientific theory has a common-sense informatic character. By this I mean the thinking about the structure of the theory in general and the research problems it presents. Mathematicians invented the concept of a group in order to make previously vague parallels between different domains into a precise notion. The thinking about how to do this had a common-sense character.

It might be supposed that the common-sense world would admit a conventional scientific theory, e.g. a probabilistic theory. But no one has yet developed such a theory, and AI has taken a somewhat different course that involves nonmonotonic extensions to the kind of reasoning used in formal scientific theories. This seems likely to work better.

Aristotle, Leibniz, Boole and Frege all included common-sense knowledge when they discussed formal logic. However, formalizing much of common-sense knowledge and reasoning proved elusive, and the twentieth century emphasis has been on formalizing mathematics. Some important philosophers, e.g. Wittgenstein, have claimed that common-sense knowledge is unformalizable or mathematical logic is inappropriate for doing it. Though it is possible to give a kind of plausibility to views of this sort, it is much less easy to make a case for them that is well supported and carefully worked out. If a common-sense reasoning problem is well presented, one is well on the way to formalizing it. The examples that are presented for this negative view borrow much of their plausibility from the inadequacy of the specific collections of predicates and functions they take into consideration. Some of their force comes from not formalizing nonmonotonic reasoning, and some may be due to lack of logical tools still to be discovered. While I acknowledge this opinion, I haven't the time or the scholarship to deal with the full range of such arguments. Instead I will present the positive case, the problems that have arisen, what has been done and the problems that can be foreseen. These problems are often more interesting than the ones suggested by philosophers trying to show the futility of formalizing common sense, and they suggest productive research programs for both AI and philosophy.

In so far as the arguments against the formalizability of common-sense attempt to make precise intuitions of their authors, they can be helpful in identifying problems that have to be solved. For example, Hubert Dreyfus (1972) said that computers couldn't have ``ambiguity tolerance'' but didn't offer much explanation of the concept. With the development of nonmonotonic reasoning, it became possible to define some forms of ambiguity tolerance and show how they can and must be incorporated in computer systems. For example, it is possible to make a system that doesn't know about possible de re/de dicto ambiguities and has a default assumption that amounts to saying that a reference holds both de re and de dicto. When this assumption leads to inconsistency, the ambiguity can be discovered and treated, usually by splitting a concept into two or more.

If a computer is to store facts about the world and reason with them, it needs a precise language, and the program has to embody a precise idea of what reasoning is allowed, i.e. of how new formulas may be derived from old. Therefore, it was natural to try to use mathematical logical languages to express what an intelligent computer program knows that is relevant to the problems we want it to solve and to make the program use logical inference in order to decide what to do. (McCarthy 1959) contains the first proposals to use logic in AI for expressing what a program knows and how it should reason. (Proving logical formulas as a domain for AI had already been studied by several authors).

The 1959 paper said:

The advice taker is a proposed program for solving problems by manipulating sentences in formal languages. The main difference between it and other programs or proposed programs for manipulating formal languages (the Logic Theory Machine of Newell, Simon and Shaw and the Geometry Program of Gelernter) is that in the previous programs the formal system was the subject matter but the heuristics were all embodied in the program. In this program the procedures will be described as much as possible in the language itself and, in particular, the heuristics are all so described.

The main advantages we expect the advice taker to have is that its behavior will be improvable merely by making statements to it, telling it about its symbolic environment and what is wanted from it. To make these statements will require little if any knowledge of the program or the previous knowledge of the advice taker. One will be able to assume that the advice taker will have available to it a fairly wide class of immediate logical consequences of anything it is told and its previous knowledge. This property is expected to have much in common with what makes us describe certain humans as having common sense. We shall therefore say that a program has common sense if it automatically deduces for itself a sufficiently wide class of immediate consequences of anything it is told and what it already knows.

The main reasons for using logical sentences extensively in AI are better understood by researchers today than in 1959. Expressing information in declarative sentences is far more modular than expressing it in segments of computer program or in tables. Sentences can be true in much wider contexts than specific programs can be useful. The supplier of a fact does not have to understand much about how the receiver functions, or how or whether the receiver will use it. The same fact can be used for many purposes, because the logical consequences of collections of facts can be available.

The advice taker prospectus was ambitious in 1959, would be considered ambitious today and is still far from being immediately realizable. This is especially true of the goal of expressing the heuristics guiding the search for a way to achieve the goal in the language itself. The rest of this paper is largely concerned with describing what progress has been made, what the obstacles are, and how the prospectus has been modified in the light of what has been discovered.

The formalisms of logic have been used to differing extents in AI. Most of the uses are much less ambitious than the proposals of (McCarthy 1959). We can distinguish four levels of use of logic.

1. A machine may use no logical sentences--all its ``beliefs'' being implicit in its state. Nevertheless, it is often appropriate to ascribe beliefs and goals to the program, i.e. to remove the above sanitary quotes, and to use a principle of rationality--It does what it thinks will achieve its goals. Such ascription is discussed from somewhat different points of view in (Dennett 1971), (McCarthy 1979a) and (Newell 1981). The advantage is that the intent of the machine's designers and the way it can be expected to behave may be more readily described intentionally than by a purely physical description.

The relation between the physical and the intentional descriptions is most readily understood in simple systems that admit readily understood descriptions of both kinds, e.g. thermostats. Some finicky philosophers object to this, contending that unless a system has a full human mind, it shouldn't be regarded as having any mental qualities at all. This is like omitting the numbers 0 and 1 from the number system on the grounds that numbers aren't required to count sets with no elements or one element. Indeed if your main interest is the null set or unit sets, numbers are irrelevant. However, if your interest is the number system you lose clarity and uniformity if you omit 0 and 1. Likewise, when one studies phenomena like belief, e.g. because one wants a machine with beliefs and which reasons about beliefs, it works better not to exclude simple cases from the formalism. One battle has been over whether it should be forbidden to ascribe to a simple thermostat the belief that the room is too cold. (McCarthy 1979a) says much more about ascribing mental qualities to machines, but that's not where the main action is in AI.

2. The next level of use of logic involves computer programs that use sentences in machine memory to represent their beliefs but use other rules than ordinary logical inference to reach conclusions. New sentences are often obtained from the old ones by ad hoc programs. Moreover, the sentences that appear in memory belong to a program-dependent subset of the logical language being used. Adding certain true sentences in the language may even spoil the functioning of the program. The languages used are often rather unexpressive compared to first order logic, for example they may not admit quantified sentences, or they may use a different notation from that used for ordinary facts to represent ``rules'', i.e. certain universally quantified implication sentences. Most often, conditional rules are used in just one direction, i.e. contrapositive reasoning is not used. Usually the program cannot infer new rules; rules must have all been put in by the ``knowledge engineer''. Sometimes programs have this form through mere ignorance, but the usual reason for the restriction is the practical desire to make the program run fast and deduce just the kinds of conclusions its designer anticipates. We believe the need for such specialized inference will turn out to be temporary and will be reduced or eliminated by improved ways of controlling general inference, e.g. by allowing the heuristic rules to be also expressed as sentences as promised in the above extract from the 1959 paper.

3. The third level uses first order logic and also logical deduction. Typically the sentences are represented as clauses, and the deduction methods are based on J. Allen Robinson's (1965) method of resolution. It is common to use a theorem prover as a problem solver, i.e. to determine an x such that P(x) as a byproduct of a proof of the formula tex2html_wrap_inline304 . This level is less used for practical purposes than level two, because techniques for controlling the reasoning are still insufficiently developed, and it is common for the program to generate many useless conclusions before reaching the desired solution. Indeed, unsuccessful experience (Green 1969) with this method led to more restricted uses of logic, e.g. the STRIPS system of (Nilsson and Fikes 1971).

The commercial ``expert system shells'', e.g. ART, KEE and OPS-5, use logical representation of facts, usually ground facts only, and separate facts from rules. They provide elaborate but not always adequate ways of controlling inference.

In this connection it is important to mention logic programming, first introduced in Microplanner (Sussman et al., 1971) and from different points of view by Robert Kowalski (1979) and Alain Colmerauer in the early 1970s. A recent text is (Sterling and Shapiro 1986). Microplanner was a rather unsystematic collection of tools, whereas Prolog relies almost entirely on one kind of logic programming, but the main idea is the same. If one uses a restricted class of sentences, the so-called Horn clauses, then it is possible to use a restricted form of logical deduction. The control problem is then much eased, and it is possible for the programmer to anticipate the course the deduction will take. The price paid is that only certain kinds of facts are conveniently expressed as Horn clauses, and the depth first search built into Prolog is not always appropriate for the problem.

Even when the relevant facts can be expressed as Horn clauses supplemented by negation as failure, the reasoning carried out by a Prolog program may not be appropriate. For example, the fact that a sealed container is sterile if all the bacteria in it are dead and the fact that heating a can kills a bacterium in the can are both expressible as Prolog clauses. However, the resulting program for sterilizing a container will kill each bacterium individually, because it will have to index over the bacteria. It won't reason that heating the can kills all the bacteria at once, because it doesn't do universal generalization.

Here's a Prolog program for testing whether a container is sterile. The predicate symbols have obvious meanings.

not(P) :- P, !, fail. not(P).

sterile(X) :- not(nonsterile(X)). nonsterile(X) :- bacterium(Y), in(Y,X), not(dead(Y)). hot(Y) :- in(Y,X), hot(X). dead(Y) :- bacterium(Y), hot(Y). bacterium(b1). bacterium(b2). bacterium(b3). bacterium(b4). in(b1,c1). in(b2,c1). in(b3,c2). in(b4,c2). hot(c1).

Giving Prolog the goal sterile(c1) and sterile(c2) gives the answers yes and no respectively. However, Prolog has indexed over the bacteria in the containers.

The following is a Prolog program that can verify whether a sequence of actions, actually just heating it, will sterilize a container. It involves introducing situations analogous to those discussed in (McCarthy and Hayes 1969).

not(P) :- P, !, fail. not(P).

sterile(X,S) :- not(nonsterile(X,S)). nonsterile(X,S) :- bacterium(Y), in(Y,X), not(dead(Y,S)). hot(Y,S) :- in(Y,X), hot(X,S). dead(Y,S) :- bacterium(Y), hot(Y,S). bacterium(b1). bacterium(b2). bacterium(b3). bacterium(b4). in(b1,c1). in(b2,c1). in(b3,c2). in(b4,c2). hot(C,result(heat(C),S)).

When the program is given the goals sterile(c1,heat(c1,s0)) and sterile(c2,heat(c1,s0)) it answers yes and no respectively. However, if it is given the goal sterile(c1,s), it will fail because Prolog lacks what logic programmers call ``constructive negation''.

The same facts as are used in the first Prolog program can be expressed in in a first order language as follows.

displaymath324

displaymath326

displaymath328

and

displaymath330

However, from them we can prove sterile(a) without having to index over the bacteria.

Expressibility in Horn clauses, whether supplemented by negation as failure or not, is an important property of a set of facts and logic programming has been successfully used for many applications. However, it seems unlikely to dominate AI programming as some of its advocates hope.

Although third level systems express both facts and rules as logical sentences, they are still rather specialized. The axioms with which the programs begin are not general truths about the world but are sentences whose meaning and truth is limited to the narrow domain in which the program has to act. For this reason, the ``facts'' of one program usually cannot be used in a database for other programs.

4. The fourth level is still a goal. It involves representing general facts about the world as logical sentences. Once put in a database, the facts can be used by any program. The facts would have the neutrality of purpose characteristic of much human information. The supplier of information would not have to understand the goals of the potential user or how his mind works. The present ways of ``teaching'' computer programs by modifying them or directly modifying their databases amount to ``education by brain surgery''.

A key problem for achieving the fourth level is to develop a language for a general common-sense database. This is difficult, because the common-sense informatic situation is complex. Here is a preliminary list of features and considerations.

1. Entities of interest are known only partially, and the information about entities and their relations that may be relevant to achieving goals cannot be permanently separated from irrelevant information. (Contrast this with the situation in gravitational astronomy in which it is stated in the informal introduction to a lecture or textbook that the chemical composition and shape of a body are irrelevant to the theory; all that counts is the body's mass, and its initial position and velocity.)

Even within gravitational astronomy, non-equational theories arise and relevant information may be difficult to determine. For example, it was recently proposed that periodic extinctions discovered in the paleontological record are caused by showers of comets induced by a companion star to the sun that encounters and disrupts the Oort cloud of comets every time it comes to perihelion. This theory is qualitative because neither the orbit of the hypothetical star nor those of the comets are available.

2. The formalism has to be epistemologically adequate, a notion introduced in (McCarthy and Hayes 1969). This means that the formalism must be capable of representing the information that is actually available, not merely capable of representing actual complete states of affairs.

For example, it is insufficient to have a formalism that can represent the positions and velocities of the particles in a gas. We can't obtain that information, our largest computers don't have the memory to store it even if it were available, and our fastest computers couldn't use the information to make predictions even if we could store it.

As a second example, suppose we need to be able to predict someone's behavior. The simplest example is a clerk in a store. The clerk is a complex individual about whom a customer may know little. However, the clerk can usually be counted on to accept money for articles brought to the counter, wrap them as appropriate and not protest when the customer then takes the articles from the store. The clerk can also be counted on to object if the customer attempts to take the articles without paying the appropriate price. Describing this requires a formalism capable of representing information about human social institutions. Moreover, the formalism must be capable of representing partial information about the institution, such as a three year old's knowledge of store clerks. For example, a three year old doesn't know the clerk is an employee or even what that means. He doesn't require detailed information about the clerk's psychology, and anyway this information is not ordinarily available.

The following sections deal mainly with the advances we see as required to achieve the fourth level of use of logic in AI.

Formalized Nonmonotonic Reasoning



It seems that fourth level systems require extensions to mathematical logic. One kind of extension is formalized nonmonotonic reasoning, first proposed in the late 1970s (McCarthy 1977, 1980, 1986), (Reiter 1980), (McDermott and Doyle 1980), (Lifschitz 1989a). Mathematical logic has been monotonic in the following sense. If we have tex2html_wrap_inline334 and tex2html_wrap_inline336 , then we also have tex2html_wrap_inline338 .

If the inference is logical deduction, then exactly the same proof that proves p from A will serve as a proof from B. If the inference is model-theoretic, i.e. p is true in all models of A, then p will be true in all models of B, because the models of B will be a subset of the models of A. So we see that the monotonic character of traditional logic doesn't depend on the details of the logical system but is quite fundamental.

While much human reasoning is monotonic, some important human common-sense reasoning is not. We reach conclusions from certain premisses that we would not reach if certain other sentences were included in our premisses. For example, if I hire you to build me a bird cage, you conclude that it is appropriate to put a top on it, but when you learn the further fact that my bird is a penguin you no longer draw that conclusion. Some people think it is possible to try to save monotonicity by saying that what was in your mind was not a general rule about birds flying but a probabilistic rule. So far these people have not worked out any detailed epistemology for this approach, i.e. exactly what probabilistic sentences should be used. Instead AI has moved to directly formalizing nonmonotonic logical reasoning. Indeed it seems to me that when probabilistic reasoning (and not just the axiomatic basis of probability theory) has been fully formalized, it will be formally nonmonotonic.

Nonmonotonic reasoning is an active field of study. Progress is often driven by examples, e.g. the Yale shooting problem (Hanks and McDermott 1986), in which obvious axiomatizations used with the available reasoning formalisms don't seem to give the answers intuition suggests. One direction being explored (Moore 1985, Gelfond 1987, Lifschitz 1989a) involves putting facts about belief and knowledge explicitly in the axioms
--even when the axioms concern nonmental domains. Moore's classical example (now 4 years old) is ``If I had an elder brother I'd know it.''

Kraus and Perlis (1988) have proposed to divide much nonmonotonic reasoning into two steps. The first step uses Perlis's (1988) autocircumscription to get a second order formula characterizing what is possible. The second step involves default reasoning to choose what is normally to be expected out of the previously established possibilities. This seems to be a promising approach.

(Ginsberg 1987) collects the main papers up to 1986. Lifschitz (1989c) summarizes some example research problems of nonmonotonic reasoning.

Some Formalizations and their Problems



(McCarthy 1986) discusses several formalizations, proposing those based on nonmonotonic reasoning as improvements of earlier ones. Here are some.

1. Inheritance with exceptions. Birds normally fly, but there are exceptions, e.g. ostriches and birds whose feet are encased in concrete. The first exception might be listed in advance, but the second has to be derived or verified when mentioned on the basis of information about the mechanism of flying and the properties of concrete.

There are many ways of nonmonotonically axiomatizing the facts about which birds can fly. The following axioms using a predicate ab standing for ``abnormal'' seem to me quite straightforward.

tex2html_wrap_inline360

Unless an object is abnormal in aspect1, it can't fly.

It wouldn't work to write ab(x) instead of ab(aspect1(x)), because we don't want a bird that is abnormal with respect to its ability to fly to be automatically abnormal in other respects. Using aspects limits the effects of proofs of abnormality.

tex2html_wrap_inline368

tex2html_wrap_inline370

Unless a bird is abnormal in aspect2, it can fly.

When these axioms are combined with other facts about the problem, the predicate ab is then to be circumscribed, i.e. given its minimal extent compatible with the facts being taken into account. This has the effect that a bird will be considered to fly unless other axioms imply that it is abnormal in aspect2. (2) is called a cancellation of inheritance axiom, because it explicitly cancels the general presumption that objects don't fly. This approach works fine when the inheritance hierarchy is given explicitly. More elaborate approaches, some of which are introduced in (McCarthy 1986) and improved in (Haugh 1988), are required when hierarchies with indefinite numbers of sorts are considered.

2. (McCarthy 1986) contains a similar treatment of the effects of actions like moving and painting blocks using the situation calculus. Moving and painting are axiomatized entirely separately, and there are no axioms saying that moving a block doesn't affect the positions of other blocks or the colors of blocks. A general ``common-sense law of inertia''

equation63

asserts that a fact p that holds in a situation s is presumed to hold in the situation result(e,s) that results from an event e unless there is evidence to the contrary. Unfortunately, Lifschitz (1985 personal communication) and Hanks and McDermott (1986) showed that simple treatments of the common-sense law of inertia admit unintended models. Several authors have given more elaborate treatments, but in my opinion, the results are not yet entirely satisfactory. The best treatment so far seems to be that of (Lifschitz 1987).

Ability, Practical Reason and Free Will



An AI system capable of achieving goals in the common-sense world will have to reason about what it and other actors can and cannot do. For concreteness, consider a robot that must act in the same world as people and perform tasks that people give it. Its need to reason about its abilities puts the traditional philosophical problem of free will in the following form. What view shall we build into the robot about its own abilities, i.e. how shall we make it reason about what it can and cannot do? (Wishing to avoid begging any questions, by reason we mean compute using axioms, observation sentences, rules of inference and nonmonotonic rules of conjecture.)

Let A be a task we want the robot to perform, and let B and C be alternate intermediate goals either of which would allow the accomplishment of A. We want the robot to be able to choose between attempting B and attempting C. It would be silly to program it to reason: ``I'm a robot and a deterministic device. Therefore, I have no choice between B and C. What I will do is determined by my construction.'' Instead it must decide in some way which of B and C it can accomplish. It should be able to conclude in some cases that it can accomplish B and not C, and therefore it should take B as a subgoal on the way to achieving A. In other cases it should conclude that it can accomplish either B or C and should choose whichever is evaluated as better according to the criteria we provide it.

(McCarthy and Hayes 1969) proposes conditions on the semantics of any formalism within which the robot should reason. The essential idea is that what the robot can do is determined by the place the robot occupies in the world--not by its internal structure. For example, if a certain sequence of outputs from the robot will achieve B, then we conclude or it concludes that the robot can achieve B without reasoning about whether the robot will actually produce that sequence of outputs.

Our contention is that this is approximately how any system, whether human or robot, must reason about its ability to achieve goals. The basic formalism will be the same, regardless of whether the system is reasoning about its own abilities or about those of other systems including people.

The above-mentioned paper also discusses the complexities that come up when a strategy is required to achieve the goal and when internal inhibitions or lack of knowledge have to be taken into account.

Three Approaches to Knowledge and Belief



Our robot will also have to reason about its own knowledge and that of other robots and people.

This section contrasts the approaches to knowledge and belief characteristic of philosophy, philosophical logic and artificial intelligence. Knowledge and belief have long been studied in epistemology, philosophy of mind and in philosophical logic. Since about 1960, knowledge and belief have also been studied in AI. (Halpern 1986) and (Vardi 1988) contain recent work, mostly oriented to computer science including AI.

It seems to me that philosophers have generally treated knowledge and belief as complete natural kinds. According to this view there is a fact to be discovered about what beliefs are. Moreover, once it is decided what the objects of belief are (e.g. sentences or propositions), the definitions of belief ought to determine for each such object p whether the person believes it or not. This last is the completeness mentioned above. Of course, only human and sometimes animal beliefs have mainly been considered. Philosophers have differed about whether machines can ever be said to have beliefs, but even those who admit the possibility of machine belief consider that what beliefs are is to be determined by examining human belief.

The formalization of knowledge and belief has been studied as part of philosophical logic, certainly since Hintikka's book (1964), but much of the earlier work in modal logic can be seen as applicable. Different logics and axioms systems sometimes correspond to the distinctions that less formal philosophers make, but sometimes the mathematics dictates different distinctions.

AI takes a different course because of its different objectives, but I'm inclined to recommend this course to philosophers also, partly because we want their help but also because I think it has philosophical advantages.

The first question AI asks is: Why study knowledge and belief at all? Does a computer program solving problems and achieving goals in the common-sense world require beliefs, and must it use sentences about beliefs? The answer to both questions is approximately yes. At least there have to be data structures whose usage corresponds closely to human usage in some cases. For example, a robot that could use the American air transportation system has to know that travel agents know airline schedules, that there is a book (and now a computer accessible database) called the OAG that contains this information. If it is to be able to plan a trip with intermediate stops it has to have the general information that the departure gate from an intermediate stop is not to be discovered when the trip is first planned but will be available on arrival at the intermediate stop. If the robot has to keep secrets, it has to know about how information can be obtained by inference from other information, i.e. it has to have some kind of information model of the people from whom it is to keep the secrets.

However, none of this tells us that the notions of knowledge and belief to be built into our computer programs must correspond to the goals philosophers have been trying to achieve. For example, the difficulties involved in building a system that knows what travel agents know about airline schedules are not substantially connected with questions about how the travel agents can be absolutely certain. Its notion of knowledge doesn't have to be complete; i.e. it doesn't have to determine in all cases whether a person is to be regarded as knowing a given proposition. For many tasks it doesn't have to have opinions about when true belief doesn't constitute knowledge. The designers of AI systems can try to evade philosophical puzzles rather than solve them.

Maybe some people would suppose that if the question of certainty is avoided, the problems formalizing knowledge and belief become straightforward. That has not been our experience.

As soon as we try to formalize the simplest puzzles involving knowledge, we encounter difficulties that philosophers have rarely if ever attacked.

Consider the following puzzle of Mr. S and Mr. P.

Two numbers m and n are chosen such that tex2html_wrap_inline428 . Mr. S is told their sum and Mr. P is told their product. The following dialogue ensues:

Mr. P: I don't know the numbers.
Mr. S: tex2html_wrap440
Mr. P: Now I know the numbers.
Mr. S: Now I know them too.

In view of the above dialogue, what are the numbers?

Formalizing the puzzle is discussed in (McCarthy 1989). For the present we mention only the following aspects.

1. We need to formalize knowing what, i.e. knowing what the numbers are, and not just knowing that.

2. We need to be able to express and prove non-knowledge as well as knowledge. Specifically we need to be able to express the fact that as far as Mr. P knows, the numbers might be any pair of factors of the known product.

3. We need to express the joint knowledge of Mr. S and Mr. P of the conditions of the problem.

4. We need to express the change of knowledge with time, e.g. how Mr. P's knowledge changes when he hears Mr. S say that he knew that Mr. P didn't know the numbers and doesn't know them himself. This includes inferring what Mr. S and Mr. P still won't know.

The first order language used to express the facts of this problem involves an accessibility relation A(w1,w2,p,t), modeled on Kripke's semantics for modal logic. However, the accessibility relation here is in the language itself rather than in a metalanguage. Here w1 and w2 are possible worlds, p is a person and t is an integer time. The use of possible worlds makes it convenient to express non-knowledge. Assertions of non-knowledge are expressed as the existence of accessible worlds satisfying appropriate conditions.

The problem was successfully expressed in the language in the sense that an arithmetic condition determining the values of the two numbers can be deduced from the statement. However, this is not good enough for AI. Namely, we would like to include facts about knowledge in a general purpose common-sense database. Instead of an ad hoc formalization of Mr. S and Mr. P, the problem should be solvable from the same general facts about knowledge that might be used to reason about the knowledge possessed by travel agents supplemented only by the facts about the dialogue. Moreover, the language of the general purpose database should accommodate all the modalities that might be wanted and not just knowledge. This suggests using ordinary logic, e.g. first order logic, rather than modal logic, so that the modalities can be ordinary functions or predicates rather than modal operators.

Suppose we are successful in developing a ``knowledge formalism'' for our common-sense database that enables the program controlling a robot to solve puzzles and plan trips and do the other tasks that arise in the common-sense environment requiring reasoning about knowledge. It will surely be asked whether it is really knowledge that has been formalized. I doubt that the question has an answer. This is perhaps the question of whether knowledge is a natural kind.

I suppose some philosophers would say that such problems are not of philosophical interest. It would be unfortunate, however, if philosophers were to abandon such a substantial part of epistemology to computer science. This is because the analytic skills that philosophers have acquired are relevant to the problems.

Reifying Context



We propose the formula tex2html_wrap_inline442 to assert that the proposition p holds in context c. It expresses explicitly how the truth of an assertion depends on context. The relation tex2html_wrap_inline448 asserts that the context c2 is more general than the context c1.gif

Formalizing common-sense reasoning needs contexts as objects, in order to match human ability to consider context explicitly. The proposed database of general common-sense knowledge will make assertions in a general context called C0. However, C0 cannot be maximally general, because it will surely involve unstated presuppositions. Indeed we claim that there can be no maximally general context. Every context involves unstated presuppositions, both linguistic and factual.

Sometimes the reasoning system will have to transcend C0, and tools will have to be provided to do this. For example, if Boyle's law of the dependence of the volume of a sample of gas on pressure were built into C0, discovery of its dependence on temperature would have to trigger a process of generalization that might lead to the perfect gas law.

The following ideas about how the formalization might proceed are tentative. Moreover, they appeal to recent logical innovations in the formalization of nonmonotonic reasoning. In particular, there will be nonmonotonic ``inheritance rules'' that allow default inference from tex2html_wrap_inline442 to tex2html_wrap_inline466 , where c' is either more general or less general than c.

Almost all previous discussion of context has been in connection with natural language, and the present paper relies heavily on examples from natural language. However, I believe the main AI uses of formalized context will not be in connection with communication but in connection with reasoning about the effects of actions directed to achieving goals. It's just that natural language examples come to mind more readily.

As an example of intended usage, consider

displaymath472

Suppose that this sentence is intended to assert that a particular person is in a particular car on a particular occasion, i.e. the sentence is not just being used as a linguistic example but is meant seriously. A corresponding English sentence is ``He's in the car'' where who he is and which car and when is determined by the context in which the sentence is uttered. Suppose, for simplicity, that the sentence is said by one person to another in a situation in which the car is visible to the speaker but not to the hearer and the time at which the the subject is asserted to be in the car is the same time at which the sentence is uttered.

In our formal language c17 has to carry the information about who he is, which car and when.

Now suppose that the same fact is to be conveyed as in example 1, but the context is a certain Stanford Computer Science Department 1980s context. Thus familiarity with cars is presupposed, but no particular person, car or occasion is presupposed. The meanings of certain names is presupposed, however. We can call that context (say) c5. This more general context requires a more explicit proposition; thus, we would have

equation97

A yet more general context might not identify a specific John McCarthy, so that even this more explicit sentence would need more information. What would constitute an adequate identification might also be context dependent.

Here are some of the properties formalized contexts might have.

1. In the above example, we will have tex2html_wrap_inline478 , i.e. c5 is more general than c17. There will be nonmonotonic rules like

equation110

and

equation118

Thus there is nonmonotonic inheritance both up and down in the generality hierarchy.

2. There are functions forming new contexts by specialization. We could have something like

equation126

We will have tex2html_wrap_inline484 .

3. Besides tex2html_wrap_inline442 , we may have tex2html_wrap_inline488 , where tex2html_wrap_inline490 is a term. The domain in which tex2html_wrap_inline490 takes values is defined in some outer context.

4. Some presuppositions of a context are linguistic and some are factual. In the above example, it is a linguistic matter who the names refer to. The properties of people and cars are factual, e.g. it is presumed that people fit into cars.

5. We may want meanings as abstract objects. Thus we might have

displaymath494

6. Contexts are ``rich'' entities not to be fully described. Thus the ``normal English language context'' contains factual assumptions and linguistic conventions that a particular English speaker may not know. Moreover, even assumptions and conventions in a context that may be individually accessible cannot be exhaustively listed. A person or machine may know facts about a context without ``knowing the context''.

7. Contexts should not be confused with the situations of the situation calculus of (McCarthy and Hayes 1969). Propositions about situations can hold in a context. For example, we may have

equation147

This can be interpreted as asserting that under the assumptions embodied in context c1, a plan of walking to the car and then driving to the airport would get the robot to the airport starting in situation S0.

8. The context language can be made more like natural language and more extensible if we introduce notions of entering and leaving a context. These will be analogous to the notions of making and discharging assumptions in natural deduction systems, but the notion seems to be more general. Suppose we have tex2html_wrap_inline442 . We then write

tex2html_wrap_inline502 .

This enables us to write p instead of tex2html_wrap_inline442 . If we subsequently infer q, we can replace it by tex2html_wrap_inline510 and leave the context c. Then tex2html_wrap_inline510 will itself hold in the outer context in which tex2html_wrap_inline442 holds. When a context is entered, there need to be restrictions analogous to those that apply in natural deduction when an assumption is made.

One way in which this notion of entering and leaving contexts is more general than natural deduction is that formulas like tex2html_wrap_inline518 and (say) tex2html_wrap_inline520 behave differently from tex2html_wrap_inline522 and tex2html_wrap_inline524 which are their natural deduction analogs. For example, if c1 is associated with the time 5pm and c2 is associated with the time 6pm and p is tex2html_wrap_inline532 , then tex2html_wrap_inline534 might be used to infer that I left the office between 5pm and 6pm. tex2html_wrap_inline536 cannot be used in this way; in fact it is equivalent to tex2html_wrap_inline538 .

9. The expression tex2html_wrap_inline540 (note the caps) represents the proposition that p holds in c. Since it is a proposition, we can assert tex2html_wrap_inline546 .

10. Propositions will be combined by functional analogs of the Boolean operators as discussed in (McCarthy 1979b). Treating propositions involving quantification is necessary, but it is difficult to determine the right formalization.

11. The major goals of research into formalizing context should be to determine the rules that relate contexts to their generalizations and specializations. Many of these rules will involve nonmonotonic reasoning.

CONCEPTS OF LOGICAL AI

CONCEPTS OF LOGICAL AI

John McCarthy
Computer Science Department
Stanford University
Stanford, CA 94305
jmc@cs.stanford.edu
http://www-formal.stanford.edu/jmc/

JanFebMarAprMayJun JulAugSepOctNovDec , :< 10 0

Abstract:

Logical AI involves representing knowledge of an agent's world, its goals and the current situation by sentences in logic. The agent decides what to do by inferring that a certain action or course of action is appropriate to achieve the goals. We characterize briefly a large number of concepts that have arisen in research in logical AI.

Reaching human-level AI requires programs that deal with the common sense informatic situation. Human-level logical AI requires extensions to the way logic is used in formalizing branches of mathematics and physical science. It also seems to require extensions to the logics themselves, both in the formalism for expressing knowledge and the reasoning used to reach conclusions.

A large number of concepts need to be studied to achieve logical AI of human level. This article presents candidates. The references, though numerous, to articles concerning these concepts are still insufficient, and I'll be grateful for more, especially for papers available on the web.

This article is available in several forms via http://www-formal.stanford.edu/jmc/concepts-ai.html.

Introduction



Logical AI involves representing knowledge of an agent's world, its goals and the current situation by sentences in logic. The agent decides what to do by inferring that a certain action or course of action was appropriate to achieve the goals. The inference may be monotonic, but the nature of the world and what can be known about it often requires that the reasoning be nonmonotonic.

Logical AI has both epistemological problems and heuristic problems. The former concern the knowledge needed by an intelligent agent and how it is represented. The latter concerns how the knowledge is to be used to decide questions, to solve problems and to achieve goals. These are discussed in [MH69]. Neither the epistemological problems nor the heuristic problems of logical AI have been solved. The epistemological problems are more fundamental, because the form of their solution determines what the heuristic problems will eventually be like.gif

This article has links to other articles of mine. I'd like to supplement the normal references by direct links to such articles as are available.

A LOT OF CONCEPTS



The uses of logic in AI and other parts of computer science that have been undertaken so far do not involve such an extensive collection of concepts. However, it seems to me that reaching human level AI will involve all of the following--and probably more.

Logical AI
Logical AI in the sense of the present article was proposed in [McC59] and also in [McC89]. The idea is that an agent can represent knowledge of its world, its goals and the current situation by sentences in logic and decide what to do by inferring that a certain action or course of action is appropriate to achieve its goals.

Logic is also used in weaker ways in AI, databases, logic programming, hardware design and other parts of computer science. Many AI systems represent facts by a limited subset of logic and use non-logical programs as well as logical inference to make inferences. Databases often use only ground formulas. Logic programming restricts its representation to Horn clauses. Hardware design usually involves only propositional logic. These restrictions are almost always justified by considerations of computational efficiency.

Epistemology and Heuristics
In philosophy, epistemology is the study of knowledge, its form and limitations. This will do pretty well for AI also, provided we include in the study common sense knowledge of the world and scientific knowledge. Both of these offer difficulties philosophers haven't studied, e.g. they haven't studied in detail what people or machines can know about the shape of an object the field of view, remembered from previously being in the field of view, remembered from a description or remembered from having been felt with the hands. This is discussed a little in [MH69].

Most AI work has concerned heuristics, i.e. the algorithms that solve problems, usually taking for granted a particular epistemology of a particular domain, e.g. the representation of chess positions.

Bounded Informatic Situation
Formal theories in the physical sciences deal with a bounded informatic situation. Scientists decide informally in advance what phenomena to take into account. For example, much celestial mechanics is done within the Newtonian gravitational theory and does not take into account possible additional effects such as outgassing from a comet or electromagnetic forces exerted by the solar wind. If more phenomena are to be considered, scientists must make a new theories--and of course they do.

Most AI formalisms also work only in a bounded informatic situation. What phenomena to take into account is decided by a person before the formal theory is constructed. With such restrictions, much of the reasoning can be monotonic, but such systems cannot reach human level ability. For that, the machine will have to decide for itself what information is relevant, and that reasoning will inevitably be partly nonmonotonic.

One example is the ``blocks world'' where the position of a block x is entirely characterized by a sentence At(x,l) or On(x,y), where l is a location or y is another block.

Another example is the Mycin [DS77] expert system in which the ontology (objects considered) includes diseases, symptoms, and drugs, but not patients (there is only one), doctors or events occurring in time. See [McC83] for more comment.

Common Sense Knowledge of the World
As first discussed in [McC59], humans have a lot of knowledge of the world which cannot be put in the form of precise theories. Though the information is imprecise, we believe it can still be put in logical form. The Cyc project [LG90] aims at making a large base of common sense knowledge. Cyc is useful, but further progress in logical AI is needed for Cyc to reach its full potential.

Common Sense Informatic Situation
In general a thinking human is in what we call the common sense informatic situation, as distinct from the bounded informatic situation. The known facts are necessarily incomplete. We live in a world of middle-sized object which can only be partly observed. We only partly know how the objects that can be observed are built from elementary particles in general, and our information is even more incomplete about the structure of particular objects. These limitations apply to any buildable machines, so the problem is not just one of human limitations.gif

In many actual situations, there is no a priori limitation on what facts are relevant. It may not even be clear in advance what phenomena should be taken into account. The consequences of actions cannot be fully determined. The common sense informatic situation necessitates the use of approximate concepts that cannot be fully defined and the use of approximate theories involving them. It also requires nonmonotonic reasoning in reaching conclusions. Many AI texts assume that the information situation is bounded--without even mentioning the assumption explicitly.

The common sense informatic situation often includes some knowledge about the system's mental state as discussed in [McC96a].

One key problem in formalizing the common sense informatic situation is to make the axiom sets elaboration tolerant.

Epistemologically Adequate Languages
A logical language for use in the common sense informatic situation must be capable of expressing directly the information actually available to agents. For example, giving the density and temperature of air and its velocity field and the Navier-Stokes equations does not practically allow expressing what a person or robot actually can know about the wind that is blowing. We and robots can talk about its direction, strength and gustiness approximately, and can give a few of these quantitities numerical values with the aid of instruments if instruments are available, but we have to deal with the phenomena even when no numbers can be obtained. The idea of epistemological adequacy was introduced in [MH69].

Robot
We can generalize the notion of a robot as a system with a variant of the physical capabilities of a person, including the ability to move around, manipulate objects and perceive scenes, all controlled by a computer program. More generally, a robot is a computer-controlled system that can explore and manipulate an environment that is not part of the robot itself and is, in some important sense, larger than the robot. A robot should maintain a continued existence and not reset itself to a standard state after each task. From this point of view, we can have a robot that explores and manipulates the Internet without it needing legs, hands and eyes. The considerations of this article that mention robots are intended to apply to this more general notion. The internet robots discussed so far are very limited in their mentalities.

Qualitative Reasoning
This concerns reasoning about physical processes when the numerical relations required for applying the formulas of physics are not known. Most of the work in the area assumes that information about what processes to take into account are provided by the user. Systems that must be given this information often won't do human level qualitative reasoning. See [De90] and [Kui94].

Common Sense Physics
Corresponds to people's ability to make decisions involving physical phenomena in daily life, e.g. deciding that the spill of a cup of hot coffee is likely to burn Mr. A, but Mr. B is far enough to be safe. It differs from qualitative physics, as studied by most researchers in qualitative reasoning, in that the system doing the reasoning must itself use common sense knowledge to decide what phenomena are relevant in the particular case. See [Hay85] for one view of this.

Expert Systems
These are designed by people, i.e. not by computer programs, to take a limited set of phenomena into account. Many of them do their reasoning using logic, and others use formalisms amounting to subsets of first order logic. Many require very little common sense knowledge and reasoning ability. Restricting expressiveness of the representation of facts is often done to increase computational efficiency.

Knowledge Level
Allen Newell ([New82] and [New93]) did not advocate (as we do here) using logic as the way a system should represent its knowledge internally. He did say that a system can often be appropriately described as knowing certain facts even when the facts are not represented by sentences in memory. This view corresponds to Daniel Dennett's intentional stance [Den71], reprinted in [Den78], and was also proposed and elaborated in [McC79].


Elaboration Tolerance
A set of facts described as a logical theory needs to be modifiable by adding sentences rather than only by going back to natural language and starting over. For example, we can modify the missionaries and cannibals problem by saying that there is an oar on each bank of the river and that the boat can be propelled with one oar carrying one person but needs two oars to carry two people. Some formalizations require complete rewriting to accomodate this elaboration. Others share with natural language the ability to allow the elaboration by an addition to what was previously said.

There are degrees of elaboration tolerance. A state space formalization of the missionaries and cannibals problem in which a state is represented by a triplet tex2html_wrap_inline140 of the numbers of missionaries, cannibals and boats on the initial bank is less elaboration tolerant than a situation calculus formalism in which the set of objects present in a situation is not specified in advance. In particular, the former representation needs surgery to add the oars, whereas the latter can handle it by adjoining more sentences--as can a person. The realization of elaboration tolerance requires nonmonotonic reasoning. See [McC97].

Robotic Free Will
Robots need to consider their choices and decide which of them leads to the most favorable situation. In doing this, the robot considers a system in which its own outputs are regarded as free variables, i.e. it doesn't consider the process by which it is deciding what to do. The perception of having choices is also what humans consider as free will. The matter is discussed in [MH69] and is roughly in accordance with the philosophical attitude towards free will called compatibilism, i.e. the view that determinism and free will are compatible.

Reification
To refify an entity is to ``make a thing'' out of it (from Latin re for thing). From a logical point of view, things are what variables can range over. Logical AI needs to reify hopes, intentions and ``things wrong with the boat''. Some philosophers deplore reification, referring to a ``bloated ontology'', but AI needs more things than are dreamed of in the philosophers' philosophy. In general, reification gives a language more expressive power, because it permits referring to entities directly that were previously mentionable only in a metalanguage.

Ontology
In philosophy, ontology is the branch that studies what things exist. W.V.O. Quine's view is that the ontology is what the variables range over. Ontology has been used variously in AI, but I think Quine's usage is best for AI. ``Reification'' and ``ontology'' treat the same phenomena. Regrettably, the word ``ontology'' has become popular in AI in much vaguer senses. Ontology and reification are basically the same concept.


Approximate Concepts
Common sense thinking cannot avoid concepts without clear definitions. Consider the welfare of an animal. Over a period of minutes, the welfare is fairly well defined, but asking what will benefit a newly hatched chick over the next year is ill defined. The exact snow, ice and rock that constitutes Mount Everest is ill defined. The key fact about approximate concepts is that while they are not well defined, sentences involving them may be quite well defined. For example, the proposition that Mount Everest was first climbed in 1953 is definite, and its definiteness is not compromised by the ill-definedness of the exact boundaries of the mountain. See [McC99b].

There are two ways of regarding approximate concepts. The first is to suppose that there is a precise concept, but it is incompletely known. Thus we may suppose that there is a truth of the matter as to which rocks and ice constitute Mount Everest. If this approach is taken, we simply need weak axioms telling what we do know but not defining the concept completely.

The second approach is to regard the concept as intrinsically approximate. There is no truth of the matter. One practical difference is that we would not expect two geographers independently researching Mount Everest to define the same boundary. They would have to interact, because the boundaries of Mount Everest are yet to be defined.gif

Approximate Theories
Any theory involving approximate concepts is an approximate theory. We can have a theory of the welfare of chickens. However, its notions don't make sense if pushed too far. For example, animal rights people assign some rights to chickens but cannot define them precisely. It is not presently apparent whether the expression of approximate theories in mathematical logical languages will require any innovations in mathematical logic. See [McC99b].

Ambiguity Tolerance
Assertions often turn out to be ambiguous with the ambiguity only being discovered many years after the assertion was enunciated. For example, it is a priori ambiguous whether the phrase ``conspiring to assault a Federal official'' covers the case when the criminals mistakenly believe their intended victim is a Federal official. An ambiguity in a law does not invalidate it in the cases where it can be considered unambiguous. Even where it is formally ambiguous, it is subject to judicial interpretation. AI systems will also require means of isolating ambiguities and also contradictions. The default rule is that the concept is not ambiguous in the particular case. The ambiguous theories are a kind of approximate theory.

Causal Reasoning
A major concern of logical AI has been treating the consequences of actions and other events. The epistemological problem concerns what can be known about the laws that determine the results of events. A theory of causality is pretty sure to be approximate.

Situation Calculus
Situation calculus is the most studied formalism for doing causal reasoning. A situation is in principle a snapshot of the world at an instant. One never knows a situation--one only knows facts about a situation. Events occur in situations and give rise to new situations. There are many variants of situation calculus, and none of them has come to dominate. [MH69] introduces situation calculus. [GLR91] is a 1991 discussion.

Fluents
Functions of situations in situation calculus. The simplest fluents are propositional and have truth values. There are also fluents with values in numerical or symbolic domains. Situational fluents take on situations as values.

Frame Problem
This is the problem of how to express the facts about the effects of actions and other events in such a way that it is not necessary to explicitly state for every event, the fluents it does not affect. Murray Shanahan [Sha97] has an extensive discussion.

Qualification Problem
This concerns how to express the preconditions for actions and other events. That it is necessary to have a ticket to fly on a commercial airplane is rather unproblematical to express. That it is necessary to be wearing clothes needs to be kept inexplicit unless it somehow comes up.

Ramification Problem
Events often have other effects than those we are immediately inclined to put in the axioms concerned with the particular kind of event.

Projection
Given information about a situation, and axioms about the effects of actions and other events, the projection problem is to determine facts about future situations. It is assumed that no facts are available about future situations other than what can be inferred from the ``known laws of motion'' and what is known about the initial situation. Query: how does one tell a reasoning system that the facts are such that it should rely on projection for information about the future.

Planning
The largest single domain for logical AI has been planning, usually the restricted problem of finding a finite sequence of actions that will achieve a goal. [Gre69a] is the first paper to use a theorem prover to do planning. Planning is somewhat the inverse problem to projection.

Narrative
A narrative tells what happened, but any narrative can only tell a certain amount. What narratives can tell, how to express that logically, and how to elaborate narratives is given a preliminary logical treatment in [McC95b] and more fully in [CM98a]. [PR93] and [RM94] are relevant here. A narrative will usually give facts about the future of a situation that are not just consequences of projection from an initial situation. [While we may suppose that the future is entirely determined by the initial situation, our knowledge doesn't permit inferring all the facts about it by projection. Therefore, narratives give facts about the future beyond what follows by projection.]

Understanding
A rather demanding notion is most useful. In particular, fish do not understand swimming, because they can't use knowledge to improve their swimming, to wish for better fins, or to teach other fish. See the section on understanding in [McC96a]. Maybe fish do learn to improve their swimming, but this presumably consists primarily of the adjustment of parameters and isn't usefully called understanding. I would apply understanding only to some systems that can do hypothetical reasoning--if p were true, then q would be true. Thus Fortran compilers don't understand Fortran.

Consciousness, awareness and introspection
Human level AI systems will require these qualities in order to do tasks we assign them. In order to decide how well it is doing, a robot will need to be able to examine its goal structure and the structure of its beliefs from the outside. See [McC96a].

Intention to do something
Intentions as objects are discussed briefly in [McC89] and [McC96a].

Mental situation calculus
The idea is that there are mental situations, mental fluents and mental events that give rise to new mental situations. The mental events include observations and inferences but also the results of observing the mental situation up to the current time. This allows drawing the conclusion that there isn't yet information needed to solve a certain problem, and therefore more information must be sought outside the robot or organism. [SL93] treats this and so does [McC96a].

Discrete processes
Causal reasoning is simplest when applied to processes in which discrete events occur and have definite results. In situation calculus, the formulas s' = result(e,s) gives the new situation s' that results when the event e occurs in situation s. Many continuous processes that occur in human or robot activity can have approximate theories that are discrete.

Continuous Processes
Humans approximate continuous processes with representations that are as discrete as possible. For example, ``Junior read a book while on the airplane from Glasgow to London.'' Continuous processes can be treated in the situation calculus, but the theory is so far less successful than in discrete cases. We also sometimes approximate discrete processes by continuous ones. [Mil96] and [Rei96] treat this problem.

Non-deterministic events
Situation calculus and other causal formalisms are harder to use when the effects of an action are indefinite. Often result(e,s) is not usefully axiomatizable and something like occurs(e,s) must be used.

Concurrrent Events
Formalisms treating actions and other events must allow for any level of dependence between events. Complete independence is a limiting case and is treated in [McC95b].

Conjunctivity
It often happens that two phenomena are independent. In that case, we may form a description of their combination by taking the conjunction of the descriptions of the separate phenomena. The description language satisfies conjunctivity if the conclusions we can draw about one of the phenomena from the combined description are the same as the conjunctions we could draw from the single description. For example, we may have separate descriptions of the assassination of Abraham Lincoln and of Mendel's contemporaneous experiments with peas. What we can infer about Mendel's experiments from the conjunction should ordinarily be the same as what we can infer from just the description of Mendel's experiments. Many formalisms for concurrent events don't have this property, but conjunctivity itself is applicable to more than concurrent events.

To use logician's language, the conjunction of the two theories should be a conservative extension of each of the theories. Actually, we may settle for less. We only require that the inferrable sentences about Mendel (or about Lincoln) in the conjunction are the same. The combined theory may admit inferring other sentences in the language of the separate theory that weren't inferrable in the separate theories.

Learning
Making computers learn presents two problems--epistemological and heuristic. The epistemological problem is to define the space of concepts that the program can learn. The heuristic problem is the actual learning algorithm. The heuristic problem of algorithms for learning has been much studied and the epistemological mostly ignored. The designer of the learning system makes the program operate with a fixed and limited set of concepts. Learning programs will never reach human level of generality as long as this approach is followed. [McC59] says, ``A computer can't learn what it can't be told.'' We might correct this, as suggested by Murray Shanahan, to say that it can only learn what can be expressed in the language we equip it with. To learn many important concepts, it must have more than a set of weights. [MR94] and [BM95] present some progress on learning within a logical language. The many kinds of learning discussed in [Mit97] are all, with the possible exception of inductive logic programming, very limited in what they can represent--and hence can conceivably learn. [McC99a] presents a challenge to machine learning problems and discovery programs to learn or discovery the reality behind appearance.

Representation of Physical Objects
We aren't close to having an epistemologically adequate language for this. What do I know about my pocket knife that permits me to recognize it in my pocket or by sight or to open its blades by feel or by feel and sight? What can I tell others about that knife that will let them recognize it by feel, and what information must a robot have in order to pick my pocket of it?

Representation of Space and Shape
We again have the problem of an epistemologically adequate representation. Trying to match what a human can remember and reason about when out of sight of the scene is more what we need than some pixel by pixel representation. Some problems of this are discussed in [McC95a] which concerns the Lemmings computer games. One can think about a particular game and decide how to solve it away from the display of the position, and this obviously requires a compact representation of partial information about a scene.

Discrimination, Recognition and Description
Discrimination is the deciding which category a stimulus belongs to among a fixed set of categories, e.g. decide which letter of the alphabet is depicted in an image. Recognition involves deciding whether a stimulus belongs to the same set, i.e. represents the same object, e.g. a person, as a previously seen stimulus. Description involves describing an object in detail appropriate to performing some action with it, e.g. picking it up by the handle or some other designated part. Description is the most ambitious of these operations and has been the forte of logic-based approaches.


Logical Robot
[McC59] proposed that a robot be controlled by a program that infers logically that a certain action will advance its goals and then does that action. This approach was implemented in [Gre69b], but the program was very slow. Shortly greater speed was obtained in systems like STRIPS at the cost of limiting the generality of facts the robot takes into account. See [Nil84], [LRL tex2html_wrap_inline366 97], and [Sha96].

Declarative Expression of Heuristics
[McC59] proposes reasoning be controlled by domain-dependent and problem-dependent heuristics expressed declaratively. Expressing heuristics declaratively means that a sentence about a heuristic can be the result of reasoning and not merely something put in from the outside by a person. Josefina Sierra [Sie98b], [Sie98a], [Sie98c], [Sie99] has made some recent progress.

Logic programming
Logic programming isolates a subdomain of first order logic that has nice computational properties. When the facts are described as a logic program, problems can often be solved by a standard program, e.g. a Prolog interpreter, using these facts as a program. Unfortunately, in general the facts about a domain and the problems we would like computers to solve have that form only in special cases.

Useful Counterfactuals
``If another car had come over the hill when you passed that Mercedes, there would have been a head-on collision.'' One's reaction to believing that counterfactual conditional sentence is quite different from one's reaction to the corresponding material conditional. Machines need to represent such sentences in order to learn from not-quite-experiences. See [CM98b].

Formalized Contexts
Any particular bit of thinking occurs in some context. Humans often specialize the context to particular situations or theories, and this makes the reasoning more definite, sometimes completely definite. Going the other way, we sometimes have to generalize the context of our thoughts to take some phenomena into account.

It has been worthwhile to admit contexts as objects into the ontology of logical AI. The prototype formula ist(c,p) asserts that the proposition p is true in the context c. The formal theory is discussed in [McC93], [MB98] and in papers by Sasa Buvac, available in [Buv95].

Rich and Poor Entities
A rich entity is one about which a person or machine can never learn all the facts. The state of the reader's body is a rich entity. The actual history of my going home this evening is a rich entity, e.g. it includes the exact position of my body on foot and in the car at each moment. While a system can never fully describe a rich entity, it can learn facts about it and represent them by logical sentences.

Poor entities occur in plans and formal theories and in accounts of situations and events and can be fully prescribed. For example, my plan for going home this evening is a poor entity, since it does not contain more than a small, fixed amount of detail. Rich entities are often approximated by poor entities. Indeed some rich entities may be regarded as inverse limits of trees of poor entities. (The mathematical notion of inverse limit may or may not turn out to be useful, although I wouldn't advise anyone to study the subject quite yet just for its possible AI applications.)

Nonmonotonic Reasoning
Both humans and machines must draw conclusions that are true in the ``best'' models of the facts being taken into account. Several concepts of best are used in different systems. Many are based on minimizing something. When new facts are added, some of the previous conclusions may no longer hold. This is why the reasoning that reached these conclusions is called nonmonotonic.

Probabilistic Reasoning
Probabilistic reasoning is a kind of nonmonotonic reasoning. If the probability of one sentence is changed, say given the value 1, other sentences that previously had high probability may now have low or even 0 probability. Setting up the probabilistic models, i.e defining the sample space of ``events'' to which probabilities are to be given often involves more general nonmonotonic reasoning, but this is conventionally done by a person informally rather than by a computer.

In the open common sense informatic situation, there isn't any apparent overall sample space. Probabilistic theories may formed by limiting the space of events considered and then establishing a distribution. Limiting the events considered should be done by whatever nonmonotonic reasoning techniques are developed techniques for limiting the phenomena taken into account. (You may take this as a confession that I don't know these techniques.) In forming distributions, there would seem to be a default rule that two events tex2html_wrap_inline160 and tex2html_wrap_inline162 are to be taken as independent unless there is a reason to do otherwise. tex2html_wrap_inline160 and tex2html_wrap_inline162 can't be just any events but have to be in some sense basic events.

Circumscription
A method of nonmonotonic reasoning involving minimizing predicates (and sometimes domains). It was introduced in [McC77], [McC80] and [McC86]. An up-to-date discussion, including numerous variants, is [Lif94].

Default Logic
A method of nonmonotonic reasoning introduced in [Rei80] that is the main survivor along with circumscription.

Yale Shooting Problem
This problem, introduced in [HM86], is a simple Drosophila for nonmonotonic reasoning. The simplest formalizations of causal reasoning using circumscription or default logic for doing the nonmonotonic reasoning do not give the result that intuition demands. Various more recent formalizations of events handle the problem ok. The Yale shooting problem is likely to remain a benchmark problem for formalizations of causality.

Design Stance
Daniel Dennett's idea [Den78] is to regard an entity in terms of its function rather than in terms of its physical structure. For example, a traveller using a hotel alarm clock need not notice whether the clock is controlled by a mechanical escapement, the 60 cycle power line or by an internal crystal. We formalize it in terms of (a) the fact that it can be used to wake the traveller, and (b) setting it and the noise it makes at the time for which it is set.

Physical Stance
We consider an object in terms of its physical structure. This is needed for actually building it or repairing it but is often unnecessary in making decisions about how to use it.

Intentional Stance
Dennett proposes that sometimes we consider the behavior of a person, animal or machine by ascribing to it belief, desires and intentions. This is discussed in [Den71] and [Den78] and also in [McC79].

Relation between logic and calculation and various data structures
Murray Shanahan recommends putting in something about this.

Creativity
Humans are sometimes creative--perhaps rarely in the life of an individual and among people. What is creativity? We consider creativity as an aspect of the solution to a problem rather than as attribute of a person (or computer program).

A creative solution to a problem contains a concept not present in the functions and predicates in terms of which the problem is posed. [McC64] and [McC]discuss the mutilated checkerboard problem.

The problem is to determine whether a checkerboard with two diagonally opposite squares can be removed can be covered with dominoes, each of which covers two rectilinearly adjacent squares. The standard proof that this can't be done is creative relative to the statement of the problem. It notes that a domino covers two squares of opposite color, but there are 32 squares of one color and 30 of the other color to be colored.

Colors are not mentioned in the statement of the problem, and their introduction is a creative step relative to this statement. For a mathematician of moderate experience (and for many other people), this bit of creativity is not difficult. We must, therefore, separate the concept of creativity from the concept of difficulty.

Before we can have creativity we must have some elaboration tolerance. Namely, in the simple languagge of A tough nut tex2html_wrap_inline357, the colors of the squares cannot even be expressed. A program confined to this language could not even be told the solution. As discussed in [McC96b], Zermelo-Frankel set theory is an adequate language. In general, set theory, in a form allowing definitions may have enough elaboration tolerance in general. Regard this as a conjecture that requires more study.

How it happened

Consider an action like buying a pack of cigarettes on a particular occasion and the subactions thereof. It would be a mistake to regard the relation between the action and its subactions as like that between a program and its subroutines. On one occasion I might have bought the cigarettes from a machine. on a second occasion at a supermarket, and on a third occasion from a cigarettelegger, cigarettes having become illegal.

WHAT IS ARTIFICIAL INTELLIGENCE? More questions

Q. How is AI research done?

A. AI research has both theoretical and experimental sides. The experimental side has both basic and applied aspects.

There are two main lines of research. One is biological, based on the idea that since humans are intelligent, AI should study humans and imitate their psychology or physiology. The other is phenomenal, based on studying and formalizing common sense facts about the world and the problems that the world presents to the achievement of goals. The two approaches interact to some extent, and both should eventually succeed. It is a race, but both racers seem to be walking.

Q. What are the relations between AI and philosophy?

A. AI has many relations with philosophy, especially modern analytic philosophy. Both study mind, and both study common sense. The best reference is [Tho03].

Q. How are AI and logic programming related?

A. At the very least, logic programming provides useful programming languages (mainly Prolog).

Beyond that, sometimes a theory useful in AI can be expressed as a collection of Horn clauses, and goal to be achieved can be expressed as that of finding values of variables satisfying an expression . The problem can sometimes be solved by running the Prolog program consisting of and .

There are two possible obstacles to regarding AI as logic programming. First, Horn theories do not exhaust first order logic. Second, the Prolog program expressing the theory may be extremely inefficient. More elaborate control than just executing the program that expresses the theory is often needed. Map coloring provides examples.

Q. What should I study before or while learning AI?

A. Study mathematics, especially mathematical logic. The more you learn about sciences, e.g. physics or biology, the better. For the biological approaches to AI, study psychology and the physiology of the nervous system. Learn some programming languages--at least C, Lisp and Prolog. It is also a good idea to learn one basic machine language. Jobs are likely to depend on knowing the languages currently in fashion. In the late 1990s, these include C++ and Java.

Q. What is a good textbook on AI?

A. Artificial Intelligence by Stuart Russell and Peter Norvig, Prentice Hall is the most commonly used textbbook in 1997. The general views expressed there do not exactly correspond to those of this essay. Artificial Intelligence: A New Synthesis by Nils Nilsson, Morgan Kaufman, may be easier to read. Some people prefer Computational Intelligence by David Poole, Alan Mackworth and Randy Goebel, Oxford, 1998.

Q. What organizations and publications are concerned with AI?

A. The American Association for Artificial Intelligence (AAAI), the European Coordinating Committee for Artificial Intelligence (ECCAI) and the Society for Artificial Intelligence and Simulation of Behavior (AISB) are scientific societies concerned with AI research. The Association for Computing Machinery (ACM) has a special interest group on artificial intelligence SIGART.

The International Joint Conference on AI (IJCAI) is the main international conference. The AAAI runs a US National Conference on AI. Electronic Transactions on Artificial Intelligence, Artificial Intelligence, and Journal of Artificial Intelligence Research, and IEEE Transactions on Pattern Analysis and Machine Intelligence are four of the main journals publishing AI research papers. I have not yet found everything that should be in this paragraph.

Page of Positive Reviews lists papers that experts have found important.

Funding a Revolution: Government Support for Computing Research by a committee of the National Research covers support for AI research in Chapter 9.

Bibliography

Den98
Daniel Dennett.
Brainchildren: Essays on Designing Minds.
MIT Press, 1998.

Jen98
Arthur R. Jensen.
Does IQ matter?
Commentary, pages 20-21, November 1998.
The reference is just to Jensen's comment--one of many.

McC59
John McCarthy.
Programs with Common Sense.
In Mechanisation of Thought Processes, Proceedings of the Symposium of the National Physics Laboratory, pages 77-84, London, U.K., 1959. Her Majesty's Stationery Office.
Reprinted in [McC90].

McC89
John McCarthy.
Artificial Intelligence, Logic and Formalizing Common Sense.
In Richmond Thomason, editor, Philosophical Logic and Artificial Intelligence. Klüver Academic, 1989.

McC90
John McCarthy.
Formalizing Common Sense: Papers by John McCarthy.
Ablex Publishing Corporation, 1990.

McC96a
John McCarthy.
Defending AI research : a collection of essays and reviews.
CSLI lecture notes: no. 49. Center for the Study of Language and Information, 1996.
distributed by Cambridge University Press.

McC96b
John McCarthy.
Concepts of Logical AI, 1996.
Web only for now but may be referenced.

Mit97
Tom Mitchell.
Machine Learning.
McGraw-Hill, 1997.

Sha97
Murray Shanahan.
Solving the Frame Problem, a mathematical investigation of the common sense law of inertia.
M.I.T. Press, 1997.

Tho03
Richmond Thomason.
Logic and artificial intelligence.
In Edward N. Zalta, editor, The Stanford Encyclopedia of Philosophy. 2003.
http://plato.stanford.edu/entries/logic-ai/.

Tur50
Alan Turing.
Computing machinery and intelligence.
Mind, 1950.

WHAT IS ARTIFICIAL INTELLIGENCE? Applications of AI

Applications of AI

Q. What are the applications of AI?

A. Here are some.

game playing
You can buy machines that can play master level chess for a few hundred dollars. There is some AI in them, but they play well against people mainly through brute force computation--looking at hundreds of thousands of positions. To beat a world champion by brute force and known reliable heuristics requires being able to look at 200 million positions per second.

speech recognition
In the 1990s, computer speech recognition reached a practical level for limited purposes. Thus United Airlines has replaced its keyboard tree for flight information by a system using speech recognition of flight numbers and city names. It is quite convenient. On the the other hand, while it is possible to instruct some computers using speech, most users have gone back to the keyboard and the mouse as still more convenient.

understanding natural language
Just getting a sequence of words into a computer is not enough. Parsing sentences is not enough either. The computer has to be provided with an understanding of the domain the text is about, and this is presently possible only for very limited domains.

computer vision
The world is composed of three-dimensional objects, but the inputs to the human eye and computers' TV cameras are two dimensional. Some useful programs can work solely in two dimensions, but full computer vision requires partial three-dimensional information that is not just a set of two-dimensional views. At present there are only limited ways of representing three-dimensional information directly, and they are not as good as what humans evidently use.

expert systems
A ``knowledge engineer'' interviews experts in a certain domain and tries to embody their knowledge in a computer program for carrying out some task. How well this works depends on whether the intellectual mechanisms required for the task are within the present state of AI. When this turned out not to be so, there were many disappointing results. One of the first expert systems was MYCIN in 1974, which diagnosed bacterial infections of the blood and suggested treatments. It did better than medical students or practicing doctors, provided its limitations were observed. Namely, its ontology included bacteria, symptoms, and treatments and did not include patients, doctors, hospitals, death, recovery, and events occurring in time. Its interactions depended on a single patient being considered. Since the experts consulted by the knowledge engineers knew about patients, doctors, death, recovery, etc., it is clear that the knowledge engineers forced what the experts told them into a predetermined framework. In the present state of AI, this has to be true. The usefulness of current expert systems depends on their users having common sense.

heuristic classification
One of the most feasible kinds of expert system given the present knowledge of AI is to put some information in one of a fixed set of categories using several sources of information. An example is advising whether to accept a proposed credit card purchase. Information is available about the owner of the credit card, his record of payment and also about the item he is buying and about the establishment from which he is buying it (e.g., about whether there have been previous credit card frauds at this establishment).

WHAT IS ARTIFICIAL INTELLIGENCE? Branches of AI

Branches of AI

Q. What are the branches of AI?

A. Here's a list, but some branches are surely missing, because no-one has identified them yet. Some of these may be regarded as concepts or topics rather than full branches.

logical AI
What a program knows about the world in general the facts of the specific situation in which it must act, and its goals are all represented by sentences of some mathematical logical language. The program decides what to do by inferring that certain actions are appropriate for achieving its goals. The first article proposing this was [McC59]. [McC89] is a more recent summary. [McC96b] lists some of the concepts involved in logical aI. [Sha97] is an important text.

search
AI programs often examine large numbers of possibilities, e.g. moves in a chess game or inferences by a theorem proving program. Discoveries are continually made about how to do this more efficiently in various domains.

pattern recognition
When a program makes observations of some kind, it is often programmed to compare what it sees with a pattern. For example, a vision program may try to match a pattern of eyes and a nose in a scene in order to find a face. More complex patterns, e.g. in a natural language text, in a chess position, or in the history of some event are also studied. These more complex patterns require quite different methods than do the simple patterns that have been studied the most.

representation
Facts about the world have to be represented in some way. Usually languages of mathematical logic are used.

inference
From some facts, others can be inferred. Mathematical logical deduction is adequate for some purposes, but new methods of non-monotonic inference have been added to logic since the 1970s. The simplest kind of non-monotonic reasoning is default reasoning in which a conclusion is to be inferred by default, but the conclusion can be withdrawn if there is evidence to the contrary. For example, when we hear of a bird, we man infer that it can fly, but this conclusion can be reversed when we hear that it is a penguin. It is the possibility that a conclusion may have to be withdrawn that constitutes the non-monotonic character of the reasoning. Ordinary logical reasoning is monotonic in that the set of conclusions that can the drawn from a set of premises is a monotonic increasing function of the premises. Circumscription is another form of non-monotonic reasoning.

common sense knowledge and reasoning
This is the area in which AI is farthest from human-level, in spite of the fact that it has been an active research area since the 1950s. While there has been considerable progress, e.g. in developing systems of non-monotonic reasoning and theories of action, yet more new ideas are needed. The Cyc system contains a large but spotty collection of common sense facts.

learning from experience
Programs do that. The approaches to AI based on connectionism and neural nets specialize in that. There is also learning of laws expressed in logic. [Mit97] is a comprehensive undergraduate text on machine learning. Programs can only learn what facts or behaviors their formalisms can represent, and unfortunately learning systems are almost all based on very limited abilities to represent information.

planning
Planning programs start with general facts about the world (especially facts about the effects of actions), facts about the particular situation and a statement of a goal. From these, they generate a strategy for achieving the goal. In the most common cases, the strategy is just a sequence of actions.

epistemology
This is a study of the kinds of knowledge that are required for solving problems in the world.

ontology
Ontology is the study of the kinds of things that exist. In AI, the programs and sentences deal with various kinds of objects, and we study what these kinds are and what their basic properties are. Emphasis on ontology begins in the 1990s.

heuristics
A heuristic is a way of trying to discover something or an idea imbedded in a program. The term is used variously in AI. Heuristic functions are used in some approaches to search to measure how far a node in a search tree seems to be from a goal. Heuristic predicates that compare two nodes in a search tree to see if one is better than the other, i.e. constitutes an advance toward the goal, may be more useful. [My opinion].

genetic programming
Genetic programming is a technique for getting programs to solve a task by mating random Lisp programs and selecting fittest in millions of generations. It is being developed by John Koza's group and here's a tutorial.