• Documents
  • Authors
  • Tables
  • Log in
  • Sign up
  • MetaCart
  • Donate

CiteSeerX logo

Advanced Search Include Citations
Advanced Search Include Citations | Disambiguate

Purely Functional Lazy Non-deterministic Programming

Cached

  • Download as a PDF

Download Links

  • [okmij.org]
  • [pobox.com]
  • [www.cs.rutgers.edu]
  • [pdf.aminer.org]
  • [www-ps.informatik.uni-kiel.de]
  • [www.cs.rutgers.edu]

  • Save to List
  • Add to Collection
  • Correct Errors
  • Monitor Changes
by Sebastian Fischer , Chung-chieh Shan
Citations:12 - 3 self
  • Summary
  • Active Bibliography
  • Co-citation
  • Clustered Documents
  • Version History

BibTeX

@MISC{Fischer_purelyfunctional,
    author = {Sebastian Fischer and Chung-chieh Shan},
    title = {Purely Functional Lazy Non-deterministic Programming},
    year = {}
}

Bookmark

citeulike Connotea Bibsonomy Del.icio.us Digg Reddit

OpenURL

 

Abstract

Functional logic programming and probabilistic programming have demonstrated the broad benefits of combining laziness (non-strict evaluation with sharing of the results) with non-determinism. Yet these benefits are seldom enjoyed in functional programming, because the existing features for non-strictness, sharing, and nondeterminism in functional languages are tricky to combine. We present a practical way to write purely functional lazy non-deterministic programs that are efficient and perspicuous. We achieve this goal by embedding the programs into existing languages (such as Haskell, SML, and OCaml) with high-quality implementations, by making choices lazily and representing data with non-deterministic components, by working with custom monadic data types and search strategies, and by providing equational laws for the programmer to reason about their code.

Citations

458 Computational lambda-calculus and monads - Moggi - 1989
332 Quickcheck: a lightweight tool for random testing of haskell programs - Claessen, Hughes - 2000 (Show Context)

Citation Context

...Gómez 2007), and express memoization (Michie 1968), which underlies dynamic programming. Since Rabin and Scott’s Turing-award paper (1959), nondeterminism has been applied to model checking, testing (=-=Claessen and Hughes 2000-=-), probabilistic inference, and search. These features are each available in mainstream functional languages. A call-by-value language can typically model nonstrict evaluation with thunks and observe ...

300 Why functional programming matters - Hughes - 1989 (Show Context)

Citation Context

...trict evaluation, sharing, and nondeterminism are all valuable features in functional programming. Nonstrict evaluation lets us express infinite data structures and their operations in a modular way (=-=Hughes, 1989-=-). Sharing lets us represent graphs with cycles, such as circuits (surveyed by Acosta-Gómez, 2007), and express memoization (Michie, 1968), which underlies dynamic programming. Since Rabin & Scott’s T...

251 Finite automata and their decision problems - Rabin, Scott - 1959
213 A basis for a mathematical theory of computation - McCarthy - 1963 (Show Context)

Citation Context

...on with thunks and observe sharing using reference cells, physical identity comparison, or a generative feature such as Scheme’s gensym or SML’s exceptions. Non-determinism can be achieved using amb (=-=McCarthy 1963-=-), threads, or first-class continuations (Felleisen 1985; Haynes 1987). In a non-strict language like Haskell, non-determinism can be expressed using a list monad Permission to make digital or hard co...

197 A Natural Semantics for Lazy Evaluation - Launchbury - 1993 (Show Context)

Citation Context

...lculi The combination of sharing and non-strictness—known as call-byneed or lazy evaluation—has been extensively investigated theoretically. The first “natural” semantics for call-by-need evaluation (=-=Launchbury 1993-=-; Seaman 1993) both rely on heaps, which store either evaluated or unevaluated bindings of variables. Later, Ariola et al. (1995), Ariola and Felleisen (1997), and Maraist et al. (1998) proposed call-...

