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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
A reflexive and transitive relation is called preorder.
- 2.
All of these can be considered functional classes in the sense of set theory.
- 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.
The cited source deals with finite state sets only, but the technique easily carries over to infinite sets as well.
- 5.
In fact \(\leadsto _G\) is the reflexive-transitive closure of \(E\), cf. [9].
- 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.
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.
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.
The pattern matching in the first rule makes the rules non-overlapping.
References
Aluffi, P.: Algebra: Chapter 0. AMS, London (2009)
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)
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)
Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions. Springer, Heidelberg (2004)
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)
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)
Hanus, M. (ed.).: Curry: An Integrated Functional Logic Language (Vers. 0.8.3) (2012). http://www.curry-language.org
Holcombe, W.M.L.: Algebraic Automata Theory. Cambridge University Press, Cambridge (1982)
Schmidt, G., Ströhlein, T.: Relations and Graphs. Springer, Heidelberg (1993)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights 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)