首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 15 毫秒
1.
A semantics of multiple inheritance   总被引:2,自引:0,他引:2  
  相似文献   

2.
The CentiJ system automatically generates code that simulates multiple inheritance in Java. The generated code inputs a series of instances and outputs specifications that can be combined using multiple inheritance. The multiple inheritance of implementation is obtained by simple message forwarding. The reflection API of Java is used to reverse engineer the instances, and so the program can generate source code, but does not require source code on its input. Advantages of CentiJ include compile‐time type checking, speed of execution, automatic disambiguation (name space collision resolution) and ease of maintenance. Simulation of multiple inheritance was previously available only to Java programmers who performed manual delegation or who made use of dynamic proxies. The technique has been applied at a major aerospace corporation. Copyright © 2002 John Wiley & Sons, Ltd.  相似文献   

3.
Metamodeling semantics of multiple inheritance   总被引:1,自引:0,他引:1  
Inheritance provides object-oriented programming with much of its great reusability power. When inheritance is single, its specifications are simple and everybody roughly agrees on them. In contrast, multiple inheritance yields ambiguities that have prompted long-standing debates, and no two languages agree on its specifications. In this paper, we present a semantics of multiple inheritance based on metamodeling. A metamodel is proposed which distinguishes the “identity” of properties from their “values” or “implementations”. It yields a clear separation between syntactic and semantic conflicts. The former can be solved in any language at the expense of a common syntactic construct, namely full name qualification. However, semantic conflicts require a programmer’s decision, and the programming language must help the programmer to some extent. This paper surveys the approach based on linearizations, which has been studied in depth, and proposes some extensions. As it turns out that only static typing takes full advantage of the metamodel, the interaction between multiple inheritance and static typing is also considered, especially in the context of virtual types. The solutions proposed by the various languages with multiple inheritance are compared with the metamodel results. Throughout the paper, difficulties encountered under the open-world assumption are stressed.  相似文献   

4.
A categorical semantics of multiple inheritance is presented, in which the inheritance relations between program entities are represented as commutative diagrams in a suitable category, and multiple inheritance is then modelled with colimits of such diagrams. It is shown that the informal semantics of multiple inheritance used in existing object-oriented programming languages conforms to, or is consistent with, this model.  相似文献   

5.
This paper presents Java language from an object-oriented software construction perspective. It explains the implications of banning generics and multiple inheritance of classes, and explores the patterns and the idioms used by the Java designers and programmers to redeem their benefits. The paper also discusses an alternative to multiple inheritance, as incorporated in Lava, which extends Java with constructs for type-safe automatic forwarding.  相似文献   

6.
Object-orientation supports code reuse and incremental programming. Multiple inheritance increases the possibilities for code reuse, but complicates the binding of method calls and thereby program analysis. Behavioral subtyping allows program analysis under an open world assumption; i.e., under the assumption that class hierarchies are extensible. However, method redefinition is severely restricted by behavioral subtyping, and multiple inheritance may lead to conflicting restrictions from independently designed superclasses. This paper presents a more liberal approach to incremental reasoning for multiple inheritance under an open world assumption. The approach, based on lazy behavioral subtyping, is well-suited for multiple inheritance, as it incrementally imposes context-dependent behavioral constraints on new subclasses. We first present the approach for a simple language and show how incremental reasoning can be combined with flexible code reuse. Then this language is extended with a hierarchy of interface types which is independent of the class hierarchy. In this setting, flexible code reuse can be combined with modular reasoning about external calls in the sense that each class is analyzed only once. We formalize the approach as a calculus and show soundness for both languages.  相似文献   

7.
针对人脸识别过程中仅靠人脸整体特征识别容易出现误识的问题,以及人脸局部特征的重要性。本着由粗到精的学习原则,设计了选择性多本征空间的多级人脸识别方法(SMEM)。首先对人脸划分为整体、上半部、鼻、眼四个本征区域;然后对各本征建立特征空间并构造BP神经网络人脸识别器;最后,以后验概率为依据,选择性调用各级识别器,直到类内阈值和类间阈值均满足设定值的分类为止。经实验证明,此方法有较高的识别精度。  相似文献   

8.
We present an intelligent tool for the acquisition of object-oriented schemata supporting multiple inheritance, which preserves taxonomy coherence and performs taxonomic inferences. Its theoretical framework is based onterminological logics, which have been developed in the area of artificial intelligence. The framework includes a rigorous formalization of complex objects, which is able to express cyclic references on the schema and instance level; asubsumption algorithm, which computes all impliedspecialization relationships between types; and an algorithm to detectincoherent types, i.e., necessarily empty types. Using results from formal analyses of knowledge representation languages, we show that subsumption and incoherence detection are computationally intractable from a theoretical point of view. However, the problems appear to be feasible in almost all practical cases.  相似文献   

