Philosophy, Computing, and Artificial Intelligence

PHI 319. Thinking is Computation.

"A Proposal for the Dartmouth Summer Research Project on Artificial Intelligence," 1955.

The Dartmouth College Artificial Intelligence Conference: The Next Fifty Years, AI Magazine, Volume 27 Number 4, 2006.

Other Historical Documents:

"The Logic Theory Machine," 1963.
Robert Kowalski. Computational Logic and Human Thinking.
Introduction (14-21) Chapter 1 (22-37).

Hector Levesque. Thinking as Computation.
Chapter 1 (1-5, 11-21), Chapter 2 (23-38).

Artificial Intelligence

AI ("Artificial Intelligence") is the study of intelligence. AI is not the same as cognitive science. Cognitive science studies human intelligence. AI studies intelligence more generally.

In this course, the focus is on understanding the intelligence that characterizes a rational agent.

Human beings are rational agents, and their intelligence is a primary example of the intelligence of a rational agent that we seek to understand and to model in this course. Furthermore, as we all know, human beings can think about their own thinking. So it is not too misleading, at least initially, to think of the content of this course as an exercise in the use of this ability to design the "mind" of a rational agent whose intelligence is human-like but not necessarily human.

The Rationality of an Agent

It is not easy to say in an informative way just what rationality is, but we can make some progress by considering two characterizations that may seem plausible but are open to counterexample. The background assumption for these characterizations is that an agent is rational just in case his or her actions are rational. Given this much, we can ask what is it for an action to be rational.

The claims about what rational action is take the form of "___ if, and only if ___" claims of necessity. For such claims to be true, the statements in the blanks on the two sides of the biconditional (the "if, and only if") cannot vary in truth-value. So one way to try to show that the biconditional is not true is to imagine a situation in which one of the statements is true and the other is false. The more plausible it is to think the imagined situation is possible, the more plausible it is to think that the situation imagined is a counterexample to the "___ if, and only if ___" claim under consideration.

The following are ways to say the same thing:
 • If P is true, then Q is true
 • The truth of P is sufficient for the truth of Q
 • The truth of Q is necessary for the truth of P.
One possibility is that (*) an action is rational if and only if it accomplishes the agent's intended goal. This account characterizes rational action in terms of the success of the outcome.

A little reflection, however, shows that this account of rational action is open to counterexample. Some actions are rational even though they do not accomplish the agent's goal, and some actions are not rational even though they do accomplish the agent's goal.

Suppose that someone gets a flu shot. If he comes down with the flu, this is no reason to think that getting the shot was not rational. Success, then, as this counterexample we have imagined shows, is not a necessary condition for rational action. An action might be rational even though it does not accomplish the goal the agent has in performing the action.

Neither is success condition a sufficient for rational action. Suppose someone in an act of drunkenness uses his life savings to buy lottery tickets. This is not rational even if he is lucky enough to win. So once again we have imagined a counterexample to (*).

What conclusion about rational action can we draw from these counterexamples?

The following are ways to say the same thing:
 • If P is true, then Q is true
 • P is true only if Q is true

Note that even if the agent's beliefs are rational, it does not follow that the his actions are rational. These beliefs must give rise to these actions in the right way.
In thinking about these counterexamples, it appears that actions are rational only if the underlying beliefs upon which they are based are rational. So one question has led to another question. Now we need to know what it is for an agent's beliefs to be rational.

This question is not easy to answer in a general and informative way. It seems clear, though, that we can recognize instances of rational and irrational belief formation. We will use this ability to construct the model of the intelligence of a rational agent we consider in this course.

The Intelligence of a Rational Agent

Intelligence in a rational agent, it seems, is an ability the agent has to form beliefs in certain circumstances that help it achieve its goals. It is not easy to say in an informative way exactly what this ability is, but an example may make the underlying idea a little clearer.

