ACM Home Page
Please provide us with feedback. Feedback
Practical predicate dispatch
Full text PdfPdf (192 KB)
Source Conference on Object Oriented Programming Systems Languages and Applications archive
Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications table of contents
Vancouver, BC, Canada
SESSION: Languages table of contents
Pages: 345 - 364  
Year of Publication: 2004
ISBN:1-58113-831-9
Also published in ...
Author
Todd Millstein  University of California - Los Angeles, Los Angeles, CA
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
SIGSOFT: ACM Special Interest Group on Software Engineering
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 8,   Downloads (12 Months): 64,   Citation Count: 17
Additional Information:

abstract   references   cited by   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/1028976.1029006
What is a DOI?

ABSTRACT

<i>Predicate dispatch</i> 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 its utility in practice.

We introduce JPred, a backward-compatible extension to Java supporting predicate dispatch. While prior languages with predicate dispatch have been extensions to toy or non-mainstream 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 type-checking 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 and type system, we present a case study illustrating the utility of JPred in a real-world application, 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
M. G. Assaad and G. T. Leavens. Alias-free parameters in C for better reasoning and optimization. Technical Report 01-11, Department of Computer Science, Iowa State University, Ames, Iowa, Nov. 2001.
 
5
C. Barrett. Personal communication, Mar. 2004.
6
 
7
D. Blei, C. Harrelson, R. Jhala, R. Majumdar, G. C. Necula, S. P. Rahul, W. Weimer, and D. Weitz. Vampyre: A Proof Generating Theorem Prover. http://www.cs.ucla.edu/~rupak/Vampyre.
8
 
9
10
 
11
 
12
 
13
C. Chambers. The Cecil language specification and rationale: Version 2.1. www.cs.washington.edu/research/projects/cecil/pubs/cecil-spec.html, Mar. 1997.
14
 
15
C. Clifton. MultiJava: Design, implementation, and evaluation of a Java-compatible language supporting modular open classes and symmetric multiple dispatch. Technical Report 01-10, Department of Computer Science, Iowa State University, Ames, Iowa, Nov. 2001.
16
 
17
CVC Lite home page. http://verify.stanford.edu/CVCL.
 
18
D. Detlefs, G. Nelson, and J. B. Saxe. Simplify: A theorem prover for program checking. Technical Report HPL-2003-148, HP Labs, 2003.
 
19
 
20
21
 
22
C. Flanagan, R. Joshi, X. Ou, and J. B. Saxe. Theorem proving using lazy proof explication. In CAV: International Conference on Computer Aided Verification, Boulder, Colorado, USA, July 2003.
23
24
 
25
 
26
V. Gapeyev and B. C. Pierce. Regular object types. In Proceedings of the 2003 European Conference on Object-Oriented Programming, LNCS 2743, Darmstadt, Germany, July 2003. Springer-Verlag.
27
 
28
 
29
30
 
31
J. G. Hosking, J. Hamer, and W. Mugridge. Integrating functional and object-oriented programming. In Proceedings of the 1990 TOOLS Pacific, pages 345--355, 1990.
32
 
33
G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-oriented programming. In M. Aksoit and S. Matsuoka, editors, ECOOP '97 - Object-Oriented Programming 11th European Conference, Jyväskylä, Finland, LNCS 1241, pages 220--242. Springer-Verlag, New York, NY, June 1997.
 
34
G. T. Leavens and O. Antropova. ACL -Eliminating parameter aliasing with dynamic dispatch. Technical Report 98-08a, Department of Computer Science, Iowa State University, Ames, Iowa, Feb. 1999.
35
 
36
 
37
38
 
39
T. Millstein and C. Chambers. Modular statically typed multimethods. Information and Computation, 175(1):76--118, May 2002.
 
40
41
 
42
MzScheme home page. http://www.plt-scheme.org/software/mzscheme.
43
 
44
N. Nystrom, M. R. Clarkson, and A. C. Myers. Polyglot: An extensible compiler framework for Java. In Proceedings of CC 2003: 12'th International Conference on Compiler Construction. Springer-Verlag, Apr. 2003.
 
45
OCaml home page. http://www.ocaml.org.
 
46
one.world home page. http://cs.nyu.edu/rgrimm/one.world.
47
 
48
V. S. Pai, P. Druschel, and W. Zwaenepoel. Flash: An efficient and portable web server. In Proceedings of the 1999 USENIX Annual Technical Conference (USENIX-99), pages 199--212, Berkeley, CA, June 6-11 1999. USENIX Association.
 
49
 
50
The Scala language home page. http://lamp.epfl.ch/~odersky/scala.
 
51
 
52
 
53
 
54
A. M. Ucko. Predicate Dispatching in the Common Lisp Object System. Technical Report 2001-006, MIT Artificial Intelligence Laboratory, June 2001.
55
56

CITED BY  17