Abstract
Modular extensibility is a highly desirable property of a domain-specific language (DSL): the ability to add new features without affecting the implementation of existing features. Functional mixins (also known as open recursion) are very suitable for this purpose.
We study the use of mixins in Haskell for a modular DSL for search heuristics used in systematic solvers for combinatorial problems, that generate optimized CC++ code from a high-level specification. We show how to apply memoization techniques to tackle performance issues and code explosion due to the high recursion inherent to the semantics of combinatorial search.
As such heuristics are conventionally implemented as highly entangled imperative algorithms, our Haskell mixins are monadic. Memoization of monadic components causes further complications for us to deal with.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Baatar, D., Boland, N., Brand, S., Stuckey, P.: CP and IP approaches to cancer radiotherapy delivery optimization. Constraints (2011)
Bracha, G., Cook, W.R.: Mixin-based inheritance. In: Proc. of ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), pp. 303–311 (1990)
Brown, D., Cook, W.R.: Function inheritance: Monadic memoization mixins. Report, Department of Computer Sciences, University of Texas at Austin (June 2006)
Brown, D., Cook, W.R.: Function inheritance: Monadic memoization mixins. In: Brazilian Symposium on Programming Languages, SBLP (2009)
Claessen, K., Sands, D.: Observable sharing for functional circuit description. In: Thiagarajan, P.S., Yap, R.H.C. (eds.) ASIAN 1999. LNCS, vol. 1742, pp. 62–73. Springer, Heidelberg (1999)
Oliveira, B.C.d.S., Schrijvers, T., Cook, W.R.: Effectiveadvice: disciplined advice with explicit effects. In: Jézéquel, J.-M., Südholt, M. (eds.) AOSD, pp. 109–120. ACM, New York (2010)
Gecode Team. Gecode: Generic constraint development environment (2006), http://www.gecode.org
Gill, A.: Type-safe observable sharing in haskell. In: Proceedings of the 2nd ACM SIGPLAN Symposium on Haskell, Haskell 2009, pp. 117–128. ACM, New York (2009)
Nethercote, N., Stuckey, P.J., Becket, R., Brand, S., Duck, G.J., Tack, G.: MiniZinc: Towards a standard CP modelling language. In: Bessiöre, C. (ed.) CP 2007. LNCS, vol. 4741, pp. 529–543. Springer, Heidelberg (2007)
Samulowitz, H., Tack, G., Fischer, J., Wallace, M., Stuckey, P.: Towards a lightweight standard search language. In: Pearson, J., Mancini, T. (eds.) Constraint Modeling and Reformulation, ModRef 2010 (2010)
Schrijvers, T., Oliveira, B.: Modular components with monadic effects. In: Preproceedings of the 22nd Symposium on Implementation and Application of Functional Languages (IFL 2010), vol. (UU-CS-2010-020), pp. 264–277 (2010)
Schrijvers, T., Oliveira, B.: The monad zipper. Report CW 595, Dept. of Computer Science, K.U.Leuven (2010)
Schrijvers, T., Stuckey, P.J., Wadler, P.: Monadic constraint programming. Journal of Functional Programming 19(6), 663–697 (2009)
Wuille, P., Schrijvers, T.: Monadic Constraint Programming with Gecode. In: Proceedings of the 8th International Workshop on Constraint Modelling and Reformulation, pp. 171–185 (2009)
Wuille, P., Schrijvers, T.: Parameterized models for on-line and off-line use. In: Mariño, J. (ed.) WFLP 2010. LNCS, vol. 6559, pp. 101–118. Springer, Heidelberg (2011)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Wuille, P., Schrijvers, T., Samulowitz, H., Tack, G., Stuckey, P. (2011). Memoizing a Monadic Mixin DSL. In: Kuchen, H. (eds) Functional and Constraint Logic Programming. WFLP 2011. Lecture Notes in Computer Science, vol 6816. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22531-4_5
Download citation
DOI: https://doi.org/10.1007/978-3-642-22531-4_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-22530-7
Online ISBN: 978-3-642-22531-4
eBook Packages: Computer ScienceComputer Science (R0)