Munindar P. Singh and Mona Singh Deconstructing the “Any” Key popular techies’ tale goes call this desired behavior pens. Press the caps and as follows. A user calls “acknowledged continuation.” it may affect what you type later, A customer support with a This program might look some- but the program still doesn’t problem: “The program says thing like the following in budge. On some computers, ‘press any key to continue’ but I pseudo code: when the is pressed, can’t find the any key on the key- something weird may happen. board.” Ditto with the function keys. Stupid user. display(“press any key to continue”); Press the power on-off key, We suppose this story is apoc- get_character() which exists on some keyboards, ryphal. Most people have a rea- and the results may be far more sonable understanding of dramatic than desired. It is fair language even if they aren’t This is a nice program and to say the program will not con- familiar with computers. But gives every indication of being tinue as promised. we’re not surprised if some user reliable. The program displays a Some key combinations count has had this very difficulty figur- message and awaits an input as one key. Press shift and a letter ing out the “any” key. from the user. As soon as an (say, j), and it works fine, as any Our point is that although an input, any input, arrives, the programmer would expect. How- actual user may or may not be as program can continue. ever, some key combinations are ill-informed as the apocryphal When the user sees the mes- dangerous. In the Windows one, virtually all real program- sage “press any key to continue,” world, the control-alt- delete mers are insensitive. And we he or she (usually) has a readily combination opens up a window don’t mean personal insensitivity. available keyboard. By definition, listing running programs that the We mean technical insensitivity, one would expect, a keyboard is user may kill. A second control- the kind that results from view- something with keys. alt-delete can reset the computer. ing a problem solely from one’s But not all keys are alike. In the Unix world, control-C can own perspective. Experienced users know to press kill a program and control-Z sus- We imagine the programmer a key that works, such as the pends it. Control-S can suspend writing the instructions to press or the . How- any output. any key wants to delay process- ever, this is more a matter of a The gist of this is that a speci- ing until the user has acknowl- user having been trained through fication saying “press any key to edged reading some message. past experience to press the right continue” is far from unambigu- (This is called a dialogue, keys than a matter of the specifi- ous to the user. It may seem clear although it doesn’t allow much in cation itself being clear. from the programmer’s perspec- the way of conversation.) The For instance, some of the keys tive because the program receives programmer writes a simple pro- have no effect. Press the shift or an input only under circum- gram to achieve this effect—let’s and nothing hap- stances that the underlying oper-

COMMUNICATIONS OF THE ACM April 2000/Vol. 43, No. 4 107

ating system deems appropriate, the users’ perspective. To under- the case of the “any” key, we that is, only when an acceptable stand a communication from the must keep trying. key is pressed. So the right dis- perspective of its recipient is one As for the matter of acknowl- play message ought to be, “press of the lessons of deconstruction edged continuation, just ask the any acceptable key to continue.” theory. user to press the space bar. c However, such an instruction A lot of people talk of the Munindar P. Singh would be meaningless, because importance of being user-cen- ([email protected]) teaches computer science at North Carolina the term “acceptable” has no tered. Here is a case where being State University in Raleigh. obvious interpretation. user-centered has direct conse- Mona Singh ([email protected]) is The moral? We as program- quences on our programs. with the Ericsson New Concepts group in mers should take into account Although thinking from another Research Triangle Park, NC. alternative perspectives, especially perspective is rarely as easy as in © 2000 ACM 0002-0782/00/0400 $5.00

Jerzy W. Grzymala-Busse and Wojciech Ziarko Data Mining and Rough Set Theory

