## Generic Programming for Domain Reasoners (2009)

Citations: | 1 - 1 self |

### BibTeX

@MISC{Jeuring09genericprogramming,

author = {Johan Jeuring and José Pedro Magalhães and Bastiaan Heeren and Www. Cs. Uu. Nl Issn and Johan Jeuring and José Pedro Magalhães and Bastiaan Heeren},

title = {Generic Programming for Domain Reasoners},

year = {2009}

}

### OpenURL

### Abstract

Abstract: An exercise assistant is a tool that supports students learning procedural skills, such as solving systems of linear equations, or rewriting a logic expression to disjunctive normal form. The domain reasoner is the component of an exercise assistant that deals with tasks that depend on the semantics of a particular domain, for example the rules that may be applied, or the procedure that should be followed when solving an exercise. An exercise assistant typically has multiple domain reasoners, and the behavior of each of these is, to a large extent, determined by the domain. Generic programming techniques claim to reduce code duplication, to make it easier to change the structure of data, and to provide implementations of many useful functions on most datatypes. There are many libraries for generic programming, all with different datatype support, expressiveness, and ease of use. While a lot of effort has been put into developing new libraries in the past few years, there are few examples of real-life applications of generic programming. In this paper we describe our experience with applying generic programming techniques to our domain reasoners implemented in Haskell. We have used the Uniplate, Multirec, and Regular generic programming libraries. We assess and compare the resulting generic domain reasoners with each other and with the initial, non-generic version, using the software quality factors of the ISO 9126 international standard.

### Citations

95 | The zipper
- Huet
- 1997
(Show Context)
Citation Context ...e pretty-printed expressions almost never contain unnecessary parentheses, a user is generally unaware of associativity. For increased reliability in the traversals, we want to use the generic zipper =-=[11]-=-. There is an implementation of a zipper for Multirec using type-indexed datatypes through type families. This implementation can easily be converted to Regular. This would replace the current untyped... |

59 |
et al. Haskell 98 Language and Libraries: the Revised Report
- Jones
- 2003
(Show Context)
Citation Context ... family type has to be propagated through the entire code. This reduces the overall readability and maintainability of the code. Portability The original domain reasoners were developed in Haskell 98 =-=[18]-=-, which made the portability of the domain reasoners good. When we moved to generic domain reasoners we first used an embedded implementation of Uniplate. This implementation was a subset of the Unipl... |

53 |
Scrap your boilerplate: a practical approach to generic programming
- Lämmel, Jones
- 2003
(Show Context)
Citation Context ...gramming libraries in Haskell that give the user access to the recursive structure of values: Uniplate [15], Regular [16], and Multirec [20] in a straightforward way, and Scrap Your Boilerplate (SYB) =-=[13]-=- in a rather cumbersome way (see the Uniplate module Data.Generics.PlateData which implements Uniplate using SYB). We have three implementations of a generic domain reasoner, one using Uniplate, one u... |

25 | Generic programming with fixed points for mutually recursive datatypes
- Yakushev, Holdermans, et al.
- 2008
(Show Context)
Citation Context ...ursive structure of the domain. There are only a few generic programming libraries in Haskell that give the user access to the recursive structure of values: Uniplate [15], Regular [16], and Multirec =-=[20]-=- in a straightforward way, and Scrap Your Boilerplate (SYB) [13] in a rather cumbersome way (see the Uniplate module Data.Generics.PlateData which implements Uniplate using SYB). We have three impleme... |

24 | A lightweight approach to datatype-generic rewriting
- Noort, Rodriguez, et al.
- 2008
(Show Context)
Citation Context ...eed to know the recursive structure of the domain. There are only a few generic programming libraries in Haskell that give the user access to the recursive structure of values: Uniplate [15], Regular =-=[16]-=-, and Multirec [20] in a straightforward way, and Scrap Your Boilerplate (SYB) [13] in a rather cumbersome way (see the Uniplate module Data.Generics.PlateData which implements Uniplate using SYB). We... |

20 |
Interactivity of Exercises in ActiveMath
- Goguadze, Palomo, et al.
- 2005
(Show Context)
Citation Context ... derivative or integral of a function [7, 8, 14, 17]. Our domain reasoners offer the functionality as described above as web services [5]. Several exercise assistants, such as MathDox [4], ActiveMath =-=[6]-=-, and the Freudenthal digital mathematics environment (DWO) [3], use our domain reasoning web services. At the moment we develop and maintain our own domain reasoners, but in the future we expect user... |

20 | Yakushev. Libraries for generic programming in Haskell
- Jeuring, Leather, et al.
- 2008
(Show Context)
Citation Context ...ion trees, at which Haskell is good. Later, when we decided to make our domain reasoners generic, this turned out to be right choice, since there are many approaches to generic programming in Haskell =-=[10, 21]-=-. Types (domains) play an important role in our software, and we also want to use typed approaches to generic programming, which discards an approach like DrIFT and other approaches based on meta prog... |

