Skip to main content

And... Action! – Monoid Actions and (Pre)orders

  • Conference paper
  • First Online:
Declarative Programming and Knowledge Management (INAP 2013, WLP 2013, WFLP 2013)

Abstract

Orders occur naturally in many areas of computer science and mathematics. In several cases it is very simple do describe an order mathematically, but it may be cumbersome to implement in some programming language. On the other hand many order relations are defined in terms of an existential quantification. We provide a simple abstraction of such definitions using the well-known concept of monoid actions and furthermore show that in fact every order relation can be obtained from a specific monoid action.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Institutional subscriptions

Notes

  1. 1.

    A reflexive and transitive relation is called preorder.

  2. 2.

    All of these can be considered functional classes in the sense of set theory.

  3. 3.

    Actually we should have written \(+ : {\mathbb {N}}\times \mathbb Z\rightarrow \mathbb Z\) for congruence with the following definition. The reason we did not is that for the three examples the monoid is better placed in the second component, whereas from a mathematical point of view it is more convenient to place it in the first one.

  4. 4.

    The cited source deals with finite state sets only, but the technique easily carries over to infinite sets as well.

  5. 5.

    In fact \(\leadsto _G\) is the reflexive-transitive closure of \(E\), cf. [9].

  6. 6.

    Clearly this is a greatly simplified approach, since not every function \( f \mathbin {::}\mu \rightarrow \alpha \rightarrow \alpha \) is a monoid action. A user has to verify that \(\mu \) is a monoid and \( f \) is a monoid action to ensure that \( preOrder \, f \) is in fact a preorder. Alternatively, a proof assistant (e.g. Coq [4]) can be used to guarantee that \( preOrder \) is applicable only once the necessary conditions have been proved.

  7. 7.

    It is simple (but lengthy) to define the integers based on the naturals and to extend the definitions of \(\oplus \) and \(\sqsubseteq _\oplus \) to allow the implementation of \(\le _\mathbb Z\).

  8. 8.

    An order \(\le \subseteq A \times A\) is called total iff for all \(x, y \in A\) it is true that \(x \le y\) or \(y \le x\).

  9. 9.

    The pattern matching in the first rule makes the rules non-overlapping.

References

  1. Aluffi, P.: Algebra: Chapter 0. AMS, London (2009)

    Google Scholar 

  2. Antoy, S., Hanus, M.: Overlapping rules and logic variables in functional logic programs. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 87–101. Springer, Heidelberg (2006)

    Google Scholar 

  3. Antoy, S., Hanus, M.: Set functions for functional logic programming. In: Proceedings of the 11th International ACM SIGPLAN Conference on Principle and Practice of Declarative Programming (PPDP’09), pp. 73–82. ACM Press (2009)

    Google Scholar 

  4. Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions. Springer, Heidelberg (2004)

    Google Scholar 

  5. Braßel, B., Fischer, S., Hanus, M., Reck, F.: Transforming functional logic programs into monadic functional programs. In: Mariño, J. (ed.) WFLP 2010. LNCS, vol. 6559, pp. 30–47. Springer, Heidelberg (2011)

    Google Scholar 

  6. Braßel, B., Hanus, M., Peemöller, B., Reck, F.: KiCS2: a new compiler from Curry to Haskell. In: Kuchen, H. (ed.) WFLP 2011. LNCS, vol. 6816, pp. 1–18. Springer, Heidelberg (2011)

    Google Scholar 

  7. Hanus, M. (ed.).: Curry: An Integrated Functional Logic Language (Vers. 0.8.3) (2012). http://www.curry-language.org

  8. Holcombe, W.M.L.: Algebraic Automata Theory. Cambridge University Press, Cambridge (1982)

    Google Scholar 

  9. Schmidt, G., Ströhlein, T.: Relations and Graphs. Springer, Heidelberg (1993)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nikita Danilenko .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Danilenko, N. (2014). And... Action! – Monoid Actions and (Pre)orders. In: Hanus, M., Rocha, R. (eds) Declarative Programming and Knowledge Management. INAP WLP WFLP 2013 2013 2013. Lecture Notes in Computer Science(), vol 8439. Springer, Cham. https://doi.org/10.1007/978-3-319-08909-6_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-08909-6_6

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-08908-9

  • Online ISBN: 978-3-319-08909-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics