×

On an algorithm determining direct superclasses in Java and similar languages with inner classes-its correctness, completeness and uniqueness of solutions. (English) Zbl 1166.68313

Summary: Some object oriented programming languages allow inner classes. All of them admit inheritance. This combination of inner classes and inheritance is very fruitful however less known. On the other hand it creates a serious problem: how to determine the direct superclass of a given class C, i.e. the class which class C directly inherits from. For there may be several classes of the same name in one program. A specification of the problem and a non-deterministic algorithm are provided. We prove that the algorithm is correct w.r.t. the specification and complete, i.e. if the algorithm signals an error then no solution exists. We show that the specification itself has at most one solution, in other words, it is a complete specification. This proves also that the corresponding parts of Java Language Specification are consistent and define uniquely a fragment of Java semantics.

MSC:

68N19 Other programming paradigms (object-oriented, sequential, concurrent, automatic, etc.)
68W05 Nonnumerical algorithms

Software:

BETA; LOGLAN; Simula 67
Full Text: DOI

References:

[1] Abadi, M.; Cardelli, L., A Theory of Objects (1996), Springer: Springer New York · Zbl 0876.68014
[2] W.M. Bartol et al., The Report on the Loglan’82 Programming Language, PWN, Warszawa, 1984.; W.M. Bartol et al., The Report on the Loglan’82 Programming Language, PWN, Warszawa, 1984.
[3] O.L. Madsen, B. Moeller-Pedersen, K. Nygaard, Object Oriented Programming in the BETA Programming Language, Addison Wesley/ACM Press, 1993 see also Beta Programming Language, 2001. Available from: <http://www.daimi.au.dk/ ; O.L. Madsen, B. Moeller-Pedersen, K. Nygaard, Object Oriented Programming in the BETA Programming Language, Addison Wesley/ACM Press, 1993 see also Beta Programming Language, 2001. Available from: <http://www.daimi.au.dk/ 
[4] Dijkstra, E. W., Recursive programming, Numerische Mathematik, 2, 312-318 (1960) · Zbl 0093.13911
[5] Bartol, W. M.; Kreczmar, A.; Litwiniuk, A. I.; Oktaba, H., Semantics and implementation of prefixing on many levels, (Salwicki, A., Proceedings Logics of Programs and Their Applications, LNCS, vol. 148 (1983), Springer: Springer Berlin) · Zbl 0506.68018
[6] M. Krause, A. Kreczmar, H. Langmaack, A. Salwicki, Specification and Implementation Problems of Programming Languages Proper for Hierarchical Data Types, Bericht No. 8410, Institut für Informatik, Christian-Albrechts-Universität, Kiel, 1984.; M. Krause, A. Kreczmar, H. Langmaack, A. Salwicki, Specification and Implementation Problems of Programming Languages Proper for Hierarchical Data Types, Bericht No. 8410, Institut für Informatik, Christian-Albrechts-Universität, Kiel, 1984.
[7] Krause, M.; Kreczmar, A.; Langmaack, H.; Warpechowski, M., Concatenation of program modules an algebraic approach to the semantics and implementation problems, (Skowron, A., Proceedings Computation Theory, LNCS, vol. 208 (1986), Springer: Springer Berlin), 134-156 · Zbl 0585.68017
[8] (Cioni, G.; Salwicki, A., Object Oriented Programming (1987), Academic Press: Academic Press London)
[9] Kreczmar, A.; Salwicki, A.; Warpechowski, M., Loglan’88—Report on the Programming Language, LNCS, vol. 414 (1990), Springer: Springer Berlin · Zbl 0703.68029
[10] Inner Class Specification, 1997. Available from: <http://java.sun.com/products/jdk/1.1/docs/guide/inner/classes; Inner Class Specification, 1997. Available from: <http://java.sun.com/products/jdk/1.1/docs/guide/inner/classes
[11] J. Gosling, B. Joy, G. Steele, G. Bracha, The Java Language Specification, third ed., Addison-Wesley, 2005. Available from: <http://java.sun.com/docs/books/jls/; J. Gosling, B. Joy, G. Steele, G. Bracha, The Java Language Specification, third ed., Addison-Wesley, 2005. Available from: <http://java.sun.com/docs/books/jls/
[12] Stärk, R.; Schmid, J.; Börger, E., Java and the Java Virtual Machine Definition, Validation, Specification (2001), Springer: Springer Berlin · Zbl 0978.68033
[13] O.-J. Dahl, K. Nygaard, Class and subclass declarations, in: J.N. Buxton (Ed.), Simulation Programming Languages, Proc. IFIP Work. Conf. Oslo 1967, North Holland, Amsterdam, 158-174, 1968 Simula Programming Language, 2002. Available from: <http://www.iro.umontreal.ca/ ; O.-J. Dahl, K. Nygaard, Class and subclass declarations, in: J.N. Buxton (Ed.), Simulation Programming Languages, Proc. IFIP Work. Conf. Oslo 1967, North Holland, Amsterdam, 158-174, 1968 Simula Programming Language, 2002. Available from: <http://www.iro.umontreal.ca/  · Zbl 0199.51903
[14] Salwicki, A.; Warpechowski, M., Combining inheritance and nesting of classes together: advantages and problems, (Proc. Conf. CS&P’ (2002), Humboldt Universität: Humboldt Universität Berlin), 305-316
[15] Langmaack, H., Consistency of inheritance in object-oriented languages and of static, ALGOL-like binding, (Owe, O.; Krogdahl, S.; Lyche, T., From Object-Orientation to Formal Methods: Dedicated to The Memory of Ole-Johan Dahl, LNCS, vol. 2635 (2004), Springer), 209-235 · Zbl 1278.68043
[16] Igarashi, A.; Pierce, B., On inner classes, Information and Computation, 177, 56-89 (2002) · Zbl 1012.68045
[17] Stroustrup, B., The C++ Programming Language (1997), Addison Wesley · Zbl 0900.68101
[18] Loeckx, J.; Sieber, K., The Foundation of Program Verification (1984), Wiley-Teubner
[19] Eickel, B., Thinking in Java (2005), Prentice Hall
[20] Mirkowska, G.; Salwicki, A., Algorithmic Logic (1987), PWN and D. Reidel: PWN and D. Reidel Warsaw & Dordrecht · Zbl 0648.03018
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.