PSYCHOLOGICAL CRITICISM OF THE PROTOTYPE-BASED OBJECT-ORIENTED LANGUAGES

University of Helsinki
Faculty of Arts
Departement of Cognitive Science
Bachelor of Arts Thesis
Juha Petteri Pesonen
February, 2001

Contents

1. INTRODUCTION

"Still, a man hears what he wants to hear and disregards the rest." --Simon & Garfunkel, The Boxer

The object-oriented programming paradigm offers a completely new and a different view of how computer programs can model the world. All programming languages, like natural languages, can be seen as models of the world. This is the classical view of semantics: a word or a concept gets its meaning by a direct reference to an object in the real world. Since all words have a reference, a language is a model of the world. Analogously a programming language creates a certain model of the world. A language itself is said to be a reflection of how humans categorize or model the world. Our concepts have also a direct reference in the world. The mind therefore reflects the world and we express our thoughts in language:

Mind <=> Language <=> World

But how does the mind model the world? What kind of categories and concepts do we use? According to the traditional view, a view based on the philosophies of Plato and Aristotle, categories are definitions: there is a set of necessary and sufficient properties that determine if an object belongs to a certain category. This theory has been heavily attacked this century by philosophers and psychologist and it has been shown to be inadequate (Lakoff, 1987; von Wright, 1972; Hautamäki, 1993). According to the contemporary view, the prototype theory, categories are organized around prototypical examples, they have graded boundaries and lack necessary and sufficient criteria.

The ontologies of object-oriented programming languages have many resemblances to the classical view. In recent years a new paradigm inside the object-oriented languages has emerged. These prototype-based languages claim to be psychologically more plausible, because they are closer to the prototype theory of concepts (Taivalsaari, 1996).

This study will compare the constructs of object-oriented programming languages and review their similarities to the ontologies of Plato and Aristotle. We will see some criticism of the classical view and also of the prototype theory. Finally we will see if the prototypes-based languages really offer any psychological advantages.

How humans actually categorize the world is relevant to the design of programming languages. A language that would be more 'human-like' and conceptually intuitive would presumably be easier to learn, modify and understand; programs created with this language would be similar to the concepts that we actually use about a certain problem domain.

2. THE OBJECT-ORIENTED PROGRAMMING PARADIGM

The object-oriented programming paradigm rose in the end of the seventies. In traditional paradigms a computer program consists of variables and functions that take these variables as arguments and return new, changed variables. In object-oriented paradigm programs consist of standalone objects, that incorporate variables and functions that manipulate them. As a result, the behavior of a certain object is built into it - it no longer needs to be passed as a variable to a function somewhere else in the code in order to change it's state; this can now be done by directly manipulating the object. The advantages can be summarized in the following three features (Abadi & Cardelli 1996, 8):

Reusability and encapsulation are issues of programming techniques that are not of interest here; it is the last feature, the analysis, that we will concentrate on.

A great difference between programs designed with objects as compared with traditional paradigms, is that the programs are said to resemble conceptually the actual problem domain that is being analyzed: the components in the program are equal to the components in the real world (Abadi & Cardelli 1996, 7; Campione & Walrath 2001). This changes the way programs are being designed. In a procedural language the problem domain is first analyzed and then it is left to the programmer to decide how it can be simulated in a computer. In object-oriented languages the actual design of the program can be more isomorphic to the components and their behavior in the real world - more precisely, to those components and behaviors that result from a certain analysis, which varies from person to person. Another advantage is that the programmer and the people who need to use the program can communicate using the same concepts, because the components of the program and the real world are the same.

As an example, say a programmer needs to make a program that simulates the behavior of animals and plants in a forest. In a procedural language this would most likely be accomplished by creating variables of some sort for each kind of animal and plant and possibly grouping these variables with tables or linked lists, e.g. all owls could be in a table and all the flowers in some other table. The actual behavior of the inhabitants of this forest is accomplished with functions that do something particular, for example moves its argument from one tree to an another or makes the passed argument bark. It is up to the programmer to make sure that an owl is not passed to the bark function or a dog to the fly function, resulting in unwanted behavior. A code like this can end up being very complicated and difficult to maintain, also known as "spaghetti code". If a change is needed, the programmer needs to find the place in the code where this certain change needs to be done and to make sure that the change does not damage other parts of the program. This model takes no advantage of the fact that many objects in the forest share some features: all animals move, have weight and color, etc.