194 A call-by-need lambda calculus - Ariola, Felleisen, et al. - 1995
157 Building domain specific embedded languages - Hudak - 1996 (Show Context)

Citation Context

...f (and is often same as) the meanings of eager non-deterministic programs. 1.1 Contributions We embed lazy non-determinism with call-time choice into mainstream functional languages in a shallow way (=-=Hudak 1996-=-), rather than, say, building a Curry interpreter in Haskell (Tolmach and Antoy 2003). This new approach is especially practical because these languages already have mature implementations, because fu...

153 Scrap your boilerplate: A practical design pattern for generic programming - Lämmel, Jones - 2003
126 Lava: Hardware design in Haskell - Bjesse, Claessen, et al. - 1999 (Show Context)

Citation Context

...oing so would require cooperation with garbage collection. 8.3 Hardware description languages The problem of explicit sharing has also been addressed in the context of hardware description languages (=-=Bjesse et al., 1998-=-; Acosta-Gómez, 2007). In order to model a circuit as an algebraic data type in a purely functional language, one needs to be able to identify shared nodes. The survey by Acosta-Gómez (2007, Section 2...

115 Lazy functional state threads - Launchbury, Jones - 1994
104 An Approach to Declarative Programming Based on a Rewrite Logic - Gonzales-Moreno, Hortala-Gonzalez, et al. - 1999 (Show Context)

Citation Context

...e the equational laws with observations of lazy nondeterministic programs with explicit sharing. Early choice. The motivation for our (Choice) law comes from Constructor-Based Rewriting Logic (CRWL) (=-=González-Moreno et al., 1999-=-), a standard formalization of FLP. To every term e (which we assume is closed in this informal explanation), CRWL assigns a denotation �e�, the set of partial values that e can reduce to. A432 S. Fi...

62 Church: a language for generative models - Goodman, Mansinghka, et al. (Show Context)

Citation Context

...ed by the test predicate. This pattern applies to propertybased test-case generation (Christiansen and Fischer 2008; Fischer and Kuchen 2007; Runciman et al. 2008) as well as probabilistic inference (=-=Goodman et al. 2008-=-; Koller et al. 1997). Given the appeal of these applications, it is unfortunate that combining the three features naively leads to unexpected and undesired results, even crashes. For example, lazy in...

57 An operational semantics for declarative multi-paradigm languages - Albert, Hanus, et al. - 2002
56 Representing layered monads - Filinski - 1999 (Show Context)

Citation Context

..., constraint solving (Nordin and Tolmach 2001), and weighted results. For example, we have applied our approach to express and sample from probability distributions as OCaml programs in direct style (=-=Filinski 1999-=-). With less development effort than state-of-theart systems, we achieved comparable concision and performance (Kiselyov and Shan 2009). The implementation of our monad transformer is available as a H...

54 A semantics for imprecise exceptions - Jones, Reid, et al. - 1999 (Show Context)

Citation Context

... nondeterministic programming 443 We use the IO type to account for the unspecified order and multiplicities of computed results (which is similar to the role IO plays in imprecise exceptions (Peyton =-=Jones et al., 1999-=-)). As the result list is computed lazily, this function can be used to implement an interactive eval-print loop for querying results (see the Appendix). 6 Generalized, efficient implementation In thi...

50 Effective Bayesian inference for stochastic programs - Koller, McAllester, et al. - 1997 (Show Context)

Citation Context

...ate. This pattern applies to propertybased test-case generation (Christiansen and Fischer 2008; Fischer and Kuchen 2007; Runciman et al. 2008) as well as probabilistic inference (Goodman et al. 2008; =-=Koller et al. 1997-=-). Given the appeal of these applications, it is unfortunate that combining the three features naively leads to unexpected and undesired results, even crashes. For example, lazy in OCaml is not thread...

45 The call-by-need lambda calculus - Maraist, Odersky, et al. - 1998
40 Functional logic design patterns - Antoy, Hanus - 2002 (Show Context)

Citation Context

... shown, the expressive power of non-determinism simplifies programs because different non-deterministic results can be viewed individually rather than as members of a (multi-)set of possible results (=-=Antoy and Hanus 2002-=-). In Haskell, we can express non-deterministic computations using lists (Wadler 1985) or, more generally, monads that are instances of the type class MonadPlus. A monad m is a type constructor that p...

38 Overlapping rules and logic variables in functional logic programs - Antoy, Hanus - 2005 (Show Context)

Citation Context

...logic variables—perhaps the most conspicuous feature of FLP—and the associated solution techniques of narrowing and residuation, but logic variables can be emulated using nondeterministic generators (=-=Antoy & Hanus, 2006-=-). We present our concrete code in Haskell, but we have also implemented our approach in OCaml. Our monadic computations perform competitively against corresponding computations in Curry that use nond...

36 Logic continuations - Haynes - 1986 (Show Context)

Citation Context

...tity comparison, or a generative feature such as Scheme’s gensym or SML’s exceptions. Non-determinism can be achieved using amb (McCarthy 1963), threads, or first-class continuations (Felleisen 1985; =-=Haynes 1987-=-). In a non-strict language like Haskell, non-determinism can be expressed using a list monad Permission to make digital or hard copies of all or part of this work for personal or classroom use is gra...

28 How to replace failure by a list of successes — A method for exception handling, backtracking, and pattern matching in lazy functional languages - Wadler - 1985 (Show Context)

Citation Context

...e achieved using amb (McCarthy, 1963), threads, or first-class continuations (Felleisen, 1985; Haynes, 1987). In a nonstrict language like Haskell, nondeterminism can be expressed using a list monad (=-=Wadler, 1985-=-) or another MonadPlus instance, and sharing can be represented using a state monad (Acosta-Gómez, 2007, Section 2.4.1). These features are particularly useful together. For instance, sharing the resu...

26 Smallcheck and Lazy Smallcheck: Automatic exhaustive testing for small values - Runciman, Naylor, et al. - 2008 (Show Context)

Citation Context

... to generate candidate solutions only to the extent demanded by the test predicate. This pattern applies to propertybased test-case generation (Christiansen and Fischer 2008; Fischer and Kuchen 2007; =-=Runciman et al. 2008-=-) as well as probabilistic inference (Goodman et al. 2008; Koller et al. 1997). Given the appeal of these applications, it is unfortunate that combining the three features naively leads to unexpected ...

21 Transliterating prolog into scheme - Felleisen - 1985 (Show Context)

Citation Context

...s, physical identity comparison, or a generative feature such as Scheme’s gensym or SML’s exceptions. Non-determinism can be achieved using amb (McCarthy 1963), threads, or first-class continuations (=-=Felleisen 1985-=-; Haynes 1987). In a non-strict language like Haskell, non-determinism can be expressed using a list monad Permission to make digital or hard copies of all or part of this work for personal or classro...

21 Systematic generation of glass-box test cases for functional logic programs - Fischer, Kuchen - 2007 (Show Context)

Citation Context

...nerate strategy, which is to generate candidate solutions only to the extent demanded by the test predicate. This pattern applies to propertybased test-case generation (Christiansen and Fischer 2008; =-=Fischer and Kuchen 2007-=-; Runciman et al. 2008) as well as probabilistic inference (Goodman et al. 2008; Koller et al. 1997). Given the appeal of these applications, it is unfortunate that combining the three features naivel...

21 Why functional programming matters. The computer journal - Hughes - 1989 (Show Context)

Citation Context

...ict evaluation, sharing, and non-determinism are all valuable features in functional programming. Non-strict evaluation lets us express infinite data structures and their operations in a modular way (=-=Hughes 1989-=-). Sharing lets us represent graphs with cycles, such as circuits (surveyed by Acosta-Gómez 2007), and express memoization (Michie 1968), which underlies dynamic programming. Since Rabin and Scott’s T...

20 Memo functions and machine learning. Nature 218 - Michie - 1968 (Show Context)

Citation Context

... infinite data structures and their operations in a modular way (Hughes 1989). Sharing lets us represent graphs with cycles, such as circuits (surveyed by Acosta-Gómez 2007), and express memoization (=-=Michie 1968-=-), which underlies dynamic programming. Since Rabin and Scott’s Turing-award paper (1959), nondeterminism has been applied to model checking, testing (Claessen and Hughes 2000), probabilistic inferenc...

19 Embedded probabilistic programming, in - Kiselyov, Shan (Show Context)

Citation Context

...d sample from probability distributions as OCaml programs in direct style (Filinski 1999). With less development effort than state-of-theart systems, we achieved comparable concision and performance (=-=Kiselyov and Shan 2009-=-). The implementation of our monad transformer is available as a Hackage package at: http://hackage.haskell.org/cgi-bin/ hackage-scripts/package/explicit-sharing-0.1 5.1 Non-deterministic data We have...

17 On a tighter integration of functional and logic programming - Brassel, Huch - 2007
16 A simple rewrite notion for call-time choice semantics - López-Fraguas, Rodríguez-Hortalá, et al. - 2007 (Show Context)

Citation Context

...yov et al. 2005), the usual monadic encoding of nondeterminism in Haskell loses non-strictness (see §2.2). The triple combination has also been challenging for theoreticians and practitioners of FLP (=-=López-Fraguas et al. 2007-=-, 2008). After all, Algol has made us wary of combining non-strictness with any effect. The FLP community has developed a sound combination of laziness and non-determinism, call-time choice, embodied ...

