105,906 research outputs found

    Sequential products in effect categories

    Full text link
    A new categorical framework is provided for dealing with multiple arguments in a programming language with effects, for example in a language with imperative features. Like related frameworks (Monads, Arrows, Freyd categories), we distinguish two kinds of functions. In addition, we also distinguish two kinds of equations. Then, we are able to define a kind of product, that generalizes the usual categorical product. This yields a powerful tool for deriving many results about languages with effects

    A Visual Language for Keyboardless Programming

    Get PDF
    A visual language Show and Tell is introduced as a programming language for home information systems, integrating the computer capabilities of managing computation, communications, and database. It is shown that keyboardless programming is possible with Show and Tell. The language is implemented on the Apple Macintosh personal computer. The semantic model of the language is based on the concepts of dataflow and completion. A Show and Tell program is a partially ordered set of nested boxes and arrows. Traditional programming constructs such as subroutine, iteration, record structure recursion, exception, concurrency and so forth, are represented by two-dimensional graphical structures of boxes and arrows. The design philosophy, conceptual model, syntax, and semantics of major language constructs are described. Various research problems in the visual programming area are discussed

    Synthesizing Functional Reactive Programs

    Get PDF
    Functional Reactive Programming (FRP) is a paradigm that has simplified the construction of reactive programs. There are many libraries that implement incarnations of FRP, using abstractions such as Applicative, Monads, and Arrows. However, finding a good control flow, that correctly manages state and switches behaviors at the right times, still poses a major challenge to developers. An attractive alternative is specifying the behavior instead of programming it, as made possible by the recently developed logic: Temporal Stream Logic (TSL). However, it has not been explored so far how Control Flow Models (CFMs), as synthesized from TSL specifications, can be turned into executable code that is compatible with libraries building on FRP. We bridge this gap, by showing that CFMs are indeed a suitable formalism to be turned into Applicative, Monadic, and Arrowized FRP. We demonstrate the effectiveness of our translations on a real-world kitchen timer application, which we translate to a desktop application using the Arrowized FRP library Yampa, a web application using the Monadic threepenny-gui library, and to hardware using the Applicative hardware description language ClaSH.Comment: arXiv admin note: text overlap with arXiv:1712.0024

    Linear Haskell: practical linearity in a higher-order polymorphic language

    Get PDF
    Linear type systems have a long and storied history, but not a clear path forward to integrate with existing languages such as OCaml or Haskell. In this paper, we study a linear type system designed with two crucial properties in mind: backwards-compatibility and code reuse across linear and non-linear users of a library. Only then can the benefits of linear types permeate conventional functional programming. Rather than bifurcate types into linear and non-linear counterparts, we instead attach linearity to function arrows. Linear functions can receive inputs from linearly-bound values, but can also operate over unrestricted, regular values. To demonstrate the efficacy of our linear type system - both how easy it can be integrated in an existing language implementation and how streamlined it makes it to write programs with linear types - we implemented our type system in GHC, the leading Haskell compiler, and demonstrate two kinds of applications of linear types: mutable data with pure interfaces; and enforcing protocols in I/O-performing functions

    Lewis meets Brouwer: constructive strict implication

    Full text link
    C. I. Lewis invented modern modal logic as a theory of "strict implication". Over the classical propositional calculus one can as well work with the unary box connective. Intuitionistically, however, the strict implication has greater expressive power than the box and allows to make distinctions invisible in the ordinary syntax. In particular, the logic determined by the most popular semantics of intuitionistic K becomes a proper extension of the minimal normal logic of the binary connective. Even an extension of this minimal logic with the "strength" axiom, classically near-trivial, preserves the distinction between the binary and the unary setting. In fact, this distinction and the strong constructive strict implication itself has been also discovered by the functional programming community in their study of "arrows" as contrasted with "idioms". Our particular focus is on arithmetical interpretations of the intuitionistic strict implication in terms of preservativity in extensions of Heyting's Arithmetic.Comment: Our invited contribution to the collection "L.E.J. Brouwer, 50 years later

    Concurrency Analysis in Javascript Programs Using Arrows

    Get PDF
    Concurrency errors are difficult to detect and correct in asynchronous programs such as those implemented in JavaScript. One reason is that it is often difficult to keep track of which parts of the program may execute in parallel and potentially share resources in unexpected, and perhaps unintended, ways. While programming constructs such as promises can help improve the readability of asynchronous JavaScript programs that were traditionally written using callbacks, there are no static tools to identify asynchronous functions that run in parallel, which may potentially cause concurrency errors. In this work, we present a solution for implementing JavaScript programs using a library based on the abstraction of arrows. We enhanced the previous implementation of the arrows library by enabling its use with Node.js and by adding parallel asynchronous path detection. Automated identification of which arrows may execute in parallel helps the programmer narrow down the possible sources of concurrency errors

    Cinnamons: A Computation Model Underlying Control Network Programming

    Full text link
    We give the easily recognizable name "cinnamon" and "cinnamon programming" to a new computation model intended to form a theoretical foundation for Control Network Programming (CNP). CNP has established itself as a programming paradigm combining declarative and imperative features, built-in search engine, powerful tools for search control that allow easy, intuitive, visual development of heuristic, nondeterministic, and randomized solutions. We define rigorously the syntax and semantics of the new model of computation, at the same time trying to keep clear the intuition behind and to include enough examples. The purposely simplified theoretical model is then compared to both WHILE-programs (thus demonstrating its Turing-completeness), and the "real" CNP. Finally, future research possibilities are mentioned that would eventually extend the cinnamon programming into the directions of nondeterminism, randomness, and fuzziness.Comment: 7th Intl Conf. on Computer Science, Engineering & Applications (ICCSEA 2017) September 23~24, 2017, Copenhagen, Denmar

    All Paths Lead to Rome

    Full text link
    All roads lead to Rome is the core idea of the puzzle game Roma. It is played on an nĂ—nn \times n grid consisting of quadratic cells. Those cells are grouped into boxes of at most four neighboring cells and are either filled, or to be filled, with arrows pointing in cardinal directions. The goal of the game is to fill the empty cells with arrows such that each box contains at most one arrow of each direction and regardless where we start, if we follow the arrows in the cells, we will always end up in the special Roma-cell. In this work, we study the computational complexity of the puzzle game Roma and show that completing a Roma board according to the rules is an \NP-complete task, counting the number of valid completions is #Ptime-complete, and determining the number of preset arrows needed to make the instance \emph{uniquely} solvable is ÎŁ2P\Sigma_2^P-complete. We further show that the problem of completing a given Roma instance on an nĂ—nn\times n board cannot be solved in time O(2o(n))\mathcal{O}\left(2^{{o}(n)}\right) under ETH and give a matching dynamic programming algorithm based on the idea of Catalan structures
    • …
    corecore