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

Implement WeaklyDivisibleSemiring for BooleanWeight #284

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bluebear94
Copy link

According to the definition in the docs for WeaklyDivisibleSemiring, BooleanWeight (S = bool, + = |, * = &, 0 = false, 1 = true) should be weakly divisible: there are three combinations (x, y) such that x + y != 0:

  • x = true, y = true: in this case, we can set z = true so that true = (true | true) & true.
  • x = true, y = false: we can set z = true so that true = (true | false) & true.
  • x = false, y = true: we can set z = false so that false = (false | true) & false.

In fact, BooleanWeight is divisible because the inverse of true is true.

This PR adds an implementation of WeaklyDivisibleSemiring for BooleanWeight.

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

Successfully merging this pull request may close these issues.

1 participant