19 |
Uniform boilerplate and list processing
- MITCHELL, RUNCIMAN
- 2007
(Show Context)
Citation Context ...lies that we need to know the recursive structure of the domain. There are only a few generic programming libraries in Haskell that give the user access to the recursive structure of values: Uniplate =-=[15]-=-, Regular [16], and Multirec [20] in a straightforward way, and Scrap Your Boilerplate (SYB) [13] in a rather cumbersome way (see the Uniplate module Data.Generics.PlateData which implements Uniplate ... |

13 | Specifying strategies for exercises
- Heeren, Jeuring, et al.
(Show Context)
Citation Context ...omials, rewriting a logical term to disjunctive normal form, rewriting relation algebra terms, developing (extended) lambda-calculus programs, and determining the derivative or integral of a function =-=[7, 8, 14, 17]-=-. Our domain reasoners offer the functionality as described above as web services [5]. Several exercise assistants, such as MathDox [4], ActiveMath [6], and the Freudenthal digital mathematics environ... |

10 | MathDox : mathematical documents on the web
- Cohen, Cuypers, et al.
- 2006
(Show Context)
Citation Context ... determining the derivative or integral of a function [7, 8, 14, 17]. Our domain reasoners offer the functionality as described above as web services [5]. Several exercise assistants, such as MathDox =-=[4]-=-, ActiveMath [6], and the Freudenthal digital mathematics environment (DWO) [3], use our domain reasoning web services. At the moment we develop and maintain our own domain reasoners, but in the futur... |

9 | Feedback services for exercise assistants
- Gerdes, Heeren, et al.
- 2008
(Show Context)
Citation Context ...eveloping (extended) lambda-calculus programs, and determining the derivative or integral of a function [7, 8, 14, 17]. Our domain reasoners offer the functionality as described above as web services =-=[5]-=-. Several exercise assistants, such as MathDox [4], ActiveMath [6], and the Freudenthal digital mathematics environment (DWO) [3], use our domain reasoning web services. At the moment we develop and m... |

9 |
Comparing approches to generic programming in Haskell. Pages 72–149 of: Spring school on datatype-generic programming
- Hinze, Jeuring, et al.
- 2007
(Show Context)
Citation Context ...ion trees, at which Haskell is good. Later, when we decided to make our domain reasoners generic, this turned out to be right choice, since there are many approaches to generic programming in Haskell =-=[10, 21]-=-. Types (domains) play an important role in our software, and we also want to use typed approaches to generic programming, which discards an approach like DrIFT and other approaches based on meta prog... |

9 | Feedback in an interactive equation solver
- Passier, Jeuring
- 2006
(Show Context)
Citation Context ...omials, rewriting a logical term to disjunctive normal form, rewriting relation algebra terms, developing (extended) lambda-calculus programs, and determining the derivative or integral of a function =-=[7, 8, 14, 17]-=-. Our domain reasoners offer the functionality as described above as web services [5]. Several exercise assistants, such as MathDox [4], ActiveMath [6], and the Freudenthal digital mathematics environ... |

8 | Optimizing generic functions
- Alimarine, Smetsers
- 2004
(Show Context)
Citation Context ... the necessary optimizations to remove the generic representation types and conversion functions from the compiled code. While this has been shown to be possible in at least the approach of Alimarine =-=[1]-=-, in the general case it remains an open problem. In Rodriguez [19], a simple benchmark of generic programming libraries is performed. The two Uniplate functions tested are approximately 5 times slowe... |

8 |
Generic programming—an introduction
- Backhouse, Jansson, et al.
- 1999
(Show Context)
Citation Context ...erating exercises, traversing terms, determining the top-level equality of two terms, etc. To avoid reimplementing the same functionality for every domain, we have used generic programming techniques =-=[2]-=- to implement rewriting, traversals, etc. once and for all domains.4 CHAPTER 1. GENERIC PROGRAMMING FOR DOMAIN REASONERS We have implemented our domain reasoners in Haskell. Initially we chose Haskel... |

8 | Recognizing strategies
- Heeren, Jeuring
- 2009
(Show Context)
Citation Context ...omials, rewriting a logical term to disjunctive normal form, rewriting relation algebra terms, developing (extended) lambda-calculus programs, and determining the derivative or integral of a function =-=[7, 8, 14, 17]-=-. Our domain reasoners offer the functionality as described above as web services [5]. Several exercise assistants, such as MathDox [4], ActiveMath [6], and the Freudenthal digital mathematics environ... |

7 |
Algebra en applets, leren en onderwijzen (algebra and applets, learning and teaching
- Boon, Drijvers
- 2005
(Show Context)
Citation Context ...n reasoners offer the functionality as described above as web services [5]. Several exercise assistants, such as MathDox [4], ActiveMath [6], and the Freudenthal digital mathematics environment (DWO) =-=[3]-=-, use our domain reasoning web services. At the moment we develop and maintain our own domain reasoners, but in the future we expect users of our services to add or adapt domains. Furthermore, we are ... |

4 |
S.:Using IDEAS in teaching logic, lessons learned
- Lodder, Passier, et al.
- 2008
(Show Context)
Citation Context |

2 |
To appear
- Hesselink
- 2009
(Show Context)
Citation Context ...rue :+: C F U -- false Regular does not support parametric datatypes or datatypes containing lists. However, we have investigated the possibility of changing the library to add support for parameters =-=[9]-=- and functor composition (of which datatypes with lists are a special case). Both extensions seem possible and do not lead to much increased code complexity. After having used Multirec, we realized ou... |

2 |
Towards Getting Generic Programming Ready for Prime Time
- Rodriguez
- 2009
(Show Context)
Citation Context ...r generic programming in Haskell. These differ substantially in expressiveness, datatypes supported, and usability. Recently, a detailed comparison of generic programming libraries has been performed =-=[19, 21]-=-. We have used this comparison to choose a generic programming library. 1.3.1 Datatypes in the domain reasoners Our domain reasoners currently represent several domains, such as logical expressions, r... |