126,613 research outputs found

    A Simple Solution to Type Specialization

    Get PDF
    Partial evaluation specializes terms, but traditionally thisspecialization does not apply to the type of these terms. As a result, specializing, e.g., an interpreter written in a typed language, which requires a "universal" type to encode expressible values, yields residual programs with type tags all over. Neil Jones has stated that getting rid of these type tags was an open problem, despite possible solutions such as Torben Mogensen's "constructor specialization." To solve this problem, John Hughes has proposed a new paradigm for partial evaluation, "Type Specialization," based on type inference instead of being based on symbolic interpretation. Type Specialization is very elegant in principle but it also appears non-trivial in practice. Stating the problem in terms of types instead of in terms of type encodings suggests a very simple type-directed solution, namely, to use a projection from the universal type to the specific type of the residual program. Standard partial evaluation then yields a residual programwithout type tags, simply and efficiently

    Practical Datatype Specializations with Phantom Types and Recursion Schemes

    Get PDF
    Datatype specialization is a form of subtyping that captures program invariants on data structures that are expressed using the convenient and intuitive datatype notation. Of particular interest are structural invariants such as well-formedness. We investigate the use of phantom types for describing datatype specializations. We show that it is possible to express statically-checked specializations within the type system of Standard ML. We also show that this can be done in a way that does not lose useful programming facilities such as pattern matching in case expressions.Comment: 25 pages. Appeared in the Proc. of the 2005 ACM SIGPLAN Workshop on M

    Invariant classification of vacuum PP-waves

    Full text link
    We solve the equivalence problem for vacuum PP-wave spacetimes by employing the Karlhede algorithm. Our main result is a suite of Cartan invariants that allows for the complete invariant classification of the vacuum pp-waves. In particular, we derive the invariant characterization of the G2 and G3 sub-classes in terms of these invariants. It is known [Collins91] that the invariant classification of vacuum pp-waves requires at most the fourth order covariant derivative of the curvature tensor, but no specific examples requiring the fourth order were known. Using our comprehensive classification, we prove that the q<=4 bound is sharp and explicitly describe all such maximal order solutions
    • …
    corecore