59 research outputs found
A Coq-based synthesis of Scala programs which are correct-by-construction
The present paper introduces Scala-of-Coq, a new compiler that allows a
Coq-based synthesis of Scala programs which are "correct-by-construction". A
typical workflow features a user implementing a Coq functional program, proving
this program's correctness with regards to its specification and making use of
Scala-of-Coq to synthesize a Scala program that can seamlessly be integrated
into an existing industrial Scala or Java application.Comment: 2 pages, accepted version of the paper as submitted to FTfJP 2017
(Formal Techniques for Java-like Programs), June 18-23, 2017, Barcelona ,
Spai
Processing of ICARTT Data Files Using Fuzzy Matching and Parser Combinators
In this paper, the task of parsing and matching inconsistent, poorly formed text data through the use of parser combinators and fuzzy matching is discussed. An object-oriented implementation of the parser combinator technique is used to allow for a relatively simple interface for adapting base parsers. For matching tasks, a fuzzy matching algorithm with Levenshtein distance calculations is implemented to match string pair, which are otherwise difficult to match due to the aforementioned irregularities and errors in one or both pair members. Used in concert, the two techniques allow parsing and matching operations to be performed which had previously only been done manually
Haiku - a Scala combinator toolkit for semi-automated composition of metaheuristics
There is an emerging trend towards the automated design of metaheuristics at the software component level. In principle, metaheuristics have a relatively clean decomposition, where well-known frameworks such as ILS and EA are parametrised by variant components for acceptance, perturbation etc. Automated generation of these frameworks is not so simple in practice, since the coupling between components may be implementation specific. Compositionality is the ability to freely express a space of designs ‘bottom up’ in terms of elementary components: previous work in this area has used combinators, a modular and functional approach to componentisation arising from foundational Computer Science. In this article, we describeHaiku, a combinator tool-kit written in the Scala language, which builds upon previous work to further automate the process by automatically composing the external dependencies of components. We provide examples of use and give a case study in which a programatically-generated heuristic is applied to the Travelling Salesman Problem within an Evolutionary Strategies framework
Polymonadic Programming
Monads are a popular tool for the working functional programmer to structure
effectful computations. This paper presents polymonads, a generalization of
monads. Polymonads give the familiar monadic bind the more general type forall
a,b. L a -> (a -> M b) -> N b, to compose computations with three different
kinds of effects, rather than just one. Polymonads subsume monads and
parameterized monads, and can express other constructions, including precise
type-and-effect systems and information flow tracking; more generally,
polymonads correspond to Tate's productoid semantic model. We show how to equip
a core language (called lambda-PM) with syntactic support for programming with
polymonads. Type inference and elaboration in lambda-PM allows programmers to
write polymonadic code directly in an ML-like syntax--our algorithms compute
principal types and produce elaborated programs wherein the binds appear
explicitly. Furthermore, we prove that the elaboration is coherent: no matter
which (type-correct) binds are chosen, the elaborated program's semantics will
be the same. Pleasingly, the inferred types are easy to read: the polymonad
laws justify (sometimes dramatic) simplifications, but with no effect on a
type's generality.Comment: In Proceedings MSFP 2014, arXiv:1406.153
Controlling Contractors with Monads for Hybrid Dynamical Systems
Physical systems with intelligent behaviors result from inter-actions of different fields: sensor networks, robotics, optimization, reasoning, etc. Rooted in this philosophy of interdisciplinary, this paper makes a connexion between hybrid dynamical systems, interval-based constraint propagation and functional programming. It shows how to build a monadic program in Haskell to control contractors (constraint propagators) for the state estimation of multi-model (hy- brid) dynamical systems, subject to partial and uncertain measurements. The example of system taken here is an elevator that can either be moving upward, downward or stopped. The altitude is measured directly and the estimation problem is simply to track its motion. The purpose of the Haskell library is to offer both a high-level and flexible framework for building propagation strategies based on user knowledge or user requirements.L'élaboration de sytèmes autonomes est le résultat d'interactions entre différents domaines: réseau de capteurs, robotique, optimisation, raison- nement automatique, etc. Cet article, ancré dans cette philosophie pluridis- ciplinaire, montre une connexion entre les systèmes hybrides dynamiques, la propagation de contraintes sur intervalles et la programmation fonctionnelle. Plus précisément, il montre comment concevoir un programme monadique en Haskell pour contrôler les contracteurs (propagateurs de contraintes) permet- tant l'estimation d'état de systèmes dynamiques multi-modéles (hybrides), su- jets à des mesures partielles et incertaines. L'exemple de système pris ici est un ascenseur qui peut monter, descendre ou être stopé. L'altitude est mesurée directement et le problème d'estimation est simplement de suivre son mouve- ment. L'objectif de la bibliothéque Haskell est d'offrir un cadre à la fois flexible et de haut niveau pour construire des stratégies de propagation basées sur les connaissances ou les pré-requis de l'utilisateur
Shortcut fusion rules for the derivation of circular and higher-order monadic programs
Functional programs often combine separate parts using intermediate data structures for communicating results. Programs so defined are modular, easier to understand and maintain, but suffer from inefficiencies due to the generation of those gluing data structures. To eliminate such redundant data structures, some program transformation techniques have been proposed. One such technique is shortcut fusion, and has been studied in the context of both pure and monadic functional programs.
In this paper, we study several shortcut fusion extensions, so that, alternatively, circular or higher-order programs are derived. These extensions are also provided for effect-free programs and monadic ones. Our work results in a set of generic calculation rules, that are widely applicable, and whose correctness is formally established.(undefined
Lazy functional parser combinators in Java
A parser is a program that checks if a text is a sentence
of the language as described by a grammar. Traditionally, the program
text of a parser is generated from a grammar description, after which it is
compiled and subsequently run. The language accepted by such a parser
is, by the nature of this process, hardcoded in the program. Another
approach, primarily taken in the context of functional languages, allows
parsers to be constructed at runtime, thus dynamically creating parsers
by combining elements from libraries of higher level parsing concepts; this
explanins the the name "parser combinators". Efficient implementation
of this concept relies heavily on the laziness that is available in modern
functional languages [13, 14]. This paper shows how to use parser combinators
in a functional language as well as Java, and shows how parser
combinators can be implemented in Java. Implementing parser combinators
is accomplished by combining two libraries. The first one, written
in Haskell, defines error-correcting and analysing parser combinators [2].
The second one consists of a small Java library implementing lazy functional
behavior. The combinator library is straightforwardly coded in
Java, using lazy behavior where necessary. In this paper all three aspects,
the two libraries and its combination, are explained
- …