| C. Chambers and G. T. Leavens. Typechecking and modules for multimethods. ACM Transactions on Programming Languages and Systems, 17(6):805--843, November 1995. |
....most specific applicable method is selected and invoked. 2.2 Static Type Checking Dubious s static type system ensures that legal programs do not have message not understood or messageambiguous errors. Ruling out these errors involves two kinds of checks: client side and implementation side [Chambers Leavens 95] Client side checks are local checks on declarations and expressions. The most important of these checks relate to invoking and implementing generic functions. For each message send A different object could be named equal in a different scope, so this application expression would invoke a ....
....Unfortunately, applying such a modular typechecking scheme to the unrestricted Dubious language is unsound. It is possible for two importers of a module to pass these checks in isolation but still cause message not understood or message ambiguous errors when combined in a single program [Chambers Leavens 95] Subsection 4.1 describes the situations that can lead to such errors. Subsections 4.2, 4.3, and 4.4 describe three different sets of restrictions that support safe modular typechecking, representing different tradeoffs between expressiveness, modularity, and complexity. Subsection 4.5 ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....on Fickle 99 from Walt Hill, Viviana Bono, Luca Cardelli, Andrew Kennedy, Giorgio Ghelli, and anonymous POPL 00 reviewers. Ross Jarman, and the anonymous FOOL 01 referees gave useful feedback on our current work. 6 Restrictions on possible subclasses can be found in several systems, e.g. in [6]. 12 P c 3s R(P; c) R(P; this) P; this c : c [ c [ f R(P; c) g P; e 0 : c [ c 0 [ 0 P; this7 c0 ] e 1 : t 0 1 [ c 1 [ 1 M(P; 1 Pc; m) t m( t 1 x) f : g P t 0 1 t 1 P; e 0 :m( e 1 ) t [ Pc 1 [ 0 [ 1 P 3 P; true : bool [ this) ....
C. Chambers and G. Leavens. Type Checking Modules for Multimethods. ACM Transactions on Programming Languages and Systems, 17(6):805-843, 1995.
....used synonyms for subtyping are specification inheritance or interface inheritance. A class, on the other hand, defines the implementation of a set of objects [Mad95, OODBTG91] Thus, as a type defines the interface of a set of objects, we can say that a class implements the type (or interface) [ChLe95, Mad95, OODBTG91, UML97]. For a given type there may be many different implementations, whereas a subclass of a given class does not necessarily define a subtype of the type implemented by the class. Thus, in order to be able to talk about both type inheritance and class inheritance, implementation and interface should ....
Chambers, C., Leavens, G.T., Typechecking and Modules for Multimethods. ACM Transactions on Programming Languages and Systems, Vol. 17, No. 6 (Nov) 1995, pp.805-843.
.... i ; update y(p) j ; p has init method (p:Point, i:int, j:any) update x(p) i ; update y(p) j ; p object myPoint inherits Point x(init(myPoint, 1,2) Figure 2 3: An example that will generate method ambiguous error. 10 These errors are considered type errors in TSTBC [Chambers Leavens 95] Since there is no static type system implemented for TSTBC, these errors are caught dynamically. Designing a type system to prevent such type errors statically in TSTBC is future work. 2.4 Programming Instance Variables Instance variables of an object are also handled as methods that ....
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....languages, such as Oberon 2, Ada 95, and Modula 3, modules are not extensible, while classes are represented by means of extensible record types [3] The difference in our approach to classes is that class extension overrides an existing class and does not introduce a new type. The Cecil language [4] supports a form of module import called module extension. In Cecil extended modules are shared and are, in fact, similar to imported modules. Cecil modules allow standard subtyping while our extensible modules allow type redefinition. It has been recognized [2] that both modules and classes ....
C. Chambers and G. Leavens, Type checking and Modules for Multimethods, ACM Transactions on Programming Languages and Systems, 17 (1995), 805-843.
....Paris, France, January 1997. ACM. Program Fragments, Linking, and Modularization Luca Cardelli luca pa.dec.com Digital Equipment Corporation, Systems Research Center 2 Thursday, October 24, 1996, 11:36 am bal analysis and may thus conflict with modularity; examples are multimethods [7] and overloading. Day 2: User program description. A user interface I Usr is written without yet producing the corresponding user module M Usr . The purpose is to begin designing the structure of M Usr and its interaction with I Lib before making any actual implementation commitments. The ....
Chambers, C. and G.T. Leavens, Typechecking and modules for multi-methods. ACM Transactions on Programming Languages and Systems 17(6), 805-843. 1995.
....the text. 2. 1 Monomorphic Host Language This subsection provides background by describing the monomorphic core of Mini Cecil ignoring its polymorphic features; a version of this monomorphic language and the issues involved in typechecking it have been discussed previously [Chambers Leavens 94, Chambers Leavens 95] A Mini Cecil program is a collection of declarations followed by an expression to evaluate. The class c declaration introduces a new class named c which may be instantiated at run time by new expressions; abstract classes are marked with the abstract keyword and may not be instantiated. The ....
....upon the message send m(c 1 , c n ) that method s arguments are supertypes of T 1 , T n, and its result type is a subtype of T r . 5 (An efficient algorithm to achieve the effect of this enumeration based specification has been described previously [Chambers Leavens 94, Chambers Leavens 95] Client side typechecking and implementation side typechecking together assure the overall type safety of the program. 5 The general rule states that for polymorphic signatures, where T i may be a type variable, all legal instantiations (defined below) must be properly implemented. 6 2.3 ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(9), November 1995.
....it implicitly conforms to Point as well. So colorPoint can be sent to the x, y, and equal generic functions as well as to the color generic function. The type checking rules which are used to statically guarantee type safety can be divided into client side and implementation side checks [Chambers Leavens 95] We now discuss each of these in turn. 3.1.2 Client sideType checking Client side checking ensures that clients respect the types of the objects which they manipulate. In particular, we say that a tuple of objects (E 1 , E n ) conforms to a tuple of types (T 1 , T n ) if each E i ....
....usefully inherited from, or the two objects and their associated generic functions must be defined in a single module. This is an unacceptable restriction, as it forces entire hierarchies of objects into a single module. 18 In order to alleviate some of this inflexibility, Chambers and Leavens [Chambers Leavens 95] introduced the notion of an extension module. Their informal idea was that a module can extend another as an alternative to importing. The extending module, unlike an ordinary importer, is considered to be in the same contour as the extendee for type checking purposes. Our solution adopts and ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....Similarly, early object oriented languages, such as Simula 67 [9] and Smalltalk [16] provide no module system. In contrast, languages such as Ada 95 [20] Common Lisp [42] Dylan [41] Haskell [19] Java [17] and Modula 3 [18] provide both modules and classes. For Cecil [4] Chambers and Leavens [5] designed a module system specifically to complement a class system with multi methods. Unfortunately, these module and class systems do not support external connections a central principle of our design that is crucial to software engineering (see Section 5) Scheme [6] provides no specific ....
Chambers, C. and G. T. Leavens. Typechecking and modules for multi-methods. ACM Transactions on Programming Languages and Systems, 17(6):805--843, November 1995.
....or classless object. We suggest 60 performing dynamic dispatching on all parameters with a concrete type, such as class references or class pointers. Unlike static overloading resolution, dispatching is performed at run time, although multimethods can be statically type checked [Rou90, CGL92, CL95a] By combining multimethods and packages, we can simplify the abstract syntax tree example by bundling the visitation methods for each tree operation in a package. object TypeChecker public: void Visit (AssignmentNode n) Visit (n.LHS ( Visit (n.RHS ( void Visit ....
....an explicit subtype hierarchy is no longer available at compile time (see Sections 3.1 and 3. 2) Therefore, determining statically whether a multimethod is defined for all parameter type combinations is slightly more complicated than in systems with an explicit subtype hierarchy such as Cecil [CL95a] and would require global static analysis or linker support. e.g. the necessary information could be collected by the linker from the compiler generated method dispatch tables. To maintain an object oriented or data abstraction oriented view of multimethods, we could conceptually consider a ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary T. Leavens. Typechecking and modules for multimethods. ACM Transactions on Programming Languages and Systems, 17(6):805--843, November 1995.
....affect the core of our discussion. For more details on receiver types, see [Cas95a] 3 Multi methods Our solution for making covariant specialization type safe uses multi methods. Multimethods appear in the CLOS language [DG87] and their typing issues have been studied in [ADL91, CGL95, Cas96, CL95] However, none of these approaches can be directly applied to the case of O 2 , since they do not retain the notion of method encapsulation: there is no privileged receiver as in O 2 to which a message is sent. Thus in this article, we utilize a different kind of multi methods, those ....
C. Chambers and G. Leavens. Typechecking and modules for multi-methods. ACM Transactions on Programming Languages and Systems, 17(6):805--843, Nov. 1995.
....and incremental modification (and subsequent incremental re typechecking) of code. The checks that must be delayed to link time in ML# constitute what we call implementation side typechecking (ITC) which ensures that each function in the program is completely and unambiguously implemented [7]. In traditional functional languages, ITC checks each function for match nonexhaustive and match redundant errors. Each function can be checked modularly, since a function declaration includes all of its cases and datatypes are not extensible. In traditional OO languages, ITC checks that each ....
C. Chambers and G. T. Leavens. Typechecking and modules for multimethods. ACM Transactions on Programming Languages and Systems, 17(6):805--843, Nov. 1995.
....is either an abstract object or an arrow type. We say that an object o conforms to a type t if either o inherits from t or o has an arrow type that is a subtype of t. Ruling out message not understood and message ambiguous errors involves two kinds of checks: client side and implementation side [Chambers Leavens 95] Client side checks are local checks on declarations and expressions. The most important client side check is that for each message send expression E(E 1 , E n ) in the program, E conforms to an arrow type (T 1 , T n )T and each E i conforms to T i . The message send is then given the type ....
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....(T 1 , T n ) when each T i is a subtype of T i . Because of the multiple dispatching involved, type checking messages sent to tuples is a bit more complex than checking messages sent to instances. We divide the additions to SDCore s type system into client side and implementation side rules [Chambers Leavens 95] The client side rules check messages sent to tuples, while the implementation side rules check tuple class declarations and their methods. The aim of these rules is to ensure statically that at run time no type mismatches occur and that no message not understood or message ambiguous error will ....
....an appropriate method implementation. The problem is that there exist two such tuple classes, and neither is a subtype of the other. Therefore, at run time such a method invocation will cause a method ambiguous error to occur. Our solution is based on prior work on type checking for multimethods [Chambers Leavens 95] Declaration sequences are allowed to be mutually recursive in Tuple. When all declarations have been seen, Tuple checks that, for each message defined in a tuple class, any legal tuple sent that message will have a single most specific method implementation to invoke. Conceptually, we ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....languages with single dispatched methods, languages with multimethods have received little theoretical attention. Work on the l calculus [Ghelli 91, Castagna et al. 92, Castagna et al. 95, Castagna 95b] and other languages [Rouaix 90, Agrawal et al. 91, Mugridge et al. 91, Chambers Leavens 94, Chambers Leavens 95] has given some basic ideas for type systems and type checking algorithms. Although CLOS [Steele 90, Paepcke 93] and Dylan [Shalit 97, Feinberg 97] are multimethod languages with module systems, their module systems, which have received little theoretical attention, either permit encapsulation ....
....type expressions. 3. 2 Brief Overview A type error in BeCecil occurs when a program applies a generic function to a tuple of actual arguments, and the generic function either has no case that is applicable to the actuals, or has more than one applicable case, but not a unique, most specific one [Chambers Leavens 95] If the first kind of error ( message not understood ) can occur, the generic function is incomplete. If the second kind of error ( message ambiguous ) can occur, the generic function is inconsistent. The BeCecil type system is designed to statically prevent such type errors. The philosophy ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....those challenges. 4.1 Overall Approach The MultiJava type system ensures statically that no message notunderstood or message ambiguous errors can occur at run time. Ruling out these errors involves complementary client side checking of message sends and implementation side checking of methods [Chambers Leavens 95] We begin by describing what we mean by modular typechecking, and then discuss the two kinds of checks. 4.1.1 Modular Typechecking Modular typechecking requires that each compilation unit can be successfully typechecked only considering static type information from the compilation units that ....
....the intersect method in class Shape is the most specific applicable method for the other three tuples. Conceptually, this checking involves an enumeration of all combinations of visible legal argument tuples, but more efficient algorithms exist that only check the interesting subset of tuples [Chambers Leavens 95, Castagna 97] 4.2 Restrictions for Modular Type Safety Unfortunately, the typechecking approach described above can miss message not understood or message ambiguous errors that may occur at run time, caused by interactions between unrelated compilation units [Millstein Chambers 99] In the ....
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....i T i1 or : or v i Tim , where the T ij are the top concrete subclasses of T i . If inheritance and subtyping are separate notions, then the predicates become more complex. Our typechecking need not test that methods conform to signatures, unlike previous work on typechecking multimethods [CL95] In predicate dispatching, a method s formal argument has two distinct types: the external type derived from the signature declaration, and the possibly finer internal type guaranteed by successful evaluation of the method s predicate. The individual tests narrow the type of the tested ....
....efficient method lookup algorithms and separate typechecking, which depend crucially on the absence of any separate modules that dispatch on other argument positions. Multiplydispatched object oriented languages have more challenging problems in implementation [KR89,CTK94,AGS94] and typechecking [CL95] and predicate dispatching in its unrestricted form shares these challenges. Predicate classes [Cha93b] are an earlier extension of object oriented dispatching to include arbitrary boolean predicates. A predicate class which inherits from class A and has an associated predicate expression guard ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary T. Leavens. Typechecking and modules for multi-methods. ACM Transactions on Programming Languages and Systems, 17(6):805--843, November 1995.
....entities other than variables. The following subsection provides background by describing the monomorphic core of Mini Cecil ignoring these polymorphic features; a version of this monomorphic language and the issues involved in typechecking it have been discussed previously [Chambers Leavens 94, Chambers Leavens 95] Later subsections reintroduce the polymorphic features. 2.1 Monomorphic Host Language A Mini Cecil program is a collection of (mutually recursive, unordered) declarations followed by an expression to evaluate. Classes and types are independent notions in Mini Cecil, and different aspects of a ....
....class conforms to the corresponding declared formal type T i , and that the method s result type T r is a subtype of the signature s result type T r . An efficient algorithm to achieve the effect of this enumeration based specification has been described previously [Chambers Leavens 94, Chambers Leavens 95] If these tests succeed, then the type interface is known to be completely and unambiguously implemented. If client side typechecking also succeeds, overall type safety of the program is assured. 2.2 Polymorphic Declarations To support parametric polymorphism, any global declaration (other ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(9), November 1995. 26
....of T i . Because of the multiple dispatching involved, type checking messages sent to tuples is a bit more complex than checking messages sent to instances (see Appendix B for the formal typing rules) We divide the additions to SDCore s type system into client side and implementation side rules [Chambers Leavens 95] The client side rules check messages sent to tuples, while the implementation side rules check tuple class declarations and their methods. The aim of these rules is to ensure statically that at run time no type mismatches occur and that no message not understood or message ambiguous error will ....
....may have message ambiguous errors, since a message sent to a tuple of two ColorPoint instances will not be able to find a unique most specific method. Therefore, a link time check is necessary to ensure type safety. Research is underway to resolve this problem for generic function languages [Chambers Leavens 95] which would also resolve it for Tuple. However, to date no completely satisfactory solution has emerged. The design choices of encapsulated and parasitic multimethods were largely motivated by the goal of avoiding this loss of modularity. Encapsulated multimethods do not suffer from this ....
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....languages with single dispatched methods, languages with multimethods have received little theoretical attention. Work on the l calculus [Ghelli 91, Castagna et al. 92, Castagna et al. 95, Castagna 95b] and other languages [Rouaix 90, Agrawal et al. 91, Mugridge et al. 91, Chambers Leavens 94, Chambers Leavens 95] has given some basic ideas for type systems and type checking algorithms. Although CLOS [Steele 90, Paepcke 93] and Dylan [Shalit 97, Feinberg 97] are multimethod languages with module systems, their module systems, which have received little theoretical attention, either permit encapsulation ....
....type expressions. 3. 2 Brief Overview A type error in BeCecil occurs when a program applies a generic function to a tuple of actual arguments, and the generic function either has no case that is applicable to the actuals, or has more than one applicable case, but not a unique, most specific one [Chambers Leavens 95] If the first kind of error ( message not understood ) can occur, the generic function is incomplete. If the second kind of error ( message ambiguous ) can occur, the generic function is inconsistent. The BeCecil type system is designed to statically prevent such type errors. The philosophy ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
....have type ColorPoint, allowing the method body to safely send them the color message. Dubious s static type system ensures that legal programs do not have message not understood and messageambiguous errors. Ruling out these errors involves two kinds of checks: client side and implementation side [Chambers Leavens 95] Client side checks are the normal checks on individual declarations and 5 Modular Statically Typed Multimethods expressions. The most important client side check is that for each message send expression E(E 1 , E n )in the program, E conforms to an arrow type (T 1 , T n ) T and ....
....method in o. Further, each o i must conform to the type on the ith argument position of that method, and the method s return type must be a subtype of T. Earlier work described a more efficient algorithm for implementation side checking than this brute force argument tuple enumeration [Chambers Leavens 95] For example, consider implementation side checks on the equal generic function. equal is declared to conform to (Point, Point) Bool. Nine argument tuples pointwise conform to (Point, Point) all possible pairs of the objects point, colorPoint, and origin. The (colorPoint colorPoint) method ....
[Article contains additional citation context not shown here]
Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805-843. November, 1995.
No context found.
C. Chambers and G. T. Leavens. Typechecking and modules for multimethods. ACM Transactions on Programming Languages and Systems, 17(6):805--843, November 1995.
No context found.
Craig Chambers and Gary T. Leavens. Typechecking and modules for multimethods. ACM Transactions on Programming Languages and Systems, 17(6):805--843, November 1995.
No context found.
Chambers, C. and G.T. Leavens, Typechecking and modules for multi-methods. ACM Transactions on Programming Languages and Systems 17(6), 805-843. 1995.
No context found.
C. Chambers and G. Leavens. Typechecking and Modules for Multimethods, ACM Transactions on Programming Languages and Systems, 17, No 6, 1995, 805-843.
No context found.
C. Chambers and G. Leavens. Type Checking Modules for Multimethods. ACM Transactions on Programming Languages and Systems, 17(6):805-843, 1995.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC