2,095 research outputs found

    Multifocal: a strategic bidirectional transformation language for XML schemas

    Get PDF
    Lenses are one of the most popular approaches to define bidirectional transformations between data models. However, writing a lens transformation typically implies describing the concrete steps that convert values in a source schema to values in a target schema. In contrast, many XML-based languages allow writing structure-shy programs that manipulate only specific parts of XML documents without having to specify the behavior for the remaining structure. In this paper, we propose a structure-shy bidirectional two-level transformation language for XML Schemas, that describes generic type-level transformations over schema representations coupled with value-level bidirectional lenses for document migration. When applying these two-level programs to particular schemas, we employ an existing algebraic rewrite system to optimize the automatically-generated lens transformations, and compile them into Haskell bidirectional executables. We discuss particular examples involving the generic evolution of recursive XML Schemas, and compare their performance gains over non-optimized definitions.Fundação para a CiĂȘncia e a Tecnologi

    A projection algorithm on measures sets

    Get PDF
    We consider the problem of projecting a probability measure π\pi on a set MN\mathcal{M}_N of Radon measures. The projection is defined as a solution of the following variational problem:\begin{equation*}\inf_{\mu\in \mathcal{M}_N} \|h\star (\mu - \pi)\|_2^2,\end{equation*}where h∈L2(Ω)h\in L^2(\Omega) is a kernel, Ω⊂Rd\Omega\subset \R^d and ⋆\star denotes the convolution operator.To motivate and illustrate our study, we show that this problem arises naturally in various practical image rendering problems such as stippling (representing an image with NN dots) or continuous line drawing (representing an image with a continuous line).We provide a necessary and sufficient condition on the sequence (MN)N∈N(\mathcal{M}_N)_{N\in \N} that ensures weak convergence of the projections (ÎŒN∗)N∈N(\mu^*_N)_{N\in \N} to π\pi.We then provide a numerical algorithm to solve a discretized version of the problem and show several illustrations related to computer-assisted synthesis of artistic paintings/drawings

    Down with variables

    Get PDF
    Techn. Report DI-PURe-05.06.01The subject of this paper is point-free functional programming in Haskell. By this we mean writing programs using categorically-inspired combinators, algebraic data types defined as fixed points of functors, and impicit recursion through the use of type-parameterized recursion patterns. This style of programming is appropriate for program calculation (reasoning about programs equationally), but difficult to actually use in practice - most programmers use a mixture of the above elements with explicit recursion and manipulation of arguments. In this paper we present a mechanism that allows programmers to convert classic point-wise code into point-free style, and a Haskell library that enables the direct execution of the resulting code. Together, they make possible the use of point-free either as a direct programming style or as a domain into which programs can be transformed before being subject to further manipulation

    A projection method on measures sets

    Get PDF
    We consider the problem of projecting a probability measure π on a set MN of Radon measures. The projection is defined as a solution of the following variational problem: inf ”∈M N h (” − π) 2 2 , where h ∈ L 2 (℩) is a kernel, ℩ ⊂ R d and denotes the convolution operator. To motivate and illustrate our study, we show that this problem arises naturally in various practical image rendering problems such as stippling (representing an image with N dots) or continuous line drawing (representing an image with a continuous line). We provide a necessary and sufficient condition on the sequence (MN) N ∈N that ensures weak convergence of the projections (” * N) N ∈N to π. We then provide a numerical algorithm to solve a discretized version of the problem and show several illustrations related to computer-assisted synthesis of artistic paintings/drawings

    Towards Multilingual Programming Environments

    Get PDF
    Software projects consist of different kinds of artifacts: build files, configuration files, markup files, source code in different software languages, and so on. At the same time, however, most integrated development environments (IDEs) are focused on a single (programming) language. Even if a programming environment supports multiple languages (e.g., Eclipse), IDE features such as cross-referencing, refactoring, or debugging, do not often cross language boundaries. What would it mean for programming environment to be truly multilingual? In this short paper we sketch a vision of a system that integrates IDE support across language boundaries. We propose to build this system on a foundation of unified source code models and metaprogramming. Nevertheless, a number of important and hard research questions still need to be addressed

    Haskell Programming with Nested Types: A Principled Approach

    Get PDF
    Initial algebra semantics is one of the cornerstones of the theory of modern functional programming languages. For each inductive data type, it provides a Church encoding for that type, a build combinator which constructs data of that type, a fold combinator which encapsulates structured recursion over data of that type, and a fold/build rule which optimises modular programs by eliminating from them data constructed using the build combinator, and immediately consumed using the fold combinator, for that type. It has long been thought that initial algebra semantics is not expressive enough to provide a similar foundation for programming with nested types in Haskell. Specifically, the standard folds derived from initial algebra semantics have been considered too weak to capture commonly occurring patterns of recursion over data of nested types in Haskell, and no build combinators or fold/build rules have until now been defined for nested types. This paper shows that standard folds are, in fact, sufficiently expressive for programming with nested types in Haskell. It also defines build combinators and fold/build fusion rules for nested types. It thus shows how initial algebra semantics provides a principled, expressive, and elegant foundation for programming with nested types in Haskell

    Monadic Augment And Generalized Short Cut Fusion

    Get PDF
    Monads are commonplace programming devices that are used to uniformly structure computations;in particular, they are often used to mimic the effects of impure features suchas state, error handling, and I/O. This paper further develops the monadic programmingparadigm by investigating the extent to which monadic computations can be optimisedby using generalisations of short cut fusion to eliminate monadic structures whose solepurpose is to \glue together" monadic program components.Ghani, Uustalu, and Vene have recently shown that every inductive type has an associatedbuild combinator and an associated short cut fusion rule. They have also used thenotion of a parameterised monad to describe those monads that give rise to inductive types,and have shown that the standard augment combinators and cata/augment fusion rulesfor algebraic data types can be generalised to xed points of all parameterised monads.We revisit these augment combinators and generalised short cut fusion rules for such typesbut consider them from a functional programming perspective, rather than a categoricalone. In addition to making the category-theoretic ideas of Ghani, Uustalu, and Venemore easily accessible to a wider audience of functional programmers, we demonstratetheir practical applicability by developing nontrivial application programs and performingmodest benchmarking on them. We also show how the cata/augment rules can serve asthe basis for deriving additional generic fusion laws, thus opening the way for an algebraof fusion. Finally, we oer deep theoretical insights, arguing that the augment combinatorsare monadic in nature, and thus that the cata/build and cata/augment rules arearguably the best generally applicable fusion rules obtainable

    KLAIM: A Kernel Language for Agents Interaction and Mobility

    Get PDF
    We investigate the issue of designing a kernel programming language for mobile computing and describe KLAIM, a language that supports a programming paradigm where processes, like data, can be moved from one computing environment to another. The language consists of a core Linda with multiple tuple spaces and of a set of operators for building processes. KLAIM naturally supports programming with explicit localities. Localities are first-class data (they can be manipulated like any other data), but the language provides coordination mechanisms to control the interaction protocols among located processes. The formal operational semantics is useful for discussing the design of the language and provides guidelines for implementations. KLAIM is equipped with a type system that statically checks access rights violations of mobile agents. Types are used to describe the intentions (read, write, execute, etc.) of processes in relation to the various localities. The type system is used to determine the operations that processes want to perform at each locality, and to check whether they comply with the declared intentions and whether they have the necessary rights to perform the intended operations at the specific localities. Via a series of examples, we show that many mobile code programming paradigms can be naturally implemented in our kernel language. We also present a prototype implementaton of KLAIM in Java

    Parametricity in an Impredicative Sort

    Get PDF
    Reynold\u27s abstraction theorem is now a well-established result for a large class of type systems. We propose here a definition of relational parametricity and a proof of the abstraction theorem in the Calculus of Inductive Constructions (CIC), the underlying formal language of Coq, in which parametricity relations\u27 codomain is the impredicative sort of propositions. To proceed, we need to refine this calculus by splitting the sort hierarchy to separate informative terms from non-informative terms. This refinement is very close to CIC, but with the property that typing judgments can distinguish informative terms. Among many applications, this natural encoding of parametricity inside CIC serves both theoretical purposes (proving the independence of propositions with respect to the logical system) as well as practical aspirations (proving properties of finite algebraic structures). We finally discuss how we can simply build, on top of our calculus, a new reflexive Coq tactic that constructs proof terms by parametricity
    • 

    corecore