14 The Kiel Curry System KiCS - Braßel, Huch - 2009 (Show Context)

Citation Context

...n for non-deterministic data, our approach is typed. This tight integration with Haskell lets us be much more efficient than is possible using an interpreter. The KiCS compiler from Curry to Haskell (=-=Braßel and Huch 2009-=-) also aims to exploit the fact that many functional logic programs contain large deterministic parts. Unlike our approach, KiCS does not use monads to implement sharing but generates unique identifie...

13 Easycheck – test data for free - Christiansen, Fischer - 2008 (Show Context)

Citation Context

... the more efficient test-and-generate strategy, which is to generate candidate solutions only to the extent demanded by the test predicate. This pattern applies to propertybased test-case generation (=-=Christiansen and Fischer 2008-=-; Fischer and Kuchen 2007; Runciman et al. 2008) as well as probabilistic inference (Goodman et al. 2008; Koller et al. 1997). Given the appeal of these applications, it is unfortunate that combining ...

13 Infinite sets that admit fast exhaustive search - Escardó - 2007 (Show Context)

Citation Context

...ds the result False if n>0. It does not terminate if n<=0 because an infinite list cannot be identified as being sorted without considering each of its elements. In this sense, isSorted is not total (=-=Escardó, 2007-=-). In a nonstrict language, variables can be bound to not yet evaluated expressions rather than only fully evaluated values like in a call-by-value language. This allows to evaluate arguments of funct...

