249 research outputs found

    Controlling the C3 super class linearization algorithm

    Full text link
    C3 is an algorithm used by several widely used programming languages such as Python to support multiple inheritance in object oriented programming (OOP): for each class, C3 computes recursively a linear extension of the poset of all its super classes (the Method Resolution Order, MRO) from user-provided local information (an ordering of the direct super classes). This algorithm can fail if the local information is not consistent. For large hierarchies of classes, as encountered when modeling hierarchies of concepts from abstract algebra in the SageMath computational system, maintaining consistent local information by hand does not scale and leads to unpredictable C3 failures. This paper reports on the authors' work to analyze and circumvent this maintenance nightmare. First, we discovered through extensive computer exploration that there exists posets admitting no consistent local information; we exhibit the smallest one which has 10 elements. Then, we provide and analyze an algorithm that, given a poset and a linear extension, automatically builds local information for C3 in such a way that guarantees that it will never fail, at the price of a slight relaxation of the hypotheses. This algorithm has been used in production in SageMath since 2013.Comment: 15 page

    Derivation without lexical rules

    Get PDF
    In Krieger and Nerbonne (1992) we showed how to get rid of LEXICAL RULES for DERIVATION, as they are explicated by Pollard and Sag (1987) in HPSG I, Ch. 8.2. We proposed a treatment of derivation not by means of traditional lexical rules but instead in terms of PRINCIPLES, RULES, and LEXICAL ENTRIES entirely in the spirit of HPSG, together with unification-based inheritance of a very sophisticated kind. One major disadvantage of this approach was the employment of complex functions in certain principles. In this paper I first extend the old approach and then show how to eliminate these functional dependencies in the domain of derivational morphology by going back to simpler ones like cons, first, and rest. But this simplification is only achieved if we assume more complex feature structures than the ones described in Krieger and Nerbonne (e.g., by introducing two different SUBCAT features) and by proposing modified versions of the old Constituent Order Principle and the Subcategorization Principle for morphology. In addition, I postulate a hierarchy of affixes which is cross-classified, for instance, according to the effects these affixes contribute to the subcategorization information of a compound word. The structure of the paper is as follows. We start with a very short introduction about the residence of word-formation rules in modern feature-based theories. After that we present our approach to derivational morphology which is distinguished in that it gives up the notion of lexical rule as a single entity (operator). We describe the structure of affixes and words (e.g., which attributes are appropriate?) and introduce the relevant principles and the rule schema of our approach to derivational morphology. The section shows how to reduce functional dependencies to a minimum at the cost of the size of our feature structures. We also present a technique which allows us to state relational dependencies as they are called by HPSG in a functional manner. In the next section we show how the whole treatment works by applying it to tough phenomena from prefixation and suffixation. The section presents many examples, which might serve as a how to guide to a practitioner. After that we explain the idea which will lead us to the affix hierarchy. We will see that the affix hierarchy is inspired by the work of HPSG on structured lexicons (i.e., by the hierarchy of lexical types). A lot of examples will again be given throughout this section. We finish the paper by summarizing our approach and by saying a few words about the topics which we will tackle next

    On Internal Merge

    Get PDF

    On automatic class insertion with overloading

    Get PDF
    Also published in Proceedings of the 11th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA)International audienceSeveral algorithms [Cas92, MS89, Run92, DDHL94a, DDHL95, GMM95] have been proposed to automatically insert a class into an inheritance hierarchy. But actual hierarchies all include overriden and overloaded properties that these algorithms handle either very partially or not at all. Partially handled means handled provided there is a separate given function f able to compare overloaded properties [DDHL95, GMM95].In this paper, we describe a new version of our algorithm (named Ares) which handles automatic class insertion more efficiently using such a function f. Although impossible to fully define, this function can be computed for a number of well defined cases of overloading and overriding. We give a classification of such cases and describe the computation process for a well-defined set of nontrivial cases.The algorithm preserves these important properties:- preservation of the maximal factorization of properties- preservation of the underlying structure (Galois lattice) of the input hierarchy- conservation of relevant classes of the input hierarchy with their properties

    An introduction to Radical Minimalism I: On Merge and Agree (and related issues)

    Get PDF

    Supporting Explicit Disambiguation of Multi-Methods

    Get PDF
    Projet RODINMultiple inheritance and multiple dispatching are two sources of ambiguities in object-oriented languages. Solving ambiguities can be performed automatical- ly, using techniques such as totally ordering the supertypes of each type or taking the order of the methods' arguments into account. Such implicit disambiguation has the drawback of being difficult to understand by the programmer and hiding programming errors. Conversely, solving ambiguiti- es can be left up to the explicit intervention of the programmer. The most common explicit disambiguation technique consists in defining new methods for ambiguous invocations. However, finding ambiguities and adding as few methods as possible is a difficult task, especially in multi-method systems. In this paper, we show that there always exists a unique minimal set of method redefinitions to explicitly disambiguate a set of multi-methods. We propose an algorithm to compute the minimal disambiguation set, together with {\em ! explanations}: for each method that is to be added, the programmer is given the set of methods that caused the ambiguity

    gbeta - a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance

    Get PDF
    A language design development process is presented which leads to a language, gbeta, with a tight integration of virtual classes, general block structure, and a multiple inheritance mechanism based on coarse-grained structural type equivalence. From this emerges the concept of propagating specialization. The power lies in the fact that a simple expression can have far-reaching but well-organized consequences, e.g., in one step causing the combination of families of classes, then by propagation the members of those families, and finally by propagation the methods of the members. Moreover, classes are first class values which can be constructed at run-time, and it is possible to inherit from classes whether or not they are compile-time constants, and whether or not they were created dynamically. It is also possible to change the class and structure of an existing object at run-time, preserving object identity. Even though such dynamism is normally not seen in statically type-checked languages, these constructs have been integrated without compromising the static type safety of the language

    Head-Driven Phrase Structure Grammar

    Get PDF
    Head-Driven Phrase Structure Grammar (HPSG) is a constraint-based or declarative approach to linguistic knowledge, which analyses all descriptive levels (phonology, morphology, syntax, semantics, pragmatics) with feature value pairs, structure sharing, and relational constraints. In syntax it assumes that expressions have a single relatively simple constituent structure. This volume provides a state-of-the-art introduction to the framework. Various chapters discuss basic assumptions and formal foundations, describe the evolution of the framework, and go into the details of the main syntactic phenomena. Further chapters are devoted to non-syntactic levels of description. The book also considers related fields and research areas (gesture, sign languages, computational linguistics) and includes chapters comparing HPSG with other frameworks (Lexical Functional Grammar, Categorial Grammar, Construction Grammar, Dependency Grammar, and Minimalism)
    corecore