The object-oriented approach takes advantage of common features. All animals could for example, be derived from a common superclass Animal, which would incorporate all common features shared by all animals. The same way all plants could have a common superclass. The individual animals would all inherit from the Animal class: for example, owl would automatically inherit some behavior common to all animals, but on top of it, it would add its own behavior, flying, big eyes, etc. This guarantees also that owl's behavior is incorporated in the object itself and therefore cannot be accidentally made to behave in the wrong manner. The programmer calls the move method of an owl object, which will result in the owl moving in its own specific manner, probably flying. A similar call to a snake object will move the snake, probably by crawling. Making an owl crawl is now impossible.

New features and behavior can be added later more easily. If the age of the animals becomes important later this can be added to the Animal class and all the animals will automatically inherit it. And this will not effect previous code. In a procedural language the programmer might end up doing a lot of "find and replace" operations to track all the places where new features must be added leading to very error prone code.

Another way of seeing how programs model the world is noticing that originally programs were written in a machine language, which soon proved to be inhumane. Higher-level human readable languages with compilers were invented. This way more and more machine language instruction could be achieved with fewer and fewer higher-level language instructions. The higher-level instructions were just shortcuts that still pointed to the underlying machine architecture, but as the languages evolved, the language constructs no longer pointed to the machine, but instead to the world outside the computer. Objects are not shortcuts of machine instructions - they are computer simulations of real objects.

2.1. Common concepts used in object-oriented languages

This is very rough overview of general concepts used in object-oriented paradigm. There are many languages that have many different features, but the following concepts are found in most languages. The idea is to set upt some common terminology.

Classes

Classes are the fundamental building blocks of objects. A class itself doesn't do anything - it is a blueprint, a general description of objects created from that class. Once a class is instantiated you have objects. Objects vary in what their variables values are, also called the object's state, but what variables and methods they all have is defined by their class, also called their signature or type or an interface that describes how to use the class. Classes are sometimes called prototypes, but we reserve the word for another paradigm inside the object-oriented paradigm.

As an example we might have a class Planet, which defines variables, e.g. weight, temperature, distance from the Sun, orbital position, etc. All objects instantiated from this class have these variables with some values. A programmer can instantiate nine planets from this class to model our solar system setting the values correctly for Venus, Mercury, Earth, etc.

Objects

Object-oriented languages like the name suggests are based on objects. An object can be made to represent anything: a file, a rock-band, a number, a court order, Socrates, earthquake, etc. Objects are behavioral units that a programmer can manipulate in order to achieve the intended behavior. Objects are construed of fields and methods to manipulate those fields. An object, CD player for example, might have fields song number, time-left, status, etc. and methods play, pause, stop, forward, reward and eject. An object's state at a certain moment of time is the values of its variables.

Inheritance

Classes don't always have to be build from a scratch. A class can inherit behavior from another class, which is called its superclass. By subclassing the new class automatically inherits its behavior from the superclass, but it can add its own behavior on top of this. It can also override the inherited features if it so wishes. For example, class Playstation2 might inherit behavior from class Playstation, but add new features in the new class. Both classes will therefore share many features, but the class Playstation2 will have more functionality than Playstation.

Subsumption

Subsumption is the ability to use a subclass where an object of its superclass is expected. As all subclasses of a given class share the same methods and fields, i.e. the same type, similar behavior can safely be excepted. The opposite is not possible, since the superclass does not (necessarily) have all the same methods and fields. If a class Dog defines a method bark, then any subclasses of it, e.g. Golden Retriever, can bark and can therefore be used where an object of a class Dog is expected. A Golden Retriever is thus subsumed to a Dog.

Prototypes

Prototypes are the constructs of the new prototype-based languages, also called object-based (Abadi & Cardelli 1996, 35; Taivalsaari, 1996). They no longer have classes - the fundamental constructs of class-based languages. Prototypes are concrete, fully functional objects that are not instantiated from a class. They cannot be subclassed - instead a prototype can be cloned resulting in another concrete and fully functional object. In brief, in prototype-based languages there are only objects. This greatly simplifies the language.

Taxonomy - Class hierarchies

A class can have infinitely many subclasses, which can in turn be subclassed. This creates a hierarchy of classes, a taxonomy, starting from the top-most class or classes and expanding like a tree. Classes inherit behavior from all their superclasses thereby specializing their behavior. A subclass is said to be more specific. A language can have one class from which all objects must initially be subclassed (e.g., in Java the Object class) resulting in a taxonomy where there is only one tree. Some languages (e.g., C++) allow the uppermost class to be specified by the programmer resulting in many trees that might have nothing in common.

This was only a simple overview of common concepts in object-oriented languages based on Abadi & Cardelli (1996), Arnold & Gosling (1996), Campione & Walrath (2001) and Niemeyer (1998). The reality is much more complex: there can be classes inside classes; classes that cannot be subclassed; abstract classes that cannot be instantiated; classes that inherit from several classes; classes that only act like interfaces; methods that act like fields; prototypes that can change their parent/super class. Like natural languages you have plenty to choose from.

3. ONTOLOGY OF OBJECTS

The first large and systematic ontology was made by Plato, who distinguished between objects and forms (also called ideas). Objects are the things we encounter in everyday life with our senses, the individuals or particulars in the external world. For Plato this world was not enough, as the only true knowledge is knowledge by means of concepts. The concepts, he said, represent all the reality of things. Our knowledge could not be based on our experience, since this sort is fallible and true knowledge is not. We often misperceive things and we can never experience the true meaning of concepts: nobody has ever seen a perfect triangle or a perfect example of beauty, all we ever see is more or less imperfect examples of concepts. The true objects of reason are the immutable forms. Therefore the existence of a reality of forms is a necessity for Plato and in his ontology the world consists of two universes: one of forms and one of objects that only shadow the realm of forms. (Plato, The Republic; Jones 1970.)

For Aristotle, a follower of Plato, the existence of forms in some strange realm of the universe was not plausible. The only thing real is the individuals in this world. Aristotle on the other hand continued Plato's work and was very keen on categorizing the world and seeking the universal and final taxonomy of all living things. Things belonging to the same category were defined by common properties. A subcategory can add more properties, but in order to be a subcategory of some category it must share the same properties as the parent category and also to have distinguishing properties. Aristotle formulated the following definition for a category (Taivalsaari 1996):

essence = genus + differentia

A category (essence) is defined by its parent category (genus) and distinguishing properties (differentia).

What Aristotle set out to do was to find the common and distinguishing properties of all things: animals, plants, societies starting from the most primary object down to the tiniest details... much like designing class hierarchies. Plato did not taxonomize concepts in this way, although for him some concepts played a more important role: beauty, justice, reason and other valuable concepts.

The difference between Plato and Aristotle reflects an issue in philosophy that is called the problem of universals. "Universal" refers to the properties that are shared by the objects belonging to the same category, for example, the catness of all individual cats, where as "particular" refers to an individual cat. For Plato the universals are real entities existing somewhere in the world. Aristotle denies this view; there are only objects and the universals are embedded in the objects - they have no status on their own. The third extreme view is nominalism, which claims that there are no universals at all, only objects that are all different.

Aristotle's view is said to be conceptual. Conceptualism sometimes means also a view where the universals are only located in minds. This view in the end collapses to being nominalist. By conceptualism we mean here a view that the universals are located in the particulars. Whatever the ontological status of universals is it is evident that they play a major cognitive function. Categorizing and abstraction is based on the fact that we find similarities. Against the nominalists it can be said that if the universals are only located in the mind, it would be difficult to explain how universals are grasped at all if in the end all objects are different. No two objects are exactly alike, but they are not entirely different either.

There are quite a few similarities to the object-oriented languages. The concept of universals has a close resemblance to classes and particulars resemble objects. Thus the class-based languages are quite Platonic in their ontology, because classes exist independent of and before objects, whereas the prototype-based languages belong under the conceptualist standpoint (if no cloning was possible, they would be nominalistic, since all the objects would be different). In Plato's view objects were only imperfect examples of forms, but in object-oriented languages this is not the case - there is nothing imperfect in objects. Aristotle made no such claim either. The following equivalencies can be made: forms/universals are equal to classes and particulars are equal to objects. The words class, universal and category are used here interchangeably: they all refer to sets of objects.

Furthermore, if we take Aristotle's criterion we can define a class to be the essence, superclass to the genus and differentia being the new properties added by the subclass (Taivalsaari 1996). In object-oriented languages a subclass does not necessarily need to add new properties. Subclassing is not necessarily subtyping (Abadi & Cardelli 1996, 27). This is not allowed in Aristotle's definition, since there is nothing similar to overriding. A class inherits the behavior from its superclass (genus), but it also adds behavior that is not found in the superclass (differentia). Aristotle's criterion is thus applicable to distinguishing classes in object-oriented languages, but in more modern terms they are called the necessary and sufficient conditions for an object to belong to a certain category.