Consider an agent with a goal to avoid certain things in the environment, say coming close to a forest fire. Suppose that this agent forms beliefs about its environment through perception. Further, suppose that this agent observes the presence of smoke in its immediate surroundings. The agent observes smoke but does not observe a fire, so the observation of smoke itself does not provoke a response. Suppose, however, the agent has the ability to reason from its observation that there is smoke to the belief that fire is the cause of this smoke. The ability to form beliefs in this way can help it achieve its goals. Further, compared to an agent who lacks this ability to reason to causes from what it observes, this agent clearly seems to be more intelligent.

The Observation-Thought-Decision-Action Cycle

These reflections on rationality and intelligence presuppose what in hindsight seems obvious: that rational agents try to determine whether things are to their liking, that they try to make them better if they are not to their liking, and that they do this over and over again in a cycle.

The thinking that underlies this cycle falls roughly into two parts with different functions. The aim of one part is to form beliefs about how the world is. We can call the thinking that discharges this function "epistemic" cognition. The word 'epistemic' is a near transliteration of the Greek noun ἐπιστήμη (which is often translated into English as 'knowledge.') In ancient Greek philosophy, the dominant philosophical tradition thought that knowledge of certain aspects of the world is necessary for human beings to orient themselves properly and thus for them to live the kind of lives the ancient philosophers understood as good lives. The aim of the other part is to evaluate the world as represented by these beliefs, to select plans aimed at changing the world, and to execute these plans. We can call the thinking that discharges this function "practical" cognition.

The observation-thought part of the cycle

To understand the observation-thought-decision-action cycle, it is necessary to solve what in philosophy is traditionally called the problem of knowledge of the external world.

To maintain itself, an agent must have procedures for forming beliefs about itself and about the world. Some basic beliefs about the world may be built in, just as in human beings some basic beliefs about the world may be innate, but in a world with a changing environment, it seems that neither a human being nor an artificially rational agent can be equipped from its inception with all the information it needs. Both must acquire new beliefs by sensing its surroundings. These beliefs must come ultimately from perception, and the basic procedures must be built in.

"A computer program capable of acting intelligently in the world must have a general representation of the world in terms of which its inputs are interpreted. Designing such a program requires commitments about what knowledge is and how it is obtained. Thus, some of the major traditional problems of philosophy arise in artificial intelligence" (John McCarthy & Patrick J. Hayes, "Some Philosophical Problems from the Standpoint of Artificial Intelligence," 1969). Part of the reason progress in AI has been slower than anticipated may be that some of the problems in need solutions are not engineering problems. The philosophical problem of knowledge of the external world is an example. No set of procedures for forming beliefs about the external world counts as a solution to the problem of knowledge unless these procedures for forming and maintaining beliefs are rational, and whether a procedure for forming a belief is rational is not a question in engineering. It is, or at least is in part, a question in philosophy.

(Stanford Encyclopedia of Philosophy Artificial Intelligence, 3.1)
As an example of a procedure for forming beliefs, consider the way human beings form beliefs on the basis of perception. Perception is a process that begins with the stimulation of sensors and ends with beliefs about immediate surroundings. However this works in particular cases, it is clear that perception does not always result in true beliefs. A perceptual belief P (where P ranges over the beliefs possible given the perceptual apparatus of the agent) is defeasible. It is possible for the agent to acquire new information that makes it rational to withdraw the belief formed on the basis of the perception. For example, an agent who sees what looks to be a red object, but subsequently learns that the light is not normal and knows that the light can make the object appear red, may retract his belief that the object is red. Retracting the belief in these circumstances is rational, but to set out such procedures for belief generally has proven difficult.

The decision-action part of the cycle

Of course it is not enough for an agent simply to observe the world and to form beliefs about how the world is. To maintain itself, the agent must act in various ways. Further, at least some of its actions will be based on the beliefs it formed about how the world is.

Whether the agent likes its situation depends on what it believes is true of its situation. So one way for an agent to make the world more to its liking is to change its beliefs. One way to do this is for it to eliminate some of its beliefs or replace some of its beliefs with other beliefs.

Is changing beliefs in this way rational?

The answer may depend on the case. Some beliefs can make a person extremely miserable, so it might be rational to undergo hypnosis to get rid of them.
In the case of such actions, the agent will have evaluated the world as represented by its beliefs. If evaluation has the result that the world is not enough to the liking of the agent, the agent may form and evaluate plans to make the world more to its liking. On the basis of the evaluation, the agent may select one of these plans and execute it. At this point, the cycle will repeat.