12 Implementing functional logic languages using multiple threads and stores - Tolmach, Antoy, et al.
11 Lazy evaluation and delimited control - Garcia, Lumsdaine, et al. - 2009
11 Backtracking, interleaving, and terminating monad transformers (functional pearl - Kiselyov, Shan, et al. - 2005 (Show Context)

Citation Context

... the delayed computation raises an exception, let alone backtracks. Although sharing and nondeterminism can be combined in Haskell by building a state monad that is a MonadPlus instance (Hinze, 2000; =-=Kiselyov et al., 2005-=-), the usual monadic encoding of nondeterminism in Haskell loses nonstrictness (see Section 2.2). The triple combination has also been challenging for theoreticians and practitioners of FLP (López-Fra...

11 The orc programming language - Kitchin, Quark, et al. - 2009
10 Combinators for breadth-first search - Spivey
9 Refining first-class stores - Morrisett - 1993 (Show Context)

Citation Context

...o (\ts -> unMemo a ts ++ unMemo b ts) It is crucial that the thunks are passed to both alternatives separately in the implementation of mplus. The list of thunks thus constitutes a first-class store (=-=Morrisett 1993-=-)—using mutable global state to store the thunks would not suffice because thunks are created and evaluated differently in different non-deterministic branches. We can implement a very specific versio...

9 A monadic semantics for core curry - Tolmach, Antoy - 2003 (Show Context)

Citation Context

...s. 1.1 Contributions We embed lazy non-determinism with call-time choice into mainstream functional languages in a shallow way (Hudak 1996), rather than, say, building a Curry interpreter in Haskell (=-=Tolmach and Antoy 2003-=-). This new approach is especially practical because these languages already have mature implementations, because functional programmers are already knowledgeable about laziness, and because different...

8 terminating monad transformers: (functional pearl - Backtracking - 2005
8 Parallel parsing processes - Claessen
7 O.: More haste, less speed: lazy versus eager evaluation - Bird, Jones, et al. - 1997
7 Programming monads operationally with unimo - Lin - 2006 (Show Context)

Citation Context

...ation. That is, they only say that replacing certain expressions by others does not affect the (non)termination of well-typed programs3 when the monad type constructors are held abstract (Hinze 2000; =-=Lin 2006-=-). Observing a computation in our monad requires applying run then observing the result in the target monad. Each of the two steps may identify many computations. For example, the order of choices may...

6 Modular lazy search for constraint satisfaction problems - Nordin, Tolmach (Show Context)

Citation Context

...xisting functional languages. 2. The ability to plug in different underlying monads makes it possible to express techniques such as breadth-first search (Spivey 2000), heuristics, constraint solving (=-=Nordin and Tolmach 2001-=-), and weighted results. For example, we have applied our approach to express and sample from probability distributions as OCaml programs in direct style (Filinski 1999). With less development effort ...

6 An Operational Semantics of Lazy Evaluation for Analysis - Seaman - 1993 (Show Context)

Citation Context

...tion of sharing and non-strictness—known as call-byneed or lazy evaluation—has been extensively investigated theoretically. The first “natural” semantics for call-by-need evaluation (Launchbury 1993; =-=Seaman 1993-=-) both rely on heaps, which store either evaluated or unevaluated bindings of variables. Later, Ariola et al. (1995), Ariola and Felleisen (1997), and Maraist et al. (1998) proposed call-by-need calcu...

6 Rewriting and call-time choice: the HO case - López-Fraguas, Rodŕıguez-Hortalá, et al. - 2008
5 Deriving backtracking monad transformers (functional pearl - Hinze - 2000 (Show Context)

Citation Context

...nspecified if the delayed computation raises an exception, let alone backtracks. Although sharing and nondeterminism can be combined in Haskell by building a state monad that is a MonadPlus instance (=-=Hinze, 2000-=-; Kiselyov et al., 2005), the usual monadic encoding of nondeterminism in Haskell loses nonstrictness (see Section 2.2). The triple combination has also been challenging for theoreticians and practiti...

5 A functional-logic library for wired - Naylor, Axelsson, et al. - 2007
1 Hardware synthesis in ForSyDe - Acosta-Gómez - 2007 (Show Context)

Citation Context

...amming. Non-strict evaluation lets us express infinite data structures and their operations in a modular way (Hughes 1989). Sharing lets us represent graphs with cycles, such as circuits (surveyed by =-=Acosta-Gómez 2007-=-), and express memoization (Michie 1968), which underlies dynamic programming. Since Rabin and Scott’s Turing-award paper (1959), nondeterminism has been applied to model checking, testing (Claessen a...

The National Science Foundation
Apache Solr
  • About CiteSeerX
  • Submit and Index Documents
  • Privacy Policy
  • Help
  • Data
  • Source
  • Contact Us

Developed at and hosted by The College of Information Sciences and Technology

© 2007-2015 The Pennsylvania State University