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

Monoid and Partial Monoid #69

Merged
merged 6 commits into from
Mar 12, 2021
Merged

Monoid and Partial Monoid #69

merged 6 commits into from
Mar 12, 2021

Conversation

eupp
Copy link
Collaborator

@eupp eupp commented Feb 26, 2021

This PR features the monoid and partial monoid structures (the latter inherits from the former). The partial monoid is intended to be a base class for synchronization algebra later #59. Partiality is encoded using the binary orthogonality relation (see [1] for details).

Why did we decide to invent the wheel here? Below are alternative formalizations of monoids and the reasons why we abandoned them.

  1. mathcomp
    Here the monoids are used primarily in the context of so-called big operations. The canonical instances are linked to operations themselves rather than to types. We decided that for our use cases, it makes more sense to attach the instance to the type.

  2. relation-algebra
    Relation-Algebra has a very heavyweight notion of "monoid". First, it uses its own tricks to pack several operations into one structure and then enable/disable modularly (see this file). This design has some advantages but overall it seems too complex for our needs. Also, relation-algebra has heterogeneous typed monoids, which is also an overkill for us.

  3. fcsl-pcm
    In fcsl-pcm package, the PCMs (partial commutative monoids) are at the top of the hierarchy. We don't want to enforce commutativity for our synchronization algebras. Besides that, we've decided to try out the alternative encoding of partiality through the orthogonality relation, instead of validity predicate.

Question

Let's discuss a couple of questions about this PR.

  1. I used the notation \+ for the monoidal operation (borrowed from fcsl-pcm package) and id for the unit.
    Do we have better suggestions? My minor concern, is that id is shorthand for identity, but using \+ and 1 as a unit of monoid a bit frustrating... Also, perhaps we want a notation for the unit, like 0, 1, or \eps etc?

  2. For the orthogonality I picked the \perp latex notation (Unicode)? Any alternative suggestions?

  3. Also, we got some inspiration from fcsl-pcm, so perhaps we should mention the authors? What is a proper way to do this? @anton-trunov

[1] Bart Jacobs --- Convexity, Duality and Effects

@eupp eupp added enhancement New feature or request RFC Request For Comment theory labels Feb 26, 2021
@anton-trunov
Copy link
Collaborator

Also, perhaps we want a notation for the unit, like 0, 1, or \eps etc?

Some more possible alternatives:

  • neu or \neu (neutral);
  • \unit (so there is no confusion with the unit type);
  • \0.

For the orthogonality I picked the \perp latex notation (Unicode)? Any alternative suggestions?

I'm fine with \perp. A possible alternative could be FCSL's \orth?

Also, we got some inspiration from fcsl-pcm, so perhaps we should mention the authors? What is a proper way to do this?

I think mentioning this in the README file and in the commit message should be fine.

@anton-trunov
Copy link
Collaborator

Ah, in my previous comment I missed we use Unicode for orthogonality. Perhaps we should use for the monoidal operation?

monoid.v Outdated Show resolved Hide resolved
monoid.v Outdated Show resolved Hide resolved
monoid.v Outdated Show resolved Hide resolved
monoid.v Outdated Show resolved Hide resolved
monoid.v Outdated Show resolved Hide resolved
@eupp
Copy link
Collaborator Author

eupp commented Mar 5, 2021

In the end, I've decided to choose the following names :)

  • zero and \0 for monoidal unit
  • plus and \+ for monoidal operation

@eupp eupp requested a review from anton-trunov March 5, 2021 15:02
@eupp eupp merged commit 9c7cda4 into master Mar 12, 2021
@eupp eupp deleted the pmonoid branch March 12, 2021 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request RFC Request For Comment theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants