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

@article{Pirg2017BacktrackingWC,
  title={Backtracking with cut via a distributive law and left-zero monoids*},
  author={Maciej Pir{\'o}g and Sam Staton},
  journal={Journal of Functional Programming},
  year={2017},
  volume={27}
}
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. 

No-Go Theorems for Distributive Laws

  • M. ZwartDan Marsden
  • Mathematics
    2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)
  • 2019
TLDR
Two families of theorems for showing when there can be no distributive law for two monads are presented, widely generalizing a counterexample attributed to Plotkin and encompassing various new practical situations.

Equational Theories and Monads from Polynomial Cayley Representations

TLDR
CayMon, a tool that takes a polynomial as an input and generates the corresponding equational theory together with the two implementations of the induced monad in Haskell is introduced.

Preservation of Equations by Monoidal Monads

TLDR
This paper shows a converse: if the monad at hand preserves a drop equation, then it must be affine, and shows that the problem whether a given (drop) equation is preserved is undecidable.

123 Flexible Presentations of Graded Monads

A large class of monads used to model computational effects have natural presentations by operations and equations, for example, the list monad can be presented by a constant and a binary operation

Don't Try This at Home: No-Go Theorems for Distributive Laws

TLDR
This work develops general-purpose techniques for showing when there can be no distributive law between two monads, and adopts an algebraic perspective throughout, exploiting a syntactic characterization of distributive laws.

Flexible presentations of graded monads

A large class of monads used to model computational effects have natural presentations by operations and equations, for example, the list monad can be presented by a constant and a binary operation

References

SHOWING 1-10 OF 15 REFERENCES

Eilenberg-Moore Monoids and Backtracking Monad Transformers

TLDR
An algebraic underpinning of backtracking monad transformers in the general setting of monoidal categories is developed and an Eilenberg–Moore monoid of endomorphisms is constructed, which, via the codensity monad construction, yields a continuation-based implementation a la Hinze.

Monad transformers as monoid transformers

Deriving backtracking monad transformers

TLDR
This work applies two fundamental techniques for deriving programs from their specification to derive a backtracking monad transformer that adds backtracking to an arbitrary monad.

Computational Effects and Operations: An Overview

Simple Operational and Denotational Semantics for Prolog with Cut

Kan Extensions for Program Optimisation Or: Art and Dan Explain an Old Trick

TLDR
The theoretical underpinnings of so-called absolute Kan Extensions underlie this program optimisation, and a two-dimensional notation based on string diagrams is proposed that aims to support effective reasoning with Kan extensions.

Term rewriting and all that

TLDR
Term Rewriting and All That is a self-contained introduction to the field of term rewriting and covers all the basic material including abstract reduction systems, termination, confluence, completion, and combination problems.

Handling Algebraic Effects

TLDR
This work generalises exception handlers to arbitrary algebraic effects, and includes many previously unrelated examples from both theory and practice, including relabelling and restriction in Milner's CCS, timeout, rollback, and stream redirection.

Discrete Lawvere theories and computational effects

Combining effects: Sum and tensor