This is easy enough to understand in general, but again it has proven difficult describe the underlying cognitive mechanism in the detail required to create an artificially rational agent.

The Observation-Thought Part of the Cycle

What state is fundamental in epistemic cognition? Is it knowledge, belief, or something else altogether? (The prior discussion assumes without argument that it is belief.)

What is knowledge? What is belief?

These are philosophical questions. Answers to them are controversial, but it is possible to make some progress by thinking about the words 'know' and 'believe.'

Consider how 'know' is used in English. Sometimes it is used as a propositional attitude verb. The sentence Tom knows that Socrates died in 399 BCE is an example. The word 'believe' is also used as a propositional attitude verb. Tom believes that Socrates died in 399 BCE is an example.

To begin to understand what knowledge is, we can think about the difference in the attitudes that these two verbs express in these sentences. In both sentences, the attitude is toward the same proposition: that Socrates died in 399 BCE. What propositions are is a difficult issue, but there are straightforward constructions in English that allow us to talk about them. When we nominalize a declarative sentence, we form a phrase that can be used as a subject in a sentence. So, for example, we can nominalize "Socrates died in 399 BCE" to form "that Socrates died in 399 BCE." Now we can use this phrase to say things about the proposition. We can say "That Socrates died in 399 BCE is true" or "That Socrates died in 399 BCE is something historians believe is true."

Given this understanding of propositions, we can say that certain verbs in English are propositional attitude verbs. Examples are 'knows,' 'believes,' 'fears,' 'hopes,' and so on. We can say of someone that he or she knows that Socrates died in 399 BCE, believes that he died in 399 BCE, and so on.

Propositions can be true or false, and we can say that strictly speaking evidence is propositional. The evidence for the truth (or falsity) of proposition is a set of propositions. (Notice that in ordinary conversation we do not always talk about evidence this way. We says things like "there is fossil evidence for the theory of evolution," but we can think of this as shorthand for various propositions about fossil are evidence for the theory of evolution.

Arguments have premises and a conclusion. Declarative sentences express the premises and conclusion. An argument is valid if, and only if, it is impossible for the conclusion to be false if the premises are true. An argument is sound if, and only if, it is valid and its premises are true.
This is the proposition Tom is said to know in the first sentence and to believe in the second. The difference in these sentences is in the attitude each ascribes. The first says Tom knows the proposition. The second says he believes it.

In this way, the sentences say different things. This follows from the fact that it is possible for the sentences to differ in truth-value. What someone knows he believes, but what someone believes he does not necessarily know. Hence, it is possible for the sentences to differ in truth-value because it is possible for Tom to believe but not know that Socrates died in 399 BCE.

Another way to express this point is in terms of the following arguments:

Knowledge entails Belief
1. Tom knows that Socrates died in 399 BCE
2. Tom believes that Socrates died in 399 BCE

Knowledge entails Truth
1. Tom knows that Socrates died in 399 BCE
2. Socrates died in 399 BCE

These two arguments are valid. In each case, it is impossible for the conclusion to be false if the premise is true. The same, however, is not true for these arguments:

True Belief entails Knowledge
1. Tom believes that Socrates died in 399 BCE
2. Socrates died in 399 BCE
3. Tom knows that Socrates died in 399 BCE

Belief entails Truth
1. Tom believes that Socrates died in 399 BCE
2. Socrates died in 399 BCE

In each case, it is possible for the premises to be true and the conclusion to be false.

The reason the argument True Belief entails Knowledge is invalid is that a true belief need not be knowledge. It is possible that the subject (Tom) has a true belief (that Socrates died in 399 BCE) but not knowledge because, for example, his belief is just a lucky guess. Knowledge requires that the subject be a special position with respect to the proposition. A standard way in philosophy to describe this special position is to say that agent must have "justification" for the belief.

To understand this, suppose that the subject (Tom) formed the belief in a dream. In this case, when we think about it, it seems plausible to say that the subject Tom does not know that Socrates died in 399 BCE) even if the proposition and hence his belief is true. If we ask ourselves why this seems right, the reason is that the subject did not form the belief in a correct way.