Aristotle's view of taxonomies also resembles the taxonomies of object-oriented languages. Classes form tree like hierarchies like Aristotle's taxonomy, where all classes are neatly located in their appropriate places, starting from the top-most class. Languages, where this class of which all other classes are subclasses, conform to the Aristotelian taxonomy. The idea that there is something from which everything derives from is fascinatingly very common in philosophies. It can be found, for example, in Hegel's and Neoplatonist philosophies.

Plato did not make this claim, but interestingly it follows from his arguments that there actually exists one form that must be on top of all others. Since forms represent what is in common to all individuals of some category and that there is something in common with all forms, namely their formness, there must be one form that allows us to categorize all forms as being forms, a form of all forms. This argument is called the third man argument.

4. CATEGORIZATION

4.1. What is categorization?

Categorization is one of the most basic cognitive skills in humans. It is so automatic and so deeply rooted that we might not even notice it until explicitly confronted with it. Every time we see, hear, sense or smell something as a kind of something we are categorizing. Recognizing words as verbs or substantives, or seeing chairs or trees or clowns is categorizing; instead of seeing a particular or an individual we also see a category. Performing any actions as writing, tying shoes, trading stocks or giving a speech we use hundreds of categories. All of these actions differ in some respect - they are never identical - yet they are still actions of some kind and we know how to make actions of that kind. Categorization becomes more difficult in, for example, scientific theories where we don't always know to which category certain objects belong to and when the boundary of two categories is fuzzy. Is a whale kind of a fish or a mammal? What is the difference between an angry and a frustrated person? (Lakoff 1987, 6.)

Without categorization we would not function at all. Although in most cases it is unconscious many, if not all, categories have been learned at some prior time, but the process has been automated so that we no longer need any effort for it. In psychology this is called automaticity: the more a process has been practiced, the less attention it requires, and there is speculation that highly practiced processes require no attention at all (Andersson 1995, 92). Not all thinking or behavior needs categories though. Some reflects, for example, are build into the nervous system and are involuntary. Situated behavior (behavior-based architectures) in general, can possibly be explained without categories or any representations at all, because it can be seen mostly as reacting to the environmental stimulus (Brooks, 1986).

Categorization is a form of abstraction, which refers to the psychological capability to extract sufficient amount of properties from given objects or events in order to recognize similar future objects or events. It allows us to store useful conceptual information that applies to a set of individuals and use this knowledge in the future. Without categories and the conceptual knowledge associated with them we would have to learn all the information for all the objects we ever confront separately. Storing all the information of all the objects is impossible for a finite brain, but storing just enough information to categorize an object allows us to use all the previously acquired knowledge about the category. Having learned that tigers are dangerous, we can do our best to escape a new one, because we know using our category that it is dangerous. Without the concept we would have to learn for each and every tiger that it is dangerous.

Concepts also enable us to convey meaning using different communication medium. In order to talk about a DOG, we can write the word "dog", show a picture or use the utterance /dog/. This way concepts allow us to rise above the physical stimulus environment - the same abstract concept can be referred to in different ways. When a child learns a category VERB, she learns some abstract properties that allow her to recognize an infinite number of future verbs whose physical stimulus might be entirely different.

All natural languages reflect this cognitive ability. Languages are full of terms that refer to categories, the words "dog", "car", "spoon", "mammal", "essay", etc. do not refer to a certain individual, instead they name categories, that consist of possibly infinite number of individuals. Abstraction or conceptual thinking is not tied to language only, but found also in pre-linguistic thinking. Animals and children younger than twelve months have been shown to be able to perform categorization and patients who have lost their linguistic capacities due to aphasia have not lost their ability to think in concepts. (Saariluoma 1995, 71.)

Studies have also shown that concepts are stored with some default basic knowledge. Participants in a study were asked to wait in an office room while the researcher was finishing with the previous group. After 35 seconds the participants were taken to a seminar room and were asked to write down what they remembered about the office room. Participants remembered well items that belong to a typical office room: chair, desk and wall. But only few recalled that there was a bulletin board and a skull and some remembered that there were books, which there were not. The study is interpreted as showing that participants have a concept OFFICE ROOM with some default values. (Andersson 1995, 156.)

4.2. Classical view of categorization

Classical view of what categories are stems from the ontologies of Plato and Aristotle's that was overviewed above. This view has been among us for more than 2000 years and has not been questioned until this century. It is the standard view in science, but also in folk psychology. (Lakoff 1987, 118.)

According to the standard view categories are defined solely by the common properties shared by all members of the category. There is a set of necessary and sufficient properties to distinguish if an object belongs to a certain category. It either does or does not; there are no graded boundaries. It is a matter of two-valued logic: a statement of type "object x belongs to the category X" is either true or false. In Aristotle's terms this is the essence of a category.

