Professional Documents
Culture Documents
Essay PDF
Essay PDF
William R. Cook
University of Texas at Austin
wcook@cs.utexas.edu
Figure 7. Object-oriented integer set interface Insert(s, n) = if s.contains(n) then s else µ this. {
isEmpty = false,
contains = λi. (i = n or s.contains(i))
insert = λi. Insert(this, i)
union = λs. Union(this, s)
concepts do not apply in this case. One might say that }
this approach represents sets as functions from integers to
booleans. But this ‘representation’ looks like an interface, Union(s1 , s2 ) = µ this. {
not a concrete representation. isEmpty = s1 .isEmpty and s2 .isEmpty,
Note that there is no “contains” operation, because the contains = λi. s1 .contains(i) or s2 .contains(i)
set itself is the contains operation. Although it may not seem insert = λi. Insert(this, i)
like it, the characteristic function is the pure object-oriented union = λs. Union(this, s)
approach to defining integer sets. You may not accept this }
statement immediately, because I have not talked about any
classes, methods, or inheritance, which are supposed to be
characteristic of objects.
Figure 8. Object-oriented integer set implementations
[21] J. Gosling, B. Joy, G. Steele, and G. Bracha. Java(TM) [40] B. Mahr and J. Makowsky. An axiomatic approach to
Language Specification. Addison-Wesley Professional, 2005. semantics of specification languages. In Proceedings of the
6th Conference on Theoretical Computer Science, volume
[22] D. N. Gray, J. Hotchkiss, S. LaForge, A. Shalit, and 145 of Lecture Notes in Computer Science, pages 211–219.
T. Weinberg. Modern languages and Microsoft’s Component Springer-Verlag, 1983.
Object Model. Commun. ACM, 41(5):55–65, 1998.
[41] R. Milner. Communication and Concurrency. Prentice-Hall,
[23] C. A. Gunter and J. C. Mitchell, editors. Theoretical 1989.
aspects of object-oriented programming: types, semantics,
and language design. MIT Press, 1994. [42] R. Milner, M. Tofte, and R. Harper. The definition of Standard
ML. MIT Press, 1990.
[24] J. Guttag. The Specification and Application to Programming
of Abstract Data Types. Report, University of Toronto, [43] J. C. Mitchell. Concepts in Programming Languages.
Computer Science Department, 1975. Cambridge University Press, 2001.
[25] C. Hewitt, P. Bishop, I. Greif, B. Smith, T. Matson, and [44] J. C. Mitchell and G. D. Plotkin. Abstract types have
R. Steiger. Actor induction and meta-evaluation. In POPL existential type. In Proceedings of the ACM Symp. on
’73: Proceedings of the 1st annual ACM SIGACT-SIGPLAN Principles of Programming Languages. ACM, 1985.
symposium on Principles of programming languages, pages [45] P. Müller, A. Poetzsch-Heffter, and G. T. Leavens. Modular
153–168. ACM, 1973. invariants for layered object structures. Sci. Comput.
[26] C. A. R. Hoare. Proof of correctness of data representation. Program., 62(3):253–286, 2006.
Acta Informatica, 1:271–281, 1972. [46] D. A. Naumann. Observational purity and encapsulation.
[27] J. Hogg, D. Lea, A. Wills, D. deChampeaux, and R. Holt. Theor. Comput. Sci., 376(3):205–224, 2007.
The Geneva convention on the treatment of object aliasing. [47] M. Odersky, L. Spoon, and B. Venners. Programming in
SIGPLAN OOPS Messenger, 3(2):11–16, 1992. Scala: A Comprehensive Step-by-step Guide. Artima Inc,
[28] D. Ingalls. The Smalltalk-76 programming system. In POPL, 2008.
pages 9–16, 1978. [48] M. Odersky and M. Zenger. Independently extensible solu-
[29] B. Jacobs. Objects and classes, co-algebraically. In Object tions to the expression problem. In Proceedings FOOL 12,
orientation with parallelism and persistence, pages 83–103. 2005. http://homepages.inf.ed.ac.uk/wadler/fool.
1996. [49] U. S. D. of Defense. Reference manual for the Ada
[30] S. P. Jones. Haskell 98 Language and Libraries: The Revised programming language. ANSI/MIL-STD-1815 A, 1983.
[50] B. C. Pierce. Types and Programming Languages. MIT
Press, 2002.
[51] T. W. Pratt and M. V. Zelkowitz. Programming languages:
design and implementation. Prentice-Hall, 1995.
[52] J. C. Reynolds. User-defined types and procedural data
structures as complementary approaches to data abstraction.
In New Advances in Algorithmic Languages, pages 157–168.
INRIA, 1975.
[53] M. L. Scott. Programming Language Pragmatics. Morgan
Kaufmann, 2000.
[54] R. Sebesta. Concepts of Programming Languages, Eighth
Edition. Addison-Wesley, 2007.
[55] J. F. Shoch. An overview of the programming language
Smalltalk-72. SIGPLAN Notices, 14(9):64–73, 1979.
[56] G. Steele. LAMBDA: The ultimate declarative. Technical
Report AIM-379, MIT AI LAB, 1976.
[57] A. B. Tucker and R. E. Noonan. Programming Languages:
Principles and Paradigms, Second Edition. McGraw-Hill
Higher Education, 2007.
[58] P. Wadler. The expression problem. Mail to the java-
genericity mailing list, 1998.
[59] P. Wadler and S. Blott. How to make ad-hoc polymorphism
less ad hoc. In POPL ’89: Proceedings of the 16th ACM
SIGPLAN-SIGACT symposium on Principles of programming
languages, pages 60–76. ACM, 1989.
[60] N. Wirth. Programming in Modula-2. Springer-Verlag, 1983.
[61] W. A. Wulf, R. L. London, and M. Shaw. An introduction to
the construction and verification of Alphard programs. IEEE
Transactions on Software Engineering, SE-24(4), 1976.
[62] S. N. Zilles. Procedural encapsulation: A linguistic protection
mechanism. SIGPLAN Notices, 8(9):142–146, 1973.