Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Add BoolRng and GenBool. Resolves #107. #109

Merged
merged 2 commits into from
Nov 2, 2015
Merged

Conversation

TomasMikula
Copy link
Collaborator

This is a work in progress on topless Bool/BoolRing (#107), subject to some renaming. In this version I used the names GenBool for generalized Boolean algebra and without(a, b) for a\b (relative complement of b with respect to a).

laws[LogicLaws, Set[Byte]].check(_.generalizedBool)
laws[RingLaws, Set[Byte]].check(_.boolRng(setBoolRng[Byte]))
laws[LogicLaws, Set[Byte]]("bool-from-rng").check(_.generalizedBool(setBoolRng.asBool))
laws[RingLaws, Set[Byte]]("rng-from-bool").check(_.boolRng(GenBool[Set[Byte]].asBoolRing))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched from Set[Int] to Set[Byte] in order to have more exhaustive coverage of the domain.

@TomasMikula
Copy link
Collaborator Author

Although I used the name GenBool for generalized Boolean algebra, I came to like the shortcut less and less, because "Gen" is kind of ambiguous (generic?, org.scalacheck.Gen-related?). I guess I would prefer spelling out GeneralizedBool.

@non
Copy link
Contributor

non commented Nov 2, 2015

I'm fine with either of those names. I like @johnynek's idea of just merging this as-is (GenBool) but if you'd rather I am fine with changing the name to GeneralizedBool.

@TomasMikula
Copy link
Collaborator Author

If you are fine with it, then go ahead and merge. How do people feel about without as the name for relative complement. It is an intuitive name for the case of set difference. For logic, the intuition is a butNot b (as a primitive operation, because we don't have not/complement).

@non
Copy link
Contributor

non commented Nov 2, 2015

👍

non added a commit that referenced this pull request Nov 2, 2015
Add BoolRng and GenBool. Resolves #107.
@non non merged commit 455e651 into typelevel:master Nov 2, 2015
@non
Copy link
Contributor

non commented Nov 2, 2015

So the idea is that we'd write the relative complement of a in b as b \ a and without(b, a)?

@TomasMikula
Copy link
Collaborator Author

Yes, exactly, so that the argument order of the spelled out name is consistent with the symbolic notation.

@non
Copy link
Contributor

non commented Nov 2, 2015

Sounds good to me.

@TomasMikula TomasMikula deleted the bool-ring branch November 2, 2015 18:53
@johnynek
Copy link
Contributor

johnynek commented Nov 2, 2015

I think without is fine.

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

Successfully merging this pull request may close these issues.

3 participants