Categories are nomologically true. They exist out in the real world independent of any particular observer. Categories in the human mind correspond to categories out in the real world. In fact, any cognitive agent (human, animal, Terminator...) will find the same categories - depending on their cognitive skills they might find more or less of them. This means that all people think using the same concepts and if one was able to see everything one would see the correct view of the entire universe - the god's eye point of view. Mind is then conceived as a mirror of the nature and any reasoning the mind performs must correspond to states in the external world for it to be correct.

4.3. Criticism of the classical view

The classical view of categorization described above has been summarized in the following points (Lakoff 1987, xii; some items omitted):

Categorization has been heavily studied this century in cognitive science, psychology, anthropology, linguistics and philosophy and the accumulated evidence no longer supports the classical view to which object-oriented languages are based on. First, definitions are hard to come by. It is simply extremely difficult to define even simple concepts like apple or chair. Even in the field of mathematics definitions are disputable. Second, the correspondence theory can explain the references of individual objects, but it cannot explain the meaning of words like "Santa Claus" or "Luke Skywalker" by reference. The references of words like "Paris", "Helsinki" and "London" can easily be pointed at, but what does the word "City" refer to? The classical answer is that the category CITY is a set or an intention that the word "City" refers to and which exists in some mysterious platonic realm. The mind grasps this intention and there after knows the extension of the category.

The following theories are examples of criticism against the classical view.

Wittgenstein

Later Wittgenstein first pointed out that there are many categories that do not fit the classical demand that members would share the same properties. A category GAME does not possess common properties shared by all games. Some games involve mere amusement. In these games there is no winning or losing though in other games there is, e.g. tennis, minesweeper. Some games involve luck, like board games where a throw of dice determines each move. Some board games, like chess, involve only skill. Still others, like poker, involve both. (Wittgenstein 1953, 1:65-78.)

Wittgenstein claimed that the different games are united by what he calls family resemblance. Games resemble each other, but there is no one single property that is shared by all games. Some games resemble others, like chess and Othello, where skill is needed. Poker and chess both involve competition. In poker and dice luck is needed. Games are tied to other games in a wide variety of ways and this is what makes them a category - not one property or a set of properties shared by all games.

More formally, in a category C member m1 might have properties p1 and p2, m2 properties p2 and p3 and m3 p3 and p4. Members are united in this case by family resemblance, but there isn't a single property that can be predicated to all members.

Wittgenstein also observed that category boundaries are extendable. They can grow or get smaller as new members are introduced or discovered. The category game has been extended recently with the invention of video games and adventure games on the Internet played by thousands of people, who can also participate in the design of the game. Telephone is another example of a category that has recently been modified by mobile phones. Categories can also be extended on the fly. If a man carrying heavy boxes decides to take a rest and sits on one of the boxes, the box becomes a chair.

The category NUMBER has also been redefined every now and then by mathematicians introducing new types of numbers, fractal, irrational... It shows that the category is extendable, but it also shows contrary to the classical view that some members are better examples of a category than others. When asked to give examples of numbers people generally refer to integers, not for example to complex or fractal numbers. Integers have some status that other numbers do not and any definition of a number must include the integers in it.

Focal colors

Languages divide the color spectrum in different ways. Some languages have only two color words, some three and four and some hundreds. Berlin and Kay realized that although there exists various color terms in languages all languages have basic color terms. For a color to be a basic term it must consist of a single morpheme. It is not contained in another color term, it is not restricted to small amount of objects and must be well known.

The basic color terms name basic color categories that are universal. Their central members are always the same. The universal categories are in English black, white, red, yellow, green, blue, brown, purple, pink, orange and gray, but unlike English, not all languages use them all. But, if a language has two color terms, they are always black and white. Third is always red. When a language has four basic color terms, the fourth one is either yellow, blue or green. These categories are psychologically real and universal - they name focal colors that are best examples in all cultures regardless of how many color terms there are in a language. Kay-Mcdaniel has shown that it is due to our neurological system that is more responsive to certain frequencies in the color spectrum. (Lakoff 1987, 26.)

Focal colors show that color categories are not classical - some colors are better examples than others. It also shows clearly how colors are perceived is a matter of the neurological setup of the agent - color categories might be entirely different for species with a different visual system.

