Skip to main content Accessibility help
×
Home
Hostname: page-component-55b6f6c457-85hf2 Total loading time: 0.249 Render date: 2021-09-24T06:25:14.448Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": true, "newCiteModal": false, "newCitedByModal": true, "newEcommerce": true, "newUsageEvents": true }

Backtracking with cut via a distributive law and left-zero monoids*

Published online by Cambridge University Press:  13 July 2017

MACIEJ PIRÓG
Affiliation:
University of Wrocław, Poland (e-mail: maciej.adam.pirog@gmail.com)
SAM STATON
Affiliation:
University of Oxford, UK

Abstract

We employ the framework of algebraic effects to augment the list monad with the pruning cut operator known from Prolog. We give two descriptions of the resulting monad: as the monad of free left-zero monoids, and as a composition via a distributive law of the list monad and the ‘unary idempotent operation’ monad. The scope delimiter of cut arises as a handler.

Type
Theoretical Pearls
Copyright
Copyright © Cambridge University Press 2017 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Footnotes

*

Research supported by a Royal Society University Research Fellowship and EPSRC Grant EP/N007387/1

References

Baader, F. & Nipkow, T. (1998) Term Rewriting and All That. Cambridge University Press.CrossRefGoogle Scholar
Barr, M. & Wells, C. (1985) Toposes, Triples and Theories. Springer-Verlag.CrossRefGoogle Scholar
Beck, J. M. (1969) Distributive laws. In Seminar on Triples and Categorical Homology Theory, Lecture Notes in Mathematics, vol. 80. Berlin/Heidelberg: Springer, pp. 119140.CrossRefGoogle Scholar
Billaud, M. (1990) Simple operational and denotational semantics for Prolog with cut. Theor. Comput. Sci. 71 (2), 193208.CrossRefGoogle Scholar
Bird, R. S. (2006) Functional pearl: A program to solve Sudoku. J. Funct. Progr. 16 (6), 671679.CrossRefGoogle Scholar
Cheng, E. (2011) Distributive laws for Lawvere theories. Algebra Universalis. arXiv:1112.3076.Google Scholar
Hinze, R. (2000) Deriving backtracking monad transformers. In Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming (ICFP '00), pp. 186–197.Google Scholar
Hinze, R. (2012) Kan extensions for program optimisation or: Art and Dan explain an old trick. In Proceedings of Mathematics of Program Construction—11th International Conference, MPC 2012, Lecture Notes in Computer Science, vol. 7342. Berlin/Heidelberg: Springer, pp. 324–362.Google Scholar
Hyland, M. & Power, J. (2006) Discrete Lawvere theories and computational effects. Theor. Comput. Sci. 366 (1), 144162.CrossRefGoogle Scholar
Hyland, M., Plotkin, G. D. & Power, J. (2006) Combining effects: Sum and tensor. Theor. Comput. Sci. 357 (1–3), 7099.CrossRefGoogle Scholar
Jaskelioff, M. & Moggi, E. (2010) Monad transformers as monoid transformers. Theor. Comput. Sci. 411 (51–52), 44414466.CrossRefGoogle Scholar
Mac Lane, S. (1998) Categories for the Working Mathematician, 2nd ed. Springer.Google Scholar
Piróg, M. (2016) Eilenberg–Moore monoids and backtracking monad transformers. In Proceedings 6th Workshop on Mathematically Structured Functional Programming, Electronic Proceedings in Theoretical Computer Science, vol. 207, pp. 23–56.Google Scholar
Plotkin, G. D. & Power, A. J. (2004) Computational effects and operations: An overview. Electron. Notes Theor. Comput. Sci. 73, 149163.CrossRefGoogle Scholar
Plotkin, G. D. & Pretnar, M. (2013) Handling algebraic effects. Log. Methods Comput. Sci. 9 (4).CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.
2
Cited by

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Backtracking with cut via a distributive law and left-zero monoids*
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Backtracking with cut via a distributive law and left-zero monoids*
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Backtracking with cut via a distributive law and left-zero monoids*
Available formats
×
×

Reply to: Submit a response

Please enter your response.

Your details

Please enter a valid email address.

Conflicting interests

Do you have any conflicting interests? *