## Performance Analysis and Design Aids

### BibTeX

@MISC{Naylor_performanceanalysis,

author = {Matthew Naylor and A Functional-logic and Library Wired},

title = {Performance Analysis and Design Aids},

year = {}

}

### OpenURL

### Abstract

We develop a Haskell library for functional-logic programming, motivated by the implementation of Wired, a relational embedded domain-specific language for describing and analysing digital circuits at the VLSI-layout level. Compared to a previous library for logic programming by Claessen and Ljunglöf, we support residuation, easier creation of logical data types, and pattern matching. We discuss other applications of our library, including test-data generation, and various extensions, including lazy narrowing.

### Citations

1353 | Introduction to Functional Programming
- Bird, Wadler
- 1988
(Show Context)
Citation Context ...state partially maps logical variables to values. In a pure functional language such as Haskell, both backtracking and state are computational effects that can be conveniently structured using monads =-=[16]-=-. In this section we introduce a backtracking state monad that we will later use as a basis for functional-logic programming in Haskell. The ideas presented are well established, but we summarise them... |

142 | E.: Domain specific embedded compilers
- Leijen, Meijer
- 1999
(Show Context)
Citation Context ...c Typing A problem with the universal data type representation is that every logical term has the same type, namely Uni. Leijen and Meijer propose phantom types as an elegant solution to this problem =-=[10]-=-. Their idea is to create a data type with a type parameter that does no occur in any construction. This type parameter is referred to as a phantom type. newtype Term a = Term { uni :: Uni } Now terms... |

97 | A demand driven computation strategy for lazy narrowing
- Loogen, Fraguas, et al.
- 1993
(Show Context)
Citation Context ...[(’a’,1), (’b’,3), (’a’,6)] ❀ [] Note that the definition of lookup has not changed. The add function now returns the results of all combinations of lookups. add ’a’ ’a’ [(’a’,1), (’b’,3), (’a’,6)] ❀ =-=[2, 7, 7,12]-=- add ’a’ ’c’ [(’a’,1), (’b’,3), (’a’,6)] ❀ [] 2.4 Adding State Another kind of side-effect that is useful for some computations to have is state passing, whereby state is implicitly threaded through a... |

83 |
Circuit design in Ruby
- Jones, Sheeran
- 1990
(Show Context)
Citation Context ..., a single relation can capture the behaviours of many functions. Research suggests that the use of relations over functions can have a profound effect on circuit design languages. For instance, Ruby =-=[8]-=- – a combinator-based language for describing and reasoning about circuits – is pleasingly simple because, without loss of expressitivity, relations reduce the numbers of circuit combinators and assoc... |

53 | Curry: A Truly Functional Logic Language
- Hanus, Kuchen, et al.
- 1995
(Show Context)
Citation Context ...in@cs.york.ac.uk programming features in the form of a Haskell library. This lets us keep Wired in a language that is relatively mature compared to dedicated functional-logic languages, such as Curry =-=[5]-=-, and also to integrate Wired with Lava [4], an existing Haskell library which sits a higher level of circuit abstraction. Our library is similar to the logic programming library by Claessen and Ljung... |

45 | Observable sharing for functional circuit description
- Claessen, Sands
- 1999
(Show Context)
Citation Context ...ive with this problem since the benefit over random and exhaustive data generation will still be very large. Alternatively, the problem could be solved using an impure feature like observable sharing =-=[3]-=-. In fact, since sharing cannot affect the result of evaluation, it could probably be argued that the library would still be purely functional, despite using impure features internally. Furthermore, c... |

29 | Deriving backtracking monad transformers
- Hinze
- 2001
(Show Context)
Citation Context ...on returns only the first value that is paired with the given key in the list. In backtracking, all associated values are returned as a lazily evaluated list. lookup ’a’ [(’a’,1), (’b’,3), (’a’,6)] ❀ =-=[1, 6]-=- lookup ’c’ [(’a’,1), (’b’,3), (’a’,6)] ❀ [] Note that the definition of lookup has not changed. The add function now returns the results of all combinations of lookups. add ’a’ ’a’ [(’a’,1), (’b’,3),... |

21 | Wired: Wire-aware circuit design
- Axelsson, Claessen, et al.
(Show Context)
Citation Context ...y simple because, without loss of expressitivity, relations reduce the numbers of circuit combinators and associated algebraic laws. More recently, relations have been found to be beneficial in Wired =-=[1]-=-, a language for describing and analysing circuits at the VLSIlayout level. Relations are again used to simplify the combinator set, but also to support bi-directional evaluation and a basic form of l... |

19 | P.: Typed logical variables in Haskell
- Claessen, Ljunglöf
- 2000
(Show Context)
Citation Context ...d also to integrate Wired with Lava [4], an existing Haskell library which sits a higher level of circuit abstraction. Our library is similar to the logic programming library by Claessen and Ljunglöf =-=[2]-=- (which we refer to as “Claessen’s library”), but there are several important differences. Let us illustrate them with an example. Suppose that we wish to define a list concatenation predicate, append... |

17 | Embedding Prolog in Haskell
- Spivey, Seres
- 1999
(Show Context)
Citation Context ... In this section, we discuss related work and further applications and features of our library. 5.1 Embedded Logic Programming The first embedding of logic programming in Haskell, by Seres and Spivey =-=[15]-=-, was extended by Claessen [2] to use monads and typed logical variables. In Claessen’s approach, a logical data type for lists is introduced with the declaration: data List a = VarL (Var (List a)) | ... |

16 | The design and verification of a sorter core
- Claessen, Sheeran, et al.
- 2001
(Show Context)
Citation Context ...ming; B.8.2 [Performance And Reliability]: Performance Analysis and Design Aids General Terms 1. Introduction Design, Languages Functions are great for describing the structure and layout of circuits =-=[4]-=-. They are simple, reusable, high-level, and amenable to mathematical reasoning. But relations are more general. By abstracting over the direction of data-flow, a single relation can capture the behav... |

15 |
The Design and Verification of a Sorter Core
- Claessen, Sheeran, et al.
- 2001
(Show Context)
Citation Context ...ming; B.8.2 [Performance And Reliability]: Performance Analysis and Design Aids General Terms Design, Languages 1. Introduction Functions are great for describing the structure and layout of circuits =-=[4]-=-. They are simple, reusable, high-level, and amenable to mathematical reasoning. But relations are more general. By abstracting over the direction of data-flow, a single relation can capture the behav... |

12 | Property Directed Generation of First-Order Test Data
- Lindblad
- 2007
(Show Context)
Citation Context ...veloped in Curry. Moving MiniWired over to our library was straightforward and its run-time performance under each compiler (MCC and GHC) was similar. 5.3 Application to test-data generation Lindblad =-=[11]-=- and Naylor [13] have recently shown how functionallogic programming techniques can aid property-based testing. In particular, test-data can be automatically generated that satisfies restrictive antec... |

10 | Generating Fast Multipliers Using Clever Circuits
- Sheeran
- 2004
(Show Context)
Citation Context ...age. This is important for developing circuit generators which use search for optimisation, and for so-called adaptive circuits which are parameterised by delay profiles of their input/output signals =-=[14]-=-. We are planning to experiment with adaptive circuits in Wired in the future. 5. Discussion In this section, we discuss related work and further applications and features of our library. 5.1 Embedded... |

9 | An Algebra of Scans
- Hinze
(Show Context)
Citation Context ...[(’a’,1), (’b’,3), (’a’,6)] ❀ [] Note that the definition of lookup has not changed. The add function now returns the results of all combinations of lookups. add ’a’ ’a’ [(’a’,1), (’b’,3), (’a’,6)] ❀ =-=[2, 7, 7,12]-=- add ’a’ ’c’ [(’a’,1), (’b’,3), (’a’,6)] ❀ [] 2.4 Adding State Another kind of side-effect that is useful for some computations to have is state passing, whereby state is implicitly threaded through a... |

6 |
Finding inputs that reach a target expression
- Naylor, Runciman
- 2007
(Show Context)
Citation Context .... Moving MiniWired over to our library was straightforward and its run-time performance under each compiler (MCC and GHC) was similar. 5.3 Application to test-data generation Lindblad [11] and Naylor =-=[13]-=- have recently shown how functionallogic programming techniques can aid property-based testing. In particular, test-data can be automatically generated that satisfies restrictive antecedents that prog... |

3 |
terminating monad transformers
- Backtracking
- 2005
(Show Context)
Citation Context ...eriment with this monad as the basis for our logic programming library. We may also experiment with the fair conjunction and disjunction operators (for fair backtracking) presented by Kiselyov et al. =-=[9]-=-. 5.2 Dedicated Logic Programming Predicates written using our approach look similar to corresponding Prolog predicates. One difference is that our logical variables are explicitly quantified and type... |