Ekman established similar results in studying facial gestures expressing emotions. He found that seven types of emotions were universally recognized from facial expressions: happiness, sadness, anger, fear, surprise and interest. People from varying cultures were able to recognize these emotions from facial expressions. Other emotions might not have correlates in any particular facial expression. These basic emotions show also prototype effects: they are best examples of the EMOTION category. Rage and annoyance belong to the anger category, but are not the best examples. Like focal colors that were biologically motivated "the focal emotions" are also emotions that can be expressed in certain bodily movements and expressions. It has been demonstrated that certain states in the Autonomous Nervous System correspond to these basic emotions. (Lakoff 1987, 38.)

4.4. The prototype theory of categorization

It was Eleanor Rosch who generalized all the experiments conducted by different researchers and elaborated the prototype theory that challenged fundamentally the classical view. According to the classical view no member of a category should have any special status, since they all share the same properties. Rosch designed a number of experiments that clearly showed that this is not the case - some members or subcategories are better examples of a category and are hence called prototypes. Speakers of Dani only have two color words: mili (dark-cool, including black, green and blue) and mola (light-warm, including white, red, yellow). Rosch reasoned that if speakers of Dani should learn arbitrary names for focal colors more easily than for non-focal colors, then focal colors were better examples of a certain color category. The names for focal colors were learned faster and they were also remembered better (this applies similarly to speakers of English too). The research demonstrated that focal colors are psychologically more real and that this effect has little to do with the language community, because similar effects have been found in speakers of other languages. Similar studies have been replicated often by other researchers and there is no doubt that prototype effects are real. (Lakoff 1987, 39.)

Prototype categories differ from classical ones in many ways (adapted from Pinker & Prince 1999, 8):

Examples of prototype effects are found in many categories. Robins are more representative of the category BIRD than are chickens, or penguins, desk chairs are better examples of a CHAIR than rocking chairs or electric chairs. Gray hair, domestic and peaceful lifestyles characterize many grandmothers, but Elizabeth Taylor can still be a grandmother, although she does not have these properties.

Basic level

According to the classical view categories in the middle have no special status. Rosch, Berlin and Hunn have shown that psychologically the most basic level is in the middle of a taxonomic hierarchy. This level can later be specialized or generalized to a superordinate or subordinate level (Lakoff 1987, 46):

SUPERORDINATE: ANIMAL FURNITURE
BASIC LEVEL: DOG CHAIR
SUBORDINATE: RETRIEVER ROCKING CHAIR

When participants are asked to list attributes of a category they usually list attributes found in the basic level, and very few attributes of the superordinate level. Berlin also noticed the same effect when studying categories of Tzeltal speakers. When asked to name things in a forest they would name things in the basic level (oak, maple, etc.), not in the subordinate level, e.g. sugar maple or live oak, and neither in the superordinate level, e.g. tree. He also noticed that children learn those levels first; then children work up the hierarchy generalizing, and down the hierarchy specializing. The ability to categorize at the basic level comes first, it is mastered at the age three, and only later do children learn to generalize and specialize categories with certain logic. It seems that at the basic level objects have "interactional properties" meaning that people have ways to interact with them and to form mental images, whereas at the superordinate level objects cannot be interacted with and representing them needs a process of abstraction. This representation can no longer be an image. For example, at the basic level we can form image representations of a CHAIR, but at the superordinate level it is impossible to form an image of a FURNITURE or MAMMAL, that would not be an object of the basic level.

The basic level is (Lakoff 1987, 46):

Rosch has shown contrary to the classical view that categories are not arbitrary. They are motivated by our neurological system and have bodily bases. Second, category boundaries are not sharp; some objects are better examples of a category than others and some categories can overlap with others.

4.5. Criticism of the prototype theory

Some concepts do have definitions and also prototype effects. A category such as ODD NUMBER clearly has a definition: a number not divisible by two. But people also rate the number 13 as a better example of the category than 23. Similar results were found in the English past tense system. Regular past tense verbs have a definition, which simply is the rule stem+/ed/, but the class of irregular verbs shows family resemblance structures and the verbs are organized around prototypical examples. These results seem to indicate that categories can be both classical and prototypical. (Pinker & Prince 1999, 47.)

A common complaint against the prototype theory is that it is incapable of explaining the productivity of thought. By combining concepts into larger concepts, potentially an infinite number of complex concepts can be produced. It makes no sense to explain that a finite organism, such as the brain, possesses an infinite amount of concepts; there can't be a prototype for every complex expression.

There may, for, example be prototypical cities (London, Athens, Rome, New York); there may even be prototypical American Cities (New York, Chicago, Los Angeles); but there are surely no prototypical American cities situated on the East Coast just a little south of Tennessee. (Fodor 1981, 296).