The reason that Belief entails Truth is invalid is more obvious. From the mere fact that the subject has the belief that Socrates died in 399 BCE, it does not follow that the belief is true.

"Thinking ... starts with an enormous collection of premises (maybe millions of them) about a very wide array of subjects)" (Levesque, Thinking as Computation, 19).

"[T]hinking means bringing what one knows to bear on what one is doing. But how does this work? How do concrete, physical entities like people engage with something formless and abstract like knowledge? What is proposed in this chapter (via Leibniz) is that people engage with symbolic representations of that knowledge. In other words, knowledge is represented symbolically as a collection of sentences in a knowledge base, and then entailments of those sentences are computed as needed" (Levesque, Thinking as Computation, 19).

Levesque's understanding of thinking makes it presuppose knowledge (and hence beliefs since knowledge entails belief).
Given this understanding of knowledge and belief, we can ask and begin to decide whether 'know' is the really right word in Levesque's assertion in Thinking as Computation that "[t]hinking is bringing to bear what you know on what you are doing" (3). His view is "that thinking is a form of computation," that just as "digital computers perform calculations on representations of numbers, human brains perform calculations on representations of what is known" (2), and that the computation is bringing what the agent knows to bear on what the agent is doing.

Is Levesque right? Is knowledge the state in terms of which an agent makes decisions?

How do we tell? One way is to consider possible counterexamples.

Suppose someone is considering whether to carry an umbrella when he goes out for the day. To decide, he looks out the window. It looks cloudy to him, so he decides to bring an umbrella. In fact, it is not cloudy. The window is only painted so that it looks cloudy outside. Since knowledge entails truth, the agent believes but does not know that it is cloudy outside.

This "umbrella" example seems to show that the fundamental state the agent brings to bear in deciding whether to take an umbrella is belief, not knowledge. The agent thinks it is likely to rain because he has the belief it is cloudy outside. So he decides to carry an umbrella.

It is true that he may think he knows it is cloudy outside, and we shall have to ask ourselves how this "thinking one knows" functions in decision making, but it looks like the epistemic state involved in his decision to carry an umbrella is belief, not knowledge.

The "Knowledge Base" (KB)

This "umbrella" example shows (or at least suggests) that the "knowledge base" (KB) in our model of a rational agent should consist in propositions the agent believes. Rational agents represent their circumstances in terms of their beliefs. Some of these beliefs may be knowledge, but belief, it seems, is the fundamental state in epistemic cognition.

This, at any rate, will be our assumption in the course for now. Although the assumption for now is that belief (not knowledge) is the fundamental state in epistemic cognition, we will continue to use the term "knowledge base" (KB).

The Computation on the Knowledge Base

In addition to having beliefs, rational agents use their beliefs in reasoning. The assumption in this course is that reasoning is a computational process. Further, in this course, the basic computational process in terms of which we will represent reasoning is backward chaining.

"The core idea is that an intelligent agent receives percepts from the external world in the form of formulae in some logical system (e.g., first-order logic), and infers, on the basis of these percepts and its knowledge base, what actions should be performed to secure the agent’s goals" (Stanford Encyclopedia of Philosophy, Artificial Intelligence, 3.2). This raises a host of questions. Here are answers to some of them.

What is computation?

Computations operate on symbolic structures.

What is a symbolic structure?

The assumption in this course is that what an agent believes is represented symbolically in a "knowledge base" (KB). The representations are stated in the language of the first-order predicate calculus. (We will consider the first-order predicate calculus in more detail later.) Computation operates on these symbolic representations in the agent's "knowledge base" (KB).

Levesque (in 2.2 of Thinking as Computation) talks about computing "logical entailment" (24). For now, don't worry about the difference between logical consequence and logical entailment. We will consider the difference in more detail later in the next lecture. Backward chaining computes logical consequence.

Backward Chaining on the KB

Backward chaining features prominently in what is called "logic programming." We will consider the details of logic programming in the next lecture.