his is in response to “Myths applications of rough set theory, existing discretization methods, about Rough Set Theory” discretization is used as a prepro- based on many different T(Nov. 1998, p. 102) by cessing. However, discretization is approaches to uncertainty, could W.W. Koczkodaj, M. Orlowski, required in all rule (or tree) induc- be used as preprocessing for and V.W. Marek. The authors tion systems. Such systems consti- KDD-R and LERS. Discretization raise some important issues and tute the core of data mining (or is a technique used in many areas, express some legitimate concerns. knowledge discovery). Many such including machine learning and We are surprised they list rough well-known systems (such as learning in Bayesian networks, set theory as the only discipline in C4.5, based on conditional and is definitely not restricted to which there are two of the cited entropy or CART, based on Bayes rule induction systems based on problems—the discipline in which rule) are equipped with their own rough set theory. discretization is necessary or which discretization schemes. Neither To illustrate the complexities deals with complex data. The C4.5 nor CART use rough set involved in data analysis, the third problem raised by the theory. Practically every machine authors refer to an example of a authors is associated with the dif- learning system uses discretization table with 10 attributes, each with ference between objective and sub- while very few of them are based 20 values, which is likely to lead jective approaches to uncertainty. on rough set theory. To compli- to a large “number of possible Let us start with discretization. cate matters, discretization meth- instances.” However, one could Many people deal with discretiza- ods used in rule induction systems cite this kind of example to illus- tion unknowingly. For example, in based on rough set theory, such as trate potential problems occurring grading student work, there are KDD-R or LERS, are not based in all disciplines dealing with data, usual cut-points (90% for an “A,” on rough set theory (for example, starting from statistics, through 80% for a “B,” and so forth); orig- both KDD-R and LERS use sta- database management, and ending inal scores are replaced by inter- tistical methods). Furthermore, with machine learning (for the vals, coded by “A,” “B,” and so these discretization methods could sake of correctness, it is not clear on. The authors are probably con- be used in other systems, (in C4.5 what the authors mean by “the fused by the fact that in some or CART). On the other hand, all number of possible instances.”

108 April 2000/Vol. 43, No. 4 COMMUNICATIONS OF THE ACM

Most likely they refer to the num- well-established calculus of uncer- the same phenomena. However, in ber of possible different cases tainty. For a long time there was a rough set theory the basic tools are (rows) of the table. They are mis- dispute (and still is) between the sets: lower and upper approxima- taken. The correct number is objective approach to the defini- tions of the concept. These sets 2010^10 = 1.024*10^13). In all tion of probability (based on are well defined and are computed of these areas we may deal with experiments and relative frequen- directly from the input data. big data sets and with potentially cies of outcomes) and the subjec- Thus, rough set theory is objec- large number of different data tive approach (based on experts’ tive, but it does not mean that it is sets. Again, the problem is com- opinions). For example, an indi- superior (or inferior). For exam- mon to all of these disciplines and vidual may observe a game based ple, if input data were pre- by no means occurs just in rough on a random process and evaluate processed and numerical attributes set theory. Fortunately, rough set probabilities. This is the objective were discretized by an expert, the theory offers algorithms with approach. Or, the individual may resulting data might be subjective. polynomial time complexity and ask a gambler how he or she will But again, this preprocessing is space complexity with respect to bet his or her own money. This is not a part of rough set theory, as the number of attributes and the the subjective approach. Cur- we explained previously. Input number of cases. rently, subjectivism prevails in data must be given to initiate Finally, regarding the authors’ probability theory. The propo- rough set theory procedures, and, comments about objectivity of nents of the subjective approach when rough set theory comes into rough set theory, we are puzzled do not show any inferiority com- the picture, its methods are objec- why they assume objectivity plex. The problem is definitely tive with respect to given data. c means superiority. They confuse not which approach is superior. Jerzy W. Grzymala-Busse daily life with science. In real life The Dempster-Shafer theory uses ([email protected]) is a professor in the we would like to have objective the subjective approach to uncer- Department of Electrical Engineering and managers, for example, giving tainty because its fundamental Computer Science at the University of Kansas. salary raises based on merit. But tool, a belief function, should be Wojciech Ziarko ([email protected]) is this is not how the subjective or estimated by experts. There are a professor in the Computer Science department at the University of Regina, Canada. objective approach is understood close relations between the Demp- in science. Probability theory is a ster-Shafer theory and the rough good example. It is an example of set theory. Both theories describe © 2000 ACM 0002-0782/00/0400 $5.00 Friedrich Steimann Abstract Class Hierarchies, Factories, and Stable Designs

uch of the debate about implementation in mind focus tives there appears to be a broad the general aptness of on the reuse of class definitions consensus that, in principle at Mclass hierarchies is rooted and polymorphism as made pos- least, in the different objectives taxon- sible by subclassing and inheri- omists and implementers are tance. This has led to an • both a conceptual type and a thought to pursue. Designers of extensive discussion (see [1, 4, 5, class (as a programming con- conceptual hierarchies tend to 8]) as to whether Square should struct) are intensions the exten- embrace Aristotle’s principle of be a subclass of Rectangle or vice sions of which are sets of genus et differentiae leading to a versa, a dilemma that is, of instances; and taxonomic hierarchy of categories course, precedential in character. • the extensions of subtypes are or types [7], while those with Despite the different perspec- subsets of the extensions of

COMMUNICATIONS OF THE ACM April 2000/Vol. 43, No. 4 109

