7 research outputs found

    Maximum Segment Sum, Monadically (distilled tutorial, with solutions)

    Full text link
    The maximum segment sum problem is to compute, given a list of integers, the largest of the sums of the contiguous segments of that list. This problem specification maps directly onto a cubic-time algorithm; however, there is a very elegant linear-time solution too. The problem is a classic exercise in the mathematics of program construction, illustrating important principles such as calculational development, pointfree reasoning, algebraic structure, and datatype-genericity. Here, we take a sideways look at the datatype-generic version of the problem in terms of monadic functional programming, instead of the traditional relational approach; the presentation is tutorial in style, and leavened with exercises for the reader.Comment: Revision of the article in Proceedings DSL 2011, EPTCS 66, arXiv:1109.0323, to provide solutions to the exercise

    Foundations of Software Science and Computation Structures

    Get PDF
    This open access book constitutes the proceedings of the 25th International Conference on Foundations of Software Science and Computational Structures, FOSSACS 2022, which was held during April 4-6, 2022, in Munich, Germany, as part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2022. The 23 regular papers presented in this volume were carefully reviewed and selected from 77 submissions. They deal with research on theories and methods to support the analysis, integration, synthesis, transformation, and verification of programs and software systems

    Foundations of Software Science and Computation Structures

    Get PDF
    This open access book constitutes the proceedings of the 25th International Conference on Foundations of Software Science and Computational Structures, FOSSACS 2022, which was held during April 4-6, 2022, in Munich, Germany, as part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2022. The 23 regular papers presented in this volume were carefully reviewed and selected from 77 submissions. They deal with research on theories and methods to support the analysis, integration, synthesis, transformation, and verification of programs and software systems

    Programming Languages and Systems

    Get PDF
    This open access book constitutes the proceedings of the 28th European Symposium on Programming, ESOP 2019, which took place in Prague, Czech Republic, in April 2019, held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2019

    Consumer Sensory Preferences and Willingness-to-pay for Nutraceutical-rich Fruit

    Get PDF
    Health-oriented juices are prime candidates for the nutraceutical market due to their inherent healthfulness and convenience. Fruits such as açaí berries, blueberries, blackberries, black cherries, Concord grapes, cranberries, and pomegranates are rich in potentially health-supporting polyphenolics, which makes the juices of these fruits attractive for nutraceutical optimization. The compositional, sensory, and stability properties of blueberry, blackberry, and Concord grape juice blends were explored in an extended shelf-life study. Initially, 100% blueberry juice had the highest total monomeric anthocyanins (67.40 mg/100mL), 100% blackberry juice had the highest total phenolics (249.24 mg/100mL), and 100% Concord juice had the highest polymeric color (23.21%). Consumer-oriented optimization techniques based on a ten-blending-treatment mixture design were compared during a central location test (n=108). In the validation study (n=78), the desirability function solution (87% Concord + 13% blackberry) achieved the highest overall liking mean (7.55), although it was not statistically different than the ideal point solution (9% blackberry+20% blueberry+71% Concord) (6.95), the intuitive optimum (66% Concord+34% blueberry) (6.9), or 100% Concord (7.33). Willingness-to-pay (WTP) for the desirability function solution (87% Concord + 13% blackberry) was assessed with a non-hypothetical second-price experimental auction. Random effects regression showed WTP was higher when subjects tasted the product first and then received health information about anthocyanins, which indicates a contrast effect due to treatment order. Choice surveys identified the best blend out of all possible combinations of açaí, black cherry, blueberry, Concord grape, cranberry, and pomegranate juices based on antioxidant status and perceived sensory properties. The black cherry, Concord grape, and pomegranate juice blend had the highest marginal utility (x=0.51) and was further optimized with sensory affective testing (n=100). Consumer data was analyzed with a desirability function, and the optimum juice blend was 75%Con+12%Pom+13%BlkCh based on antioxidant status and sensory properties. WTP for nutraceutical juice based on antioxidant information and sensory properties was evaluated. Average WTP for the juice blend was 3.45,andaverageoverallliking(OL)was7.42.WTPandOLweresimilarlyaffectedbyvariablesnotjust−about−right(sweetness,blackcherryflavor,andbitterness).WTPincreased3.45, and average overall liking (OL) was 7.42. WTP and OL were similarly affected by variables not just-about-right (sweetness, black cherry flavor, and bitterness). WTP increased 0.25 per every unit increase in sweetness toward JAR, 0.20pereveryunitdecreaseinblackcherryflavortowardJAR,and0.20 per every unit decrease in black cherry flavor toward JAR, and 0.29 per every unit decrease in bitterness toward JAR

    System Synthesis from a Monadic Functional Language

    Get PDF
    Embedded systems typically combine a mixture of heterogeneous components, some that are software executing on general purpose CPUs, some that are off-the-shelf hardware components, and some that are application specific circuitry. A major challenge when designing and implementing such systems is the dissimilar models of computation exhibited by hardware and software targets. To successfully navigate this challenge, components must be implemented in a way that does not unnecessarily bias the implementation towards either computational model, allowing the components to be retargeted as application requirements change. This dissertation presents an approach to this problem using a functional programming language extended with monadic imperative and concurrency effects. We argue that these language features allow components to be implemented and compiled to either hardware or software targets. To demonstrate this claim, we detail the design of such a language, Oread. Moreover, we describe the compilation of Oread to both hardware, via VHDL, and software, via C. Using these compilation techniques, we describe the development of a digital processing component in Oread and the integration of that component into a larger system

    Computer Science Logic 2018: CSL 2018, September 4-8, 2018, Birmingham, United Kingdom

    Get PDF
    corecore