ClojureScript is a compiler from a Clojure-like functional programming language to JavaScript. ClojureScript features deep integration with the Google Closure JavaScript library and whole-program optimizing compiler. ...
详细信息
ClojureScript is a compiler from a Clojure-like functional programming language to JavaScript. ClojureScript features deep integration with the Google Closure JavaScript library and whole-program optimizing compiler. ClojureScript brings efficient functional programming to JavaScript environments such as the browser, which are becoming increasingly important components of full-stack Web applications.
The Lisp programming language is often described as the first functional programming language and also as an important early AI language. In the history of functional programming, however, it occupies a rather anomalo...
详细信息
The Lisp programming language is often described as the first functional programming language and also as an important early AI language. In the history of functional programming, however, it occupies a rather anomalous position, as the circumstances of its development do not fit well with the widely accepted view that functional languages have been developed through a theoretically-inspired project of deriving practical programming languages from the lambda calculus. This paper examines the origins of Lisp in the early AI programming work of the mid-to-late 1950s, and in particular in the work of Allen Newell, Cliff Shaw and Herbert Simon. Their 1956 program, the Logic Theory Machine, introduced new ideas about data and program structures that were articulated in response to perceived limitations in existing programming technique. Later writers, notably John Backus, have described these features as constituting a "programming language style" distinct from the traditional style that preceded it. The paper examines the origins of the earlier style in practices of manual computation, analyses the key technical differences between it and the style first manifested in the Logic Theory Machine, and concludes that programming practice and experience play a large and underappreciated role in the development of programming styles and languages.
We have illustrated an approach to express probabilistic programs in *** described ideas are implemented as a collection of Haskell modules that are combined into aprobabilistic functional programming library. In addi...
详细信息
We have illustrated an approach to express probabilistic programs in *** described ideas are implemented as a collection of Haskell modules that are combined into aprobabilistic functional programming library. In addition to the examples described here, the PFPlibrary contains modules denning functions for queueing simulations, bayesian networks,predator/prey simulations, dice rolling, card playing, etc. Moreover, the library provides avisualization module to produce plots and figures that can be rendered by the R package (Maindonald& Braun, 2003). Probabilistic functional programming can be employed as a constructive approach toteach (or study!) statistics, as shown in the first two sections. Moreover, the PFP library providesabstractions that allow the high-level modeling of probabilistic scientific models and theirexecution or simulation. We have illustrated this aspect here with a toy example, but we havesuccessfully applied the library to investigate a real scientific biological problem (Allen et al.,2005). In particular, the high-level abstractions allowed us to quickly change model aspects, inmany cases immediately during discussions with biologists about the model.
Morris-style contextual equivalence - invariance of termination under any context of ground type - is the usual notion of operational equivalence for deterministic functional languages such as PCF. Contextual equivale...
详细信息
Morris-style contextual equivalence - invariance of termination under any context of ground type - is the usual notion of operational equivalence for deterministic functional languages such as PCF. Contextual equivalence is hard to establish directly. Instead, we define a labelled transition system for call-by-name PCF (and variants) and prove that CCS-style bisimilarity equals contextual equivalence. Using co-induction we establish equational laws. By considering variations of Milner's 'bisimulations up to similar to' we obtain a second co-inductive characterisation of contextual equivalence in terms of reduction behaviour and production of values. Hence we use co-induction to establish contextual equivalence in a series of stream-processing examples. We show that Milner's context lemma may be extended to our variants of PCF, but in fact our form of bisimilarity supports simpler co-inductive proofs. We sketch how these results extend to variants, including eager evaluation and the addition of sums, pairs and recursive types. (C) 1999 Elsevier Science B.V. All rights reserved.
Higher order functions provide an elegant way to express algorithms designed for implementation in hardware [1, 6-9]. By showing examples of both classic and new algorithms, I will explain why higher order functions d...
详细信息
ISBN:
(纸本)9781450336697
Higher order functions provide an elegant way to express algorithms designed for implementation in hardware [1, 6-9]. By showing examples of both classic and new algorithms, I will explain why higher order functions deserve to be studied. Next, I will consider the extent to which ideas from functional programming, and associated formal verification methods, have influenced hardware design in practice [3-5, 10]. What can we learn from looking back? You might ask "Why are methods of hardware design still important to our community?". Maybe we should just give up? One reason for not giving up is that hardware design is really a form of parallel programming. And here there is still a lot to do! Inspired by Blelloch's wonderful invited talk at ICFP 2010 [2], I still believe that functional programming has much to offer in the central question of how to program the parallel machines of today, and, more particularly, of the future. I will briefly present some of the areas where I think that we are poised to make great contributions. But maybe we need to work harder on getting our act together?
In this paper we investigate multicore parallelism in the context of functional programming by means of two quantifier-elimination procedures for Presburger Arithmetic: one is based on Cooper's algorithm and the o...
详细信息
In this paper we investigate multicore parallelism in the context of functional programming by means of two quantifier-elimination procedures for Presburger Arithmetic: one is based on Cooper's algorithm and the other is based on the Omega Test. We first develop correct-by-construction prototype implementations in a functional programming language. Thereafter, the parallelism inherent in the decision procedures is analyzed using the Directed Acyclic Graph (DAG) model of multicore parallelism. In the step from a DAG model to a parallel implementation, the parallel implementation is optimized taking into account negative factors such as cache misses, garbage collection and overhead due to task creations, because such factors may introduce sequential bottlenecks with severe consequences for the parallel efficiency. The experiments were conducted using the functional programming language F# and .NET platform executing on an 8-core machine. A speedup of approximately 4 was obtained for Cooper's algorithm and a speedup of approximately 6 was obtained for the exact-shadow part of the Omega Test. The considered procedures are complex, memory-intense algorithms on huge formula trees and the case study reveals more general applicable techniques and guideline for deriving parallel algorithms from sequential ones in the context of data-intensive tree algorithms. The obtained insights should apply for any strict and impure functional programming language. Furthermore, the results obtained for the exact-shadow elimination procedure have a wider applicability because they can directly be transferred to the Fourier-Motzkin elimination method. (C) 2014 Elsevier Inc. All rights reserved.
Modern functional programming languages and lazy functional techniques are useful for describing and implementing abstract mathematical objects in quantum mechanics. Scientists can use them both for pedagogical purpos...
详细信息
Modern functional programming languages and lazy functional techniques are useful for describing and implementing abstract mathematical objects in quantum mechanics. Scientists can use them both for pedagogical purposes and for real, not too computationally intensive, but conceptually and algorithmically difficult applications. This article shows how to perform simple abstract computations on state vectors and discusses the construction of lazy algorithms that enormously simplify manipulation of potentially infinite data structures or iterative processes. Lazy functional techniques can often replace the use of symbolic computer algebra packages, while also offering an interesting algorithmic complement to the manipulation of mathematical data. These techniques are more efficient than blindly used symbolic algebra and are easy to integrate with the numerical code.
The combined use of user-defined infix operators and higher order functions allows the programmer to invent new control structures tailored to a particular problem area. This paper is to suggest that such a combinatio...
详细信息
The combined use of user-defined infix operators and higher order functions allows the programmer to invent new control structures tailored to a particular problem area. This paper is to suggest that such a combination has beneficial effects on the ease of both writing and reading programs, and hence can increase programmer productivity. As an example, a parser for a simple language is presented in this style. The compactness of this parser and its notational similarity to the BNF of the language are important advantages of the approach taken. It is hoped that the presentation will be palatable to people unfamiliar with the concepts of functional programming.
Correct handling of names and binders is an important issue in meta-programming. This paper presents an embedding of constraint logic programming into the alpha ML functional programming language, which provides a pro...
详细信息
Correct handling of names and binders is an important issue in meta-programming. This paper presents an embedding of constraint logic programming into the alpha ML functional programming language, which provides a provably correct means of implementing proof search computations over inductive definitions involving names and binders modulo alpha-equivalence. We show that the execution of proof search in the alpha ML operational semantics is sound and complete with regard to the model-theoretic semantics of formulae, and develop a theory of contextual equivalence for the subclass of alpha ML expressions which correspond to inductive definitions and formulae. In particular, we prove that alpha ML expressions, which denote inductive definitions, are contextually equivalent precisely when those inductive definitions have the same model-theoretic semantics. This paper is a revised and extended version of the conference paper (Lakin, M. R. & Pitts, A. M. (2009) Resolving inductive definitions with binders in higher-order typed functional programming. In Proceedings of the 18th European Symposium on programming (ESOP 2009), Castagna, G. (ed), Lecture Notes in Computer Science, vol. 5502. Berlin, Germany: Springer-Verlag, pp. 47-61) and draws on material from the first author's PhD thesis (Lakin, M. R. (2010) An Executable Meta-Language for Inductive Definitions with Binders. University of Cambridge, UK).
C-Rules is a business rules management system developed by Constraint Technologies International (***) that is designed for use in transport, travel and logistics problems. Individual businesses within these industrie...
详细信息
C-Rules is a business rules management system developed by Constraint Technologies International (***) that is designed for use in transport, travel and logistics problems. Individual businesses within these industries often need to solve the same kinds of problems related to scheduling of operations, resource allocation, staff rostering and so on, but each organisation has its own rules and procedures. Furthermore, these problems tend to be combinatorially challenging: before a final solution is chosen, many potential choices need to be generated, evaluated and compared. In C-Rules, users define rules that describe various aspects of a problem. These rules can be invoked from an application, which is typically either an optimising solver or an interactive planning tool. Rules can be used to encode evaluation criteria, such as the legality or cost of a proposed solution, or values like configuration parameters that may be used by the host application to tune or direct its progress. At its core, C-Rules provides a functional expression language that affords users power and flexibility when formulating rules. In this paper we will describe our experiences of using functional programming both at the end-user level and at the implementation level. We highlight some of the benefits of basing our rule system on features such as higher-order functions, referential transparency and static, polymorphic typing. We also outline some of our experiences in using Haskell to build an efficient compiler for the core language.
暂无评论