Concepts can also be created on the fly: "ways to escape being killed by the Mafia" or "items to save from a burning building". There are possibly an infinite number of these kinds of categories and the brain is too small to store one prototype per each category (Clark 1993, 106).

The current status of prototype theory is that it is not a theory of representations. They can be classical, connectionist, etc., but whatever they are they must explain the prototype effects. If categories are classical, prototype effects could, as an example, result from the way items are retrieved from memory. Connectionist theories have an inherent prototype extraction mechanism (Clark 1993, 20).

5. IMPLICATIONS FOR THE PROTOTYPE-BASED LANGUAGES

Having seen some of the inadequacies in the classical and in the prototype theory of categorization, we will see what implication they have for the prototype-based languages.

5.1. Lack of categories

To revise what was said above. Categorization is the process by which distinct entities are treated as equivalent and thus allows the mind to operate on a set of objects. Once there are categories, knowledge can be added, deleted and modified to them and this knowledge then applies to all objects that belong to the category.

Given this fundament cognitive skill of categorization, it clearly follows that the prototype-based languages lack something. Namely the fact that there is no language construct that allows us to refer to categories, a set of objects. There are no classes, only individual objects. How can we refer to categories? A language without universals would be a language where you have the words "Plato", "Aristotle", "Nietzsche", etc., but not the word "philosopher".

This lack has been noticed in the prototype-based languages and concepts like family, traits and prototype have been introduced to refer to a group of objects (Abadi & Cardelli 1997, 47). A prototype in this case means a prototypical object that is not a usual object. There are now two types of objects: normal objects and prototypes. Prototypes are special objects that cannot be used where normal objects can, they are meant only to be blueprints of which normal objects are constructed from. But Rosch said nothing of this kind. Prototypes, in the prototype theory, are objects as any other objects - it just happens that they are better examples of the category; that is all the difference there is.

Traits on the other hand are abstract descriptions of objects. They are safe from the above criticism and are good descriptions of categories like classes. But, how in the end are they different from classes? From a purely psychological perspective speaking about classes or traits makes no difference - they both represent categories and do it equally well. The problem with class-based languages is that the classes come first. In real life it is the opposite. In order to abstract the category we must first be confronted with some concrete examples.

5.2. Top-down approach vs. basic level

Probably the biggest weakness in all object-oriented languages, including the prototype-based languages, is that it forces the design to start from the uppermost, abstract categories - the superordinate level. Studies on the basic level have clearly shown that this is not the case - categorization starts from the middle, where objects are most concrete, easily perceived, remembered and play a more important role in our everyday lives.

It is after acquiring expertise in certain domain that we learn how to abstract higher and higher levels of categories using our imagination an also to differentiate with more specific subcategories. The process of acquiring expert knowledge is a matter of years and once we leave the basic level categorization becomes much more disputable. Biologists have disputed for hundreds of years how to taxonomize the animal kingdom. The cladist claim that the "correct" way to do it is by the evolutionary history and the pheneticist claim that the "correct" way is to group animals by their overall similarities in form and function.

There is nothing wrong with any of the views. Human mind is extremely flexible and we can form different taxonomies of the same categories by just changing the criterion. In class-based languages hierarchies lack this flexibility; it is extremely difficult to change the hierarchy later on. In object-oriented design you can only extend classes so the most abstract classes must be known in advance. In prototype-based languages, the parent object is a variable and can therefore be changed even on the fly. This definitely makes reorganizing the hierarchies easier and provides ways to make radical changes to objects.

The previously mentioned example of a box becoming a chair could be well modeled by changing the parent of the box object to a chair. Prototype-based languages model this example much better than class-based languages. If an on-the-fly change of the superclass is allowed, using it will change the superclass of all objects created from that class, which is not what is wanted in this example. All that is needed is to change the parent of the particular box that ends up being a chair - the other boxes must remain intact. Creating a new object from the class Chair doesn't help either, because then there would be two objects, which is not the case. There is just one object that becomes a chair for a while.

5.3. Family resemblance

Class-based languages have nothing similar to family resemblance. They are based on the traditional view that all objects belonging to a class share the same properties. In prototype-based languages objects can decide what to inherit by delegation or by embedding (Abadi & Cardelli 1997, 42). This can result in a set of objects that do not have the same properties - a family resemblance class. But, once a category/trait is attached to these objects, then the category is classical again.

5.4. Prototype effects