"[L]ogic programming ... is the most widely used form of automated reasoning" (Stuart J. Russell and Peter Norvig Artificial Intelligence, A Modern Approach, 3rd edition, 9.4.337).

This approach to AI is sometimes called "logic-based AI" (Stanford Encyclopedia of Philosophy, Artificial Intelligence).
The central idea that motivates backward chaining goes all the way back to Aristotle (385-322 BCE). He observed that deliberation about how to satisfy a goal is a matter of working backwards in thought from the goal to something the person takes him or herself to be able to do. Aristotle's idea, roughly, is that as part of having reason, human beings form desires for the things they take to be good. Further, in order to take action, they deliberate about what to do to achieve these goods in the circumstances in which they find themselves. Deliberation, in this way, is a "goal-reduction procedure" to reduce the goal to something one can do.

A simple example helps illustrate the use of backward chaining in a goal-reduction procedure.

For the example, suppose that there are basic actions. These are actions one can do without doing something else. Lifting my right arm above my head might be an example. I can lift my right arm above my head, and I can do it without doing anything else. Because my right arm is not impaired in any way, I do not have to use something, say my left arm, to raise my right arm over my head. By contrast, opening a door is not a basic action. I can open a door, but I have to do it by doing several other more basic things. I have to grab the knob, twist, and pull the door open. So, in order to open the door, I do several other things. That is to say, for it to be true that I open the door, it has to be true that I grab the knob, twist, and pull open the door.

This distinction may be reflected formally. A formula of the form

a ← b, c.

may be understood to say that for a to be true, it is sufficient for b and c to be true. By contrast,


may be understood to say that b is true. There is no backward arrow (←) in this second formula because nothing needs to be true for b to be true.

Now, given this explanation of the formulas, suppose that an agent has beliefs about actions and the conditions sufficient for their truth. Suppose that these beliefs are in the knowledge base (KB) or what in the context of logic programming is called a program:

a ← b, c.
a ← f.
b ← g.

If the agent (who has this knowledge base) asks itself whether it can make a true, it can "deliberate" to determine the answer by reasoning roughly as follows:

I realize that there are two ways for a to be true.

Here is a more formal description of the "backward chaining" that occurs in example. a is the query. It is posed to the KB. To answer (the question of whether the query is or is not a logical consequence of the KB), backward chaining occurs. The first step is to determine whether the query matches a head of one of the formulas in the KB. Given the KB in the example, the query matches the head of the first formula in the KB. (a is the head in a ← b, c. The tail is b, c.) Given this match, backward chaining now issues in two derived queries, b and c. (The tail provides the derived queries.) These queries are processed last in, first out. b matches the head of the third formula in the KB. Backward chaining issues in no derived query. The remaining query is c. It matches the head of the fifth formula. Again, backward chaining issues in no derived query. Now that there are no more queries, backward chaining stops and a positive answer is returned to the query: a is a logical consequence of the KB. One way for a to be true is for both b and c to be true. Are b and c both true? Yes, b is true. Yes, c is true too. So the truth of a is a logical consequence of what I believe about the world. I have reasoned backwards from the goal (a) to basic action that I can take (b and c).

The other way for a to be true is for f to be true. Is f true? No, according to what I believe (the entries in the KB), there are no conditions sufficient for the truth of f.

Prolog is a computer programming language, which we will occasionally use in this course.
Here is a (slightly more complicated and abstract) goal-reduction example in Prolog notation.

Suppose in this example the query

?- a, d, e.

is relative to the following KB or program

a:-b, c. (this is Prolog notation for "a ← b, c.")

