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

Missing binary boolean operators #68

Open
DrTimothyAldenDavis opened this issue Nov 26, 2021 · 0 comments
Open

Missing binary boolean operators #68

DrTimothyAldenDavis opened this issue Nov 26, 2021 · 0 comments

Comments

@DrTimothyAldenDavis
Copy link
Member

GraphBLAS does not have the full set of all 16 possible boolean binary operators. It has only 11 of them. See the table below:

                     x: 0 0 1 1
                     y: 0 1 0 1
                     -------------
  
        z = 0           0 0 0 0     (zero function, not predefined)
        z = (x && y)    0 0 0 1     AND, MIN, TIMES
        z = (x > y)     0 0 1 0     GT
        z = x           0 0 1 1     FIRST
  
        z = (x < y)     0 1 0 0     LT
        z = y           0 1 0 1     SECOND
        z = (x != y)    0 1 1 0     XOR, MINUS, NE
        z = (x || y)    0 1 1 1     OR, MAX, PLUS
  
        z = ~(x || y)   1 0 0 0     (nor(x,y) function, not predefined)
        z = (x == y)    1 0 0 1     LXNOR, EQ
        z = ~y          1 0 1 0     (not(y), not predefined as a binary op)
        z = (x >= y)    1 0 1 1     GE, also same as "x implies y"
  
        z = ~x          1 1 0 0     (not(x), not predefined as a binary op)
        z = (x <= y)    1 1 0 1     LE, also same as "y implies x"
        z = ~(x && y)   1 1 1 0     (nand(x,y) function, not predefined)
        z = 1           1 1 1 1     ONEB

We should add the 5 missing functions, as boolean binary operators:

GrB_ZEROB_BOOL: z = false.  This might also be GrB_ZEROB_T for any domain T.
GrB_NFIRST:  z = not(x)
GrB_NSECOND: z = not(y)
GrB_NAND: z = not (and (x,y))
GrB_NOR: z = not (or (x,y))

All domains for these binary operators are GrB_BOOL. These functions are useful in their own right, but are also required by #67

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

No branches or pull requests

1 participant