9.
We have designed and implemented a type inference algorithm for the SELF language. The algorithm can guarantee the safety and disambiguity of message sends, and provide useful information for browsers and optimizing compilers. SELF features objects with dynamic inheritance. This construct has until now been considered incompatible with type inference because it allows the inheritance graph to change dynamically. Our algorithm handles this by deriving and solving type constraints that simultaneously define supersets of both the possible values of expressions and of the possible inheritance graphs. The apparent circularity is resolved by computing a global fixed-point, in polynomial time. The algorithm has been implemented and can successfully handle the SELF benchmark programs, which exist in the ‘standard SELF world’ of more than 40,000 lines of code.  相似文献   

10.
《Applied Soft Computing》2008,8(1):337-349
In many real-world applications of evolutionary algorithms, the fitness of an individual has to be derived using complex models and time-consuming computations. Especially in the case of multiple objective optimisation problems, the time needed to evaluate these individuals increases exponentially with the number of objectives due to the ‘curse of dimensionality’ [J. Chen, D.E. Goldberg, S. Ho, K. Sastry, Fitness inheritance in multi-objective optimization, in: W.B. Langdon et al. (Eds.), GECCO 2002: Proceedings of the Genetic and Evolutionary Computation Conference, July 9–13, Morgan Kaufmann Publishers, New York, 2002, pp. 319–326]. This in turn leads to a slower convergence of the evolutionary algorithms. It is not feasible to use time-consuming models with large population sizes unless the time to evaluate the objective functions is reduced. Fitness inheritance is an efficiency enhancement technique that was originally proposed by Smith et al. [R.E. Smith, B.A. Dike, S.A. Stegmann, Fitness inheritance in genetic algorithms, in: Proceedings of the 1995 ACM Symposium on Applied Computing, February 26–28, ACM, Nashville, TN, USA, 1995] to improve the performance of genetic algorithms. Sastry et al. [K. Sastry, D.E. Goldberg, M. Pelikan, Don’t evaluate, inherit, in: L. Spector et al. (Eds.), GECCO 2001: Proceedings of the Genetic and Evolutionary Computation Conference, Morgan Kaufmann Publishers, San Francisco, 2001, pp. 551–558] and Chen et al. [J. Chen, D.E. Goldberg, S. Ho, K. Sastry, Fitness inheritance in multi-objective optimization, in: W.B. Langdon et al. (Eds.), GECCO 2002: Proceedings of the Genetic and Evolutionary Computation Conference, July 9–13, Morgan Kaufmann Publishers, New York, 2002, pp. 319–326] have developed analytical models for fitness inheritance. In this paper, the usefulness of fitness inheritance for a set of popular and separable multiple objective test functions as well as a non-separable real-world problem is evaluated based on unary performance measures testing closeness to the Pareto-optimal front, uniform distribution along and extent of the obtained Pareto front. A statistical evaluation of the performance of an NSGA-II like algorithm on the basis of these unary performance measures suggests that especially for non-convex or non-continuous problems the use of fitness inheritance negatively affects the closeness to the Pareto-optimal front.  相似文献   

11.
Inheritance networks are not expressive enough to capture all intuitions behind inheritance. Hence, a number of significantly different semantics have been proposed. Here, a family of local theories of inheritance is presented that are conceptually simple and computationally tractable. A general model-theoretic framework for specifying direct semantics to networks and clarifying relationships among them is developed. It is also shown that the local constraints specifying the semantics are satisfiable when the attention is restricted to acyclic networks. the notion of local semantics is generalized to what is called “ground” local semantics to further understand the relationship between the local theories and the path-based theories of inheritance. A family of polynomialtime set-based inheritance algorithm8 that conforms to these inheritance theories is also presented. © 1995 John Wiley & Sons, Inc.  相似文献   

12.
A categorial semantic domain for objects is presented in order to clarify both aggregation and specialization. Three kinds of specialization are discussed: (1) subtyping (specialization with no side effects and no non-monotonic overriding); (2) monotonic specialization (possibly with side effects but still only with monotonic overriding); and (3) non-monotonic specialization (possibly with side effects and non-monotonic overriding). A sequence of three categories of objects differing only in the morphisms is presented. The first one is used to explain object aggregation (respecting locality through a frame constraint) and the strictest form of specialization (subtyping). The second category is shown to be adequate for explaining specialization with side effects (by relaxing the frame constraint). Finally, the third category supports also non-monotonic overriding, by adopting as morphisms suitable partial morphisms of the second one. All these categories are complete and cocomplete. Colimits are used for explaining the semantics of aggregation and multiple inheritance.  相似文献   