their supertypes, so that the Figure 1. (subclasses are indented, whose creator methods (called instances of a subtype can occur leaf classes underlined). factory methods) return instances wherever instances of its super- a) Female and Male are the only of its concrete subclasses. In the types are expected (principle of subclasses of Person geometrical shape example, substitutability). b) rectangles are either Squares squares and (nonsquare) rectan- or OtherRectangles gles might be created by calls to Depending on the program- factory methods of class Shape as ming language, the latter may not a)Person b)Shape shown in Figure 2. be the case for class hierarchies so Female Rectangle The clients of the hierarchy, that conceptual type hierarchies Male Square cognizant only of class Shape, and class hierarchies are not gen- OtherRectangle will not know or need not care erally isomorphic to each other … about the actual type of the [6]. However, as Grosberg right- instance they get, but neverthe- fully observed [4], the discrepan- less (through dynamic binding) cies can easily be resolved by not Male. Second, OtherRectan- receive all the benefits of the dif- adhering to one simple rule: by gle could, of course, just as well ferent, possibly optimized imple- requiring that only the leaf classes be named NonSquareRectan- mentations of methods for classes can have instances. gle—the point here is there is Square and OtherRectangle, such always a sibling class that holds as the calculation of the area. Abstract Class the remainder otherwise assigned One may object: what if I Hierarchies to the superclass. And third, stretch a square in one dimen- This rule is not as arbitrary as it may seem. In fact, it only para- Figure 2. Calls to a factory class creating instances of phrases a common constraint on the appropriate type. subtyping, namely that the extension of a supertype is totally Shape.rectangle(120,60) // (width, height) covered by the extensions of its // creates a new instance of class OtherRectangle subtypes, thus rendering the Shape.square(80) supertype a mere abstraction. For // creates a new instance of class Square example, applied to the class Shape.rectangle(80,80) hierarchy of Figure 1a, it is // also creates a new instance of class Square implied that all instances of type Person must either be an instance of class Female or of class Male. when creating a particular rec- sion? Does that not imply Following this principle, the tangle, its clients need not see or instance migration? Well, what if Rectangle/Square dilemma is know about (unless they desire I shear a rectangle? Indeed, resolved as shown in Figure 1b), to) the distinction between stretching and shearing should be where OtherRectangle denotes Square and OtherRectangle— viewed and implemented as what the set of rectangles that are not they simply resort to a factory. they actually are: mathematical squares. Surely, this is going to operations that return new affront many system modelers Factories instances. In this light, every and most implementers: why A factory is an object-oriented operator is a small factory waste the name Rectangle for an programming construct provid- method returning a new instance abstract class which cannot have ing for the creation of instances of a class determined solely by instances, and why introduce an without specifying their concrete the operands (including the additional class oddly named classes. Factories come in many implementor) and the operator OtherRectangle which will create different guises, the most com- itself. The same principle natu- most of the instances of Rectan- mon of which have been stereo- rally applies to hierarchies of gle? First, not having class Other- typed in the form of design numbers, collections, and so Rectangle is a bit like having patterns [2, 3]. Here we think of forth, with plenty of opportuni- classes Person and Female, but a factory as an abstract class ties to exploit the efficiency and

110 April 2000/Vol. 43, No. 4 COMMUNICATIONS OF THE ACM

maintainability gains offered by a inheritance) to other classes is not References clean partitioning of the problem generally desired. However, espe- 1. Baclawski, K. and Indurkhya, B. The notion of inheritance in object-oriented program- domain. For instance, depending cially if class hierarchies are big ming. Commun ACM 37, 9 (Sept. 1994), on its operands, the division of and used by many clients, the 118–119. 2. Cooper, J.W. Using design patterns. Com- two integers may return an inte- existence of and consequences for mun ACM 41, 6 (Jun. 1998), 65–68. ger or a (noninteger) fraction. descendant classes are not imme- 3. Gamma, E., Helm, R., Johnson, R. and Vlis- diately realized, making inheri- sides, J. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Stable Designs tance a mixed blessing. By Reading, Mass. 1995. While the practical benefits of designing the class hierarchy as a 4. Grosberg, J.A. Comment on considering ‘class’ harmful. Commun. ACM 36, 1 (Jan. conceptually sound class hierar- hierarchy of abstract classes and 1993), 113–114. chies are still arguable, there is by letting its clients manipulate 5. Halbert, DC. O’Brien, P.D. Using types and another, very pragmatic reason to only the concrete classes attached inheritance in object-oriented programming. IEEE Softw. 4, 5 (May 1987), 71–79. enforce the rule of letting only as leaves, the effect of modifica- 6. LaLonde, WR and Pugh, JR. Subclassing π leaf classes have instances: it pro- tions needing to be made by the subtyping π is-a. J. Object-Oriented Program. tects the rest of the class hierarchy clients is always confined to the (Jan. 1991), 57–62. 7. Sowa, J.F. Conceptual Structures: Information from ad hoc alterations made to instances of single classes. The Processing in Mind an Machine. Addison- individual class definitions. Given need for a (partial) redesign of the Wesley, Reading, Mass., 1984. 8.Winkler, J.F.H. Objectivism: ‘class’ consid- that most of the many changes class hierarchy because of practi- ered harmful. Commun. ACM 35, 8 (Aug. that become necessary in the cal requirements is thus greatly 1992), 128–130. course of system evolution per- reduced. c tain to the behavior of instances Freidrich Steimann (steimann@ of individual classes, the propaga- acm.org) is a research assistant at the Universität tion of these changes (through Hannover, Germany. © 2000 ACM 0002-0782/00/0400 $5.00

COMMUNICATIONS OF THE ACM April 2000/Vol. 43, No. 4 111