Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression Tree diagrams form a Unital Magma - can we exploit that? #5

Open
igormoreno opened this issue May 26, 2021 · 0 comments
Open

Comments

@igormoreno
Copy link
Contributor

https://ncatlab.org/nlab/show/magma
https://en.wikipedia.org/wiki/Magma_(algebra)

A binary operation on a set S is a function (−)⋅(−):S×S→S from the Cartesian product S×S to S. A Magma (or binary algebraic structure, or, alternatively, a mono-binary algebra) (S,⋅) is a set equipped with a binary operation on it.
A Magma is called unital if it has a neutral element.

We can build trees by folding small trees together. The way to combine them is to join them by the roots. That binary operation is not associative but it has a neutral element: the empty tree. That works also for the graph-like representation of the expressions tree diagram, with the neutral element ExpTreeDiagram Set.empty Set.empty Nothing. The sum of diagrams is being implemented now in the pattern DiaBranch but maybe we can take advantage of this structural property somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant