337 research outputs found
FliPpr: A Prettier Invertible Printing System
When implementing a programming language, we often write
a parser and a pretty-printer. However, manually writing both programs
is not only tedious but also error-prone; it may happen that a pretty-printed
result is not correctly parsed. In this paper, we propose FliPpr,
which is a program transformation system that uses program inversion
to produce a CFG parser from a pretty-printer. This novel approach
has the advantages of fine-grained control over pretty-printing, and easy
reuse of existing efficient pretty-printer and parser implementations
Detecting anomalous energy consumption in android applications
The use of powerful mobile devices, like smartphones, tablets and laptops, are changing the way programmers develop software. While in the past the primary goal to optimize software was the run time optimization, nowadays there is a growing awareness of the need to reduce energy consumption. This paper presents a technique and a tool to detect anomalous energy
consumption in Android applications, and to relate it directly with the source code of the application. We propose a dynamically calibrated model for energy consumption for the Android ecosystem, and that supports different devices. The model is then used as an API to monitor the application execution: first, we instrument the application source code so that we can relate energy consumption to the application source code; second, we use a statistical approach, based on fault-localization techniques, to localize abnormal energy consumption in the source code
Constructing applicative functors
Applicative functors define an interface to computation that is more general, and correspondingly weaker, than that of monads. First used in parser libraries, they are now seeing a wide range of applications. This paper sets out to explore the space of non-monadic applicative functors useful in programming. We work with a generalization, lax monoidal functors, and consider several methods of constructing useful functors of this type, just as transformers are used to construct computational monads. For example, coends, familiar to functional programmers as existential types, yield a range of useful applicative functors, including left Kan extensions. Other constructions are final fixed points, a limited sum construction, and a generalization of the semi-direct product of monoids. Implementations in Haskell are included where possible
Improving Breast Cancer Control via the Use of Community Health Workers in South Africa: A Critical Review
Breast cancer is a growing concern in low- and middle-income countries (LMCs). We explore community health worker (CHW) programs and describe their potential use in LMCs. We use South Africa as an example of how CHWs could improve access to breast health care because of its middle-income status, existing cancer centers, and history of CHW programs. CHWs could assume three main roles along the cancer control continuum: health education, screening, and patient navigation. By raising awareness about breast cancer through education, women are more likely to undergo screening. Many more women can be screened resulting in earlier-stage disease if CHWs are trained to perform clinical breast exams. As patient navigators, CHWs can guide women through the screening and treatment process. It is suggested that these roles be combined within existing CHW programs to maximize resources and improve breast cancer outcomes in LMCs
A Fully Verified Executable LTL Model Checker
International audienceWe present an LTL model checker whose code has been completely verified using the Isabelle theorem prover. The checker consists of over 4000 lines of ML code. The code is produced using recent Isabelle technology called the Refinement Framework, which allows us to split its correctness proof into (1) the proof of an abstract version of the checker, consisting of a few hundred lines of âformalized pseudocodeâ, and (2) a verified refinement step in which mathematical sets and other abstract structures are replaced by implementations of efficient structures like red-black trees and functional arrays. This leads to a checker that, while still slower than unverified checkers, can already be used as a trusted reference implementation against which advanced implementations can be tested. We report on the structure of the checker, the development process, and some experiments on standard benchmarks
Termination Casts: A Flexible Approach to Termination with General Recursion
This paper proposes a type-and-effect system called Teqt, which distinguishes
terminating terms and total functions from possibly diverging terms and partial
functions, for a lambda calculus with general recursion and equality types. The
central idea is to include a primitive type-form "Terminates t", expressing
that term t is terminating; and then allow terms t to be coerced from possibly
diverging to total, using a proof of Terminates t. We call such coercions
termination casts, and show how to implement terminating recursion using them.
For the meta-theory of the system, we describe a translation from Teqt to a
logical theory of termination for general recursive, simply typed functions.
Every typing judgment of Teqt is translated to a theorem expressing the
appropriate termination property of the computational part of the Teqt term.Comment: In Proceedings PAR 2010, arXiv:1012.455
The F# Computation Expression Zoo
Program logic can often be structured using abstract computation types such as monoids, monad transformers or applicative functors. Functional programmers use those abstractions directly while main-stream languages often integrate concrete instances as language features â e.g. generators in Python or asynchronous computations in C# 5.0. The question is, is there a sweet spot between convenient, hardwired language features, and an inconvenient but flexible libraries?
F# computation expressions answer this question in the affirmative. Unlike the âdoâ notation in Haskell, computation expressions are not tied to a single kind of abstraction. They support a wide range of abstractions, depending on what operations are available. F# also provides greater syntactic flexibility leading to a more intuitive syntax, without resorting to full macro-based meta-programming.
We present computation expressions in a principled way, developing a type system that captures the semantics of the calculus. We demonstrate how computation expressions structure well-known abstractions including monoidal list comprehensions, monadic parsers, applicative formlets and asynchronous sequences based on monad transformers
Type-safe two-level data transformation
A two-level data transformation consists of a type-level transformation of a data format coupled with value-level transformations of data instances corresponding to that format. Examples of two-level data transformations include XML schema evolution coupled with document migration, and data mappings used for interoperability and persistence. We provide a formal treatment of two-level data transformations that is type-safe in the sense that the well-formedness of the value-level transformations with respect to the type-level transformation is guarded by a strong type system. We
rely on various techniques for generic functional programming to implement the formalization in Haskell.
The formalization addresses various two-level transformation scenarios, covering fully automated as well as user-driven transformations, and allowing transformations that are information-preserving or not. In each case, two-level transformations are disciplined by one-step transformation rules and type-level transformations induce value-level transformations. We demonstrate an example hierarchical-relational mapping and subsequent migration of relational data induced by hierarchical format evolution.Fundação para a CiĂȘncia e a Tecnologia (FCT
- âŠ