13.
Paul Johnson  Ceri Rees 《Software》1992,22(12):1049-1068
Object-oriented languages are often promoted as encouraging the production of flexible, reusable software. Unfortunately, experience suggests that although individual classes may be reusable, large class libraries seem to lack flexibility in the face of circumstances unforeseen by the designer. This paper explores the problems associated with flexibility and reuse in large libraries, and shows how fine-grain inheritance can alleviate some of these problems. A methodology for designing fine-grain inheritance graphs is proposed and a detailed case study is presented.  相似文献   

14.
This paper discusses some problems that arise in knowledge-based intelligent systems using property inheritance as the principal inference mechanism. A few methods that deal with those problems are presented here. They are divided into three groups: those that are based on different forms of non-monotonic logics, algebraic structures, and connectionist networks. Implementational issues concerning inheritance systems are considered with the special emphasis put on parallel methods of computation.  相似文献   

15.
There are two approaches to using code inheritance for defining new component implementations in terms of existing implementations. Black box code inheritance allows subclasses to reuse superclass implementations as-is, without direct access to their internals. Alternatively, white box code inheritance allows subclasses to have direct access to superclass implementation details, which may be necessary for the efficiency of some subclass operations and to prevent unnecessary duplication of code. Unfortunately, white box code inheritance violates the protection that encapsulation affords superclasses, opening up the possibility of a subclass interfering with the correct operation of its superclass methods. Representation inheritance is proposed as a restricted form of white box code inheritance where subclasses have direct access to superclass implementation details, but are required to respect the representation invariant(s) and abstraction relation(s) of their ancestor(s). This preserves the protection that encapsulation provides, while allowing the freedom of access that component implementers sometimes desire  相似文献   

16.
This paper establishes a language-independent framework for class-based inheritance using a generic concept of refinement. The framework is then realised in the process algebra CSP. Class membership is expressed in terms of conformance to some relabelling of a distinguished process (the class template). The approach of the paper facilitates rigorous examination of informal concepts in object-oriented design, and suggests the possibility of introducing an appealing methodology into CSP.An earlier version of this paper was presented at a Workshop on the Theory and Practice of Refinement, Open University, 10–12 January 1989.  相似文献   

17.
Inheritance, together with object and class, is the key concept of object oriented systems. Adopting the concept-oriented view (COV for short) of inheritance, current OO systems such as GemStone, Orion, C++, O2, PostGres, Iris, and SmallTalk dominantly interpret inheritance by retaining all attributes and methods in a subclass from its superclass, and by supporting the specification of additional attributes and methods in the subclass. However, this monotonic extension property may result in a redundant subclass representation which in turn gives rise to update anomalies. Thus extra effort in practice used to prevent these problems from happening is to change an IS-A relationship in COV of hierarchy into sibling in the program-oriented view (POV for short) hierarchy. However, the dichotomy between the concept and implementation leads to a significant difference of the class hierarchy between the designing phase and implementation phase of OO systems, hence increases the complexity in designing OO systems. In this paper, we show that, when the subclass attributes are linearly related to the superclass attributes (the attributes in the superclass can be linearly expressed by those in the subclass), linear subclass assertions/constraints can be elegantly used to resolve the problems such as the redundant subclass representation, and update anomalies. We have proved that (1) given a linear subclass assertion, a non-redundant subclass representation can be automatically decided, and the bilateral mappings between the class and the determined subclass can be automatically constructed, and (2) given a user-chosen subclass representation and the mapping from the chosen subclass to the superclass, the linear subclass assertion and inverse mapping can be automatically constructed, and (3) placing an object into the most specific class in an ISA class hierarchy can be automatically conducted. The proposed novel ideas have been prototyped on GemStone/Smalltalk on a SunSparc/Unix platform. Our experience indicates that the proposed idea can be efficiently and effectively integrated into an OO system.  相似文献   

18.
An extended form of logic programming is presented which combines SLD-resolution with a dynamic form of inheritance between modules. The resulting inference system supports the notion of ‘implementation’ as a process of computing mappings between specifications and technologies—both formulated as sets of clausal-form theories—in order to satisfy requirements posed as queries. Besides detailing the operational features of the formalism, the paper also explores its semantics and its practical value in two case studies.  相似文献   

19.
Object-oriented programming apparently provides a great power to organise and manage all elements constituting a software project in a clean and efficient way. This is particularly not true, however, in a multiple project group-development circumstance. This paper presents an approach to solve these problems in a Smalltalk-type environment. Key ideas are configuration inheritance, version synthesis, and functionality mapping.  相似文献   

20.
Solving inheritance anomaly with OMNets   总被引:2,自引:0,他引:2       下载免费PDF全文
This paper presents a concurrent object-oriented modeling language based on Petri nets:OMNets,which hepls greatly to avoid the inheritance anomaly problem appeared in concurrent OO languages.OMNets separates th functional part and the synchroniztion part of objects and uses Petri nets to describe the synchronization part.Both parts are reusable through inheritance.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号