There are three possible computations given the query and the KB. These computations may be understood in terms of the following (upside down) tree whose nodes are the query lists. The commentary is for the computation represented in the the leftmost branch.

                                           ?- a, d, e.  
                  The initial query list is a, d, e. This list is processed 
                  last in, first out. The last query pushed onto the list is a. To
                  process a, the KB is searched top-down for match with the 
                  head of one of the clauses. a matches the head of first rule a:-b, c. 
                  The tail (b, c) is pushed on to the query list. Now this
                  query list (b, c, d, e) is processed in the same way.                                                                          
                       /                                                      \
            ?- b, c, d, e.                                            ?- f, d, e. 
            b matches a fact (b) in the KB. 
            Facts have no tail, so nothing is                                  
            pushed onto the query list. 
                         |                                                     |                                            
              /                       \                                    
       ?-c, d, e.               ?-g, c, d, e.                         ?- d, e.  
       c matches a fact.                                                              
                |                       |                                      |
        ?- d, e.                      •                                    ?- e.     
       d matches a fact.                               
                |                                                               |
          ?- e.                                                               ⊥                                         
       e matches a fact.    
       The query list is now empty. 
       The computation stops. The 
       initial query is successful.
       a, d, and e are logical 
       consequences of the KB.                                                                           

Each branch is a possible computation. The backward chaining process explores them one at a time. The first computation (the left most branch) is successful. Further computation to answer the initial query is not necessary, but for illustration it is represented in the tree.

In the next lecture, we will consider in more detail both the backward chaining computation and the form of intelligence this computation implements in the life of a rational agent.

The London Underground Example

The above examples are artificial, but there are real world examples. Consider the "London Underground" example that Robert Kowalski discusses (in Chapter 1 of Computational Logic and Human Thinking). The instructions in the emergency notice in the London Underground can be understood to include a goal-reduction procedure. The first sentence

Press the alarm signal button to alert the driver

can be understood as saying that

the goal of alerting the driver reduces to the subgoal of pressing the alarm signal button

We will talk more about maintenance goals later in the course--for now know that they are an important part of the logic programming/agent model.
If the typical passenger has the "maintenance goal"

If there is an emergency, then I deal with the emergency appropriately

and the beliefs

I deal with the emergency appropriately if you get help
I get help if you alert the driver

then the instructions in the London Underground may be incorporated into the agent's mind in the form of a logic program (in which the beliefs constitute the KB).

This program functions as the "knowledge" the agent brings to bear on the situation. If the agent observes an emergency, his observation will trigger the antecedent

there is an emergency

of his or her maintenance goal

If there is an emergency, then I deal with the emergency appropriately

This in turn gives the agent a goal to achieve, an achievement goal

I deal with emergency appropriately

To achieve this goal, backward chaining reduces the goal an appropriate subgoal. So, given the beliefs in the KB, backward chaining results in a plan of action

I alert the driver.

A Dual Process Model of Human Thinking

It seems obvious that human beings do not always explicitly reason in the way set out in the "London Underground" example, and Kowalski does not think otherwise. His view, as I understand it, is that human beings do sometimes reason explicitly in this way but that they also perhaps more frequently employ what he calls "intuitive thinking."

"The agent observes events that take place in the world and the properties that those events initiate and terminate. It uses forward reasoning to derive conclusions of its observations. In many cases, these conclusions are actions, triggered by instinctive or intuitive stimulus-response associations, which can also be expressed in the logical form of conditionals. The agent may execute these actions by reflex, automatically and immediately. Or it may monitor them by performing higher-level reasoning, as in dual process models of human thinking" (Kowalski, Computational Logic and Human Thinking, 20).
"[I]n recent years, cognitive psychologists have developed Dual Process theories, which can be understood as combining descriptive and normative theories. Viewed from the perspective of Dual Process theories, traditional descriptive theories focus on intuitive thinking, which is associative, automatic, parallel and subconscious. Traditional normative theories, on the other hand, focus on deliberative thinking, which is rule-based, effortful, serial and conscious. In this book, I will argue that Computational Logic is a dual process theory, in which intuitive and deliberative thinking are combined" (Computational Logic and Human Thinking, 15).

These "dual process theories" to which Kowalski refers are interesting, but we will not much consider them further in this course. We look to human beings as an example, but our aim is not to model specifically human intelligence. It is to design the "mind" of a rational agent.

What we have Accomplished in this Lecture

At this point, we have constructed a very simple (and clearly incomplete) model of the intelligence of a rational agent. Rational agents have beliefs about the world, and they reason in terms of these beliefs to decide what to do. The KB is a symbolic structure that represents the agent's beliefs. The backward chaining procedure on the KB represents the agent's reasoning.

go back move on