57 research outputs found

    First Class Call Stacks: Exploring Head Reduction

    Get PDF
    Weak-head normalization is inconsistent with functional extensionality in the call-by-name λ\lambda-calculus. We explore this problem from a new angle via the conflict between extensionality and effects. Leveraging ideas from work on the λ\lambda-calculus with control, we derive and justify alternative operational semantics and a sequence of abstract machines for performing head reduction. Head reduction avoids the problems with weak-head reduction and extensionality, while our operational semantics and associated abstract machines show us how to retain weak-head reduction's ease of implementation.Comment: In Proceedings WoC 2015, arXiv:1606.0583

    Beyond Polarity: Towards a Multi-Discipline Intermediate Language with Sharing

    Get PDF
    The study of polarity in computation has revealed that an "ideal" programming language combines both call-by-value and call-by-name evaluation; the two calling conventions are each ideal for half the types in a programming language. But this binary choice leaves out call-by-need which is used in practice to implement lazy-by-default languages like Haskell. We show how the notion of polarity can be extended beyond the value/name dichotomy to include call-by-need by only adding a mechanism for sharing and the extra polarity shifts to connect them, which is enough to compile a Haskell-like functional language with user-defined types

    Compiling With Classical Connectives

    Get PDF
    The study of polarity in computation has revealed that an "ideal" programming language combines both call-by-value and call-by-name evaluation; the two calling conventions are each ideal for half the types in a programming language. But this binary choice leaves out call-by-need which is used in practice to implement lazy-by-default languages like Haskell. We show how the notion of polarity can be extended beyond the value/name dichotomy to include call-by-need by adding a mechanism for sharing which is enough to compile a Haskell-like functional language with user-defined types. The key to capturing sharing in this mixed-evaluation setting is to generalize the usual notion of polarity "shifts:" rather than just two shifts (between positive and negative) we have a family of four dual shifts. We expand on this idea of logical duality -- "and" is dual to "or;" proof is dual to refutation -- for the purpose of compiling a variety of types. Based on a general notion of data and codata, we show how classical connectives can be used to encode a wide range of built-in and user-defined types. In contrast with an intuitionistic logic corresponding to pure functional programming, these classical connectives bring more of the pleasant symmetries of classical logic to the computationally-relevant, constructive setting. In particular, an involutive pair of negations bridges the gulf between the wide-spread notions of parametric polymorphism and abstract data types in programming languages. To complete the study of duality in compilation, we also consider the dual to call-by-need evaluation, which shares the computation within the control flow of a program instead of computation within the information flow

    Compiling With Classical Connectives

    Get PDF
    The study of polarity in computation has revealed that an "ideal" programming language combines both call-by-value and call-by-name evaluation; the two calling conventions are each ideal for half the types in a programming language. But this binary choice leaves out call-by-need which is used in practice to implement lazy-by-default languages like Haskell. We show how the notion of polarity can be extended beyond the value/name dichotomy to include call-by-need by adding a mechanism for sharing which is enough to compile a Haskell-like functional language with user-defined types. The key to capturing sharing in this mixed-evaluation setting is to generalize the usual notion of polarity "shifts:" rather than just two shifts (between positive and negative) we have a family of four dual shifts. We expand on this idea of logical duality---"and" is dual to "or;" proof is dual to refutation---for the purpose of compiling a variety of types. Based on a general notion of data and codata, we show how classical connectives can be used to encode a wide range of built-in and user-defined types. In contrast with an intuitionistic logic corresponding to pure functional programming, these classical connectives bring more of the pleasant symmetries of classical logic to the computationally-relevant, constructive setting. In particular, an involutive pair of negations bridges the gulf between the wide-spread notions of parametric polymorphism and abstract data types in programming languages. To complete the study of duality in compilation, we also consider the dual to call-by-need evaluation, which shares the computation within the control flow of a program instead of computation within the information flow

    A Study of the Milk Market of Memphis, Tennessee

    Get PDF

    Relationship Between Sexual Activity, Contraceptive Utilization and Biopsychosocial Characteristics Among Homeless Shelter Adolescents.

    Get PDF
    Objective: To determine whether biopsychosocial factors are associated with sexual activity and contraceptive utilization among homeless shelter adolescents. Methods: A retrospective study of 440 adolescents at a shelter in Pennsylvania between February 2015 and September 2019 was conducted. The cohort was evaluated to determine what relationship age, gender identity, substance use, and trauma history have with sexual activity and contraceptive utilization. Results: Sexual activity was significantly related to age (mean 15.8+1.4 years in sexually active vs. 14.7+1.6 years in abstinent youth, p\u3c0.001); remote history of self-harm behavior (relative risk ratio (RR) 1.23 [95% CI 1.03-1.46]; p=0.02), history of aggressive behavior (RR 1.21 [95% CI 1.01-1.46]; p=0.04), history of trauma (RR 1.24 [95% CI 1.04-1.48]; p=0.03), and substance use (RR 2.27 [95%CI 1.86-2.77]; p\u3c0.001). There were 55.7% sexually active females vs. 42.50% males reporting contraception use (p=0.01). After adjustment, older age and substance use remained significantly associated with sexual activity (adjusted odds ratio (AOR) 1.58 [95% CI 1.36-1.83]; p\u3c0.001 and AOR 5.18 [95% CI 3.28-8.18]; p\u3c0.001, respectively). Conclusions: Females self-reported sexual activity using contraception more than males. After adjustment, older age and substance use were associated with sexual activity. By better understanding the impact these factors can have on contraceptive utilization, informed policy and practice interventions can be developed and implemented to help increase safe sex practices in spaces where homeless adolescents access healthcare
    • …
    corecore