Categories in object-oriented languages do not show prototype effects: some member of a category or a subcategory is a better example of the category. In class-based languages as in prototype-based languages all members of a class are equally good examples of the class. Prototype effects would need some kind of a fuzzy arithmetic, where the membership value could be modeled with values ranging from 0 to 1. That is, it would not be binary instead some objects would score 0.9 and some others 0.2 only.

6. SUMMARY

From an ontological point of view the prototype-based languages win. There is little evidence of a strange platonic realm of categories, but class-based languages don't necessarily have to be realist in their ontology - a language can include universals and "Santa Claus" without committing to realism (von Wrigth 1972, 198). Unless the prototype-based languages include some notion of categories they lack something psychologically very important: the capacity of categorization.

I think that the claim that prototype-based languages are psychologically better comes from the misunderstanding that the prototype-theory is a theory of representations. Prototype effects are certainly real. In order to simulate them the language should somehow calculate a best example of a given class or a trait. One possible solution is suggested in the language Kevo (Taivalsaari, 1996). Kevo allows objects to share properties, but they do not have to be identical. Objects are grouped to families ("family" is yet another word for a category), which the system somehow maintains. If this system could also somehow calculate a statistical tendency of the properties in the family, then some objects could be better examples of the category, because they would have more of the properties that are statistically most commonly present in the category. Some objects might share only few of the common properties. They would therefore be very unprototypical examples. There might sometimes even be properties shared by all objects and at that moment the category would be classical. sThis would accommodate the view that both family resemblance and classical categories can be psychologically real (Pinker & Prince 1999, 20).

7. REFERENCES

Abadi, Martin and Cardelli, Luca (1996). A Theory of Objects. New York: Springer-Verlag, 396.

Anderson, John R. (1995). Cognitive Psychology and Its Implications. New York: W.H. Freeman and Company, 519.

Arnold, Ken and Gosling, James (1996). The JavaTM Programming Language. Addison-Wesley Publishing Company, 333.

Brooks, Rodney A. (1986). Achieving Artificial Intelligence Through Building Robots. MIT AI Lab (Memo 899): http://www.ai.mit.edu/people/brooks/papers.html, (3.2.2001).

Campione, M., Huml, A. and Walrath, K. (2001). The JavaTM Tutorial. Sun Microsystems: http://java.sun.com/docs/books/tutorial/, (14.1.2002).

Clark, Andy (1993). Associative Engines: Connectionism, Concepts, and Representational Change. Cambridge, MA: The MIT Press, 252.

Fodor, Jerry A. (1981). The Present Status of the Innateness Controversy. In Fodor, Jerry A. RePresentations: Philosophical Essays on the Foundations of Cognitive Science. Cambridge, MA: MIT Press, 257-316.

Hautamäki, A. (1993). Kognitiotiede. In Hyvönen, Eero, Karanta, Ilkka and Syrjänen Markku (Eds.) (1993). Tekoälyn Ensyklopedia. Hämeenlinna: Gaudeamus, 53-61.

Jones, W.T. (1970). A History of Western philosophy: The Classical Mind. San Diego: Harcourt Brace Jovanovich, 378.

Lakoff, George (1987a). Women, Fire, and Dangerous Things: What Categories Reveal about the Mind. Chicago: University of Chicago Press, 614.

Niemeyer, Patrick and Peck, Joshua (1998). Exploring JavaTM. O'Reilly, 407.

Plato. The Republic. Benjamin Jowett (Tr.)(1998). Project Gutenberg: http://www.gutenberg.net/, (3.2.2001).

Pinker, Steven and Prince, Alan (1999). The Nature of Human Concepts: Evidence from an Unusual Source. Loocke, Philip Van (Ed.) (1999). The Nature of Concepts: Evolution, Structure and Representation. NY: Routledge, 8-51.

Saariluoma, Pertti (1990). Taitavan Ajattelun Psykologia. Keuruu: Otava, 221.

Taivalsaari, Antero (1996). Classes Versus Prototypes: Some Philosophical and Historical Observations. ResearchIndex, The NECI Scientific Literature Digital Library: http://citeseer.nj.nec.com/taivalsaari96classes.html, (15.1.2002).

Wright, Georg Henrik von (1968). Logiikka, Filosofia ja Kieli: Ajattelijoita ja ajatussuuntia nykyajan filosofiassa. Hintikka, Jaakko and Nyberg, Tauno (Tr.). Helsinki: Otava, 263.

Wittgenstein, Ludwig (1953). Philosophical Investigations. Anscombe, G.E.M. (Tr.). Oxford: Basil Blackwell, 516.