ACM Home Page
Please provide us with feedback. Feedback
Expressive and modular predicate dispatch for Java
Full text PdfPdf (1.16 MB)
Source
ACM Transactions on Programming Languages and Systems (TOPLAS) archive
Volume 31 ,  Issue 2  (February 2009) table of contents
Article No. 7  
Year of Publication: 2009
ISSN:0164-0925
Authors
Todd Millstein  University of California, Los Angeles, Los Angeles, CA
Christopher Frost  University of California, Los Angeles, Los Angeles, CA
Jason Ryder  University of California, Los Angeles, Los Angeles, CA
Alessandro Warth  University of California, Los Angeles, Los Angeles, CA
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 16,   Downloads (12 Months): 178,   Citation Count: 0
Additional Information:

abstract   references   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1462166.1462168
What is a DOI?

ABSTRACT

Predicate dispatch is an object-oriented (OO) language mechanism for determining the method implementation to be invoked upon a message send. With predicate dispatch, each method implementation includes a predicate guard specifying the conditions under which the method should be invoked, and logical implication of predicates determines the method overriding relation. Predicate dispatch naturally unifies and generalizes several common forms of dynamic dispatch, including traditional OO dispatch, multimethod dispatch, and functional-style pattern matching. Unfortunately, prior languages supporting predicate dispatch have had several deficiencies that limit the practical utility of this language feature.

We describe JPred, a backward-compatible extension to Java supporting predicate dispatch. While prior languages with predicate dispatch have been extensions to toy or nonmainstream languages, we show how predicate dispatch can be naturally added to a traditional OO language. While prior languages with predicate dispatch have required the whole program to be available for typechecking and compilation, JPred retains Java's modular typechecking and compilation strategies. While prior languages with predicate dispatch have included special-purpose algorithms for reasoning about predicates, JPred employs general-purpose, off-the-shelf decision procedures. As a result, JPred's type system is more flexible, allowing several useful programming idioms that are spuriously rejected by those other languages. After describing the JPred language informally, we present an extension to Featherweight Java that formalizes the language and its modular type system, which we have proven sound. Finally, we discuss two case studies that illustrate the practical utility of JPred, including its use in the detection of several errors.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
2
 
3
 
4
Assaad, M. G. and Leavens, G. T. 2001. Alias-Free parameters in C for better reasoning and optimization. Tech. Rep. 01-11, Department of Computer Science, Iowa State University, Ames, Iowa. November.
 
5
Barrett, C. and Berezin, S. 2004. CVC Lite: A new implementation of the cooperating validity checker. In Proceedings of the 16th International Conference on Computer Aided Verification (CAV'04), R. Alur and D. A. Peled, Eds. Lecture Notes in Computer Science, vol. 3114. Springer, 515--518.
 
6
Baumgartner, G., Jansche, M., and Laufer, K. revised March 2002. Half & Half: Multiple dispatch and retroactive abstraction for Java. Tech. rep. OSU-CISRC-5/01-TR08, Department of Computer and Information Science, The Ohio State University.
7
8
9
 
10
Bray, T., Paoli, J., Sperberg-McQueen, C. M., Maler, E., and Yergeau, F. 2006. eXtensible markup language (XML) 1.0 (4th Edition). World Wide Web Consortium recommendation, http://www.w3.org/TR/REC-xml.
11
 
12
 
13
 
14
 
15
 
16
Chambers, C. 1997. The Cecil language specification and rationale: Version 2.1. www.cs.washington.edu/research/projects/cecil/pubs/cecil-spec.html.
17
 
18
Clifton, C. 2001. MultiJava: Design, implementation, and evaluation of a Java-compatible language supporting modular open classes and symmetric multiple dispatch. Tech. rep. 01-10, Department of Computer Science, Iowa State University, Ames, Iowa. November.
19
20
 
21
CVC3. 2009. The CVC3 home page. http://www.cs.nyu.edu/acsys/cvc3.
22
 
23
Eclipse. 2007. Eclipse home page. http://www.eclipse.org.
 
24
Emir, B., Odersky, M., and Williams, J. 2007. Matching objects with patterns. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), E. Ernst, Ed. Lecture Notes in Computer Science, vol. 4609. Springer, 273--298.
 
25
 
26
Flanagan, C., Joshi, R., Ou, X., and Saxe, J. B. 2003. Theorem proving using lazy proof explication. In the International Conference on Computer Aided Verification (CAV).
 
27
Frost, C. and Millstein, T. 2005. Featherweight JPred. Tech. rep. CSD-TR-050038, UCLA Computer Science Department. ftp://ftp.cs.ucla.edu/tech-report/2005-reports/050038.pdf.
 
28
Frost, C. and Millstein, T. 2006. Modularly typesafe interface dispatch in JPred. In the International Workshop on Foundations and Developments of Object-Oriented Languages(FOOL/WOOD).
29
 
30
 
31
Gapeyev, V. and Pierce, B. C. 2003. Regular object types. In Proceedings of the European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, vol. 2743. Springer.
32
 
33
 
34
35
36
 
37
Hosking, J. G., Hamer, J., and Mugridge, W. 1990. Integrating functional and object-oriented programming. In Proceedings of the International Conference on Technology of Obeject-Oriented Languages and Systems TOOLS Pacific, 345--355.
38
39
 
40
Kiczales, G., Lamping, J., Menhdhekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., and Irwin, J. 1997. Aspect-Oriented programming. In Proceedings of the 11th European Conference on Object-Oriented (ECOOP'97), M. Akşit and S. Matsuoka, Eds. Lecture Notes on Computer Science, vol. 1241. Springer, 220--242.
 
41
Leavens, G. T. and Antropova, O. 1999. ACL — Eliminating parameter aliasing with dynamic dispatch. Tech. rep. 98-08a, Department of Computer Science, Iowa State University, Ames, Iowa. February.
42
 
43
 
44
45
46
47
 
48
Millstein, T. and Chambers, C. 2002. Modular statically typed multimethods. Inf. Comput. 175, 1, 76--118.
 
49
50
51
 
52
Nystrom, N., Clarkson, M. R., and Myers, A. C. 2003. Polyglot: An extensible compiler framework for Java. In Proceedings of the 12th International Conference on Compiler Construction (CC). Springer.
 
53
oneworld. 2008. one.world home page. http://cs.nyu.edu/rgrimm/one.world.
54
 
55
 
56
Polyglot for Java 5. Polyglot for Java 5 homepage. http://www.cs.ucla.edu/~milanst/projects/polyglot5.
 
57
 
58
Richard, A. and Lhotak, O. 2008. OOMatch: Pattern matching as dispatch in Java. In International Workshop on Foundations of Object-Oriented Languages.
 
59
Salcianu, A. and Rinard, M. 2005. Purity and side effect analysis for Java programs. In Proceedings of the 6th International Conference on Verification, Model Checking and Abstract Interpretation.
 
60
 
61
 
62
Ucko, A. M. 2001. Predicate dispatching in the common lisp object system. Tech. rep. 2001-006, MIT Artificial Intelligence Laboratory.
63
 
64

Collaborative Colleagues:
Todd Millstein: colleagues
Christopher Frost: colleagues
Jason Ryder: colleagues
Alessandro Warth: colleagues