Skip to main content

Memoizing a Monadic Mixin DSL

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6816))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Baatar, D., Boland, N., Brand, S., Stuckey, P.: CP and IP approaches to cancer radiotherapy delivery optimization. Constraints (2011)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. Brown, D., Cook, W.R.: Function inheritance: Monadic memoization mixins. Report, Department of Computer Sciences, University of Texas at Austin (June 2006)

    Google Scholar 

  4. Brown, D., Cook, W.R.: Function inheritance: Monadic memoization mixins. In: Brazilian Symposium on Programming Languages, SBLP (2009)

    Google Scholar 

  5. 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)

    Chapter  Google Scholar 

  6. 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)

    Google Scholar 

  7. Gecode Team. Gecode: Generic constraint development environment (2006), http://www.gecode.org

  8. 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)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. 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)

    Google Scholar 

  12. Schrijvers, T., Oliveira, B.: The monad zipper. Report CW 595, Dept. of Computer Science, K.U.Leuven (2010)

    Google Scholar 

  13. Schrijvers, T., Stuckey, P.J., Wadler, P.: Monadic constraint programming. Journal of Functional Programming 19(6), 663–697 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  14. 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)

    Google Scholar 

  15. 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)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics