Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarice committed Dec 9, 2024
1 parent 7d9586f commit d883932
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions xdsl/dialects/arith.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,21 @@ def py_operation(lhs: int, rhs: int) -> int | None:

@staticmethod
def is_right_zero(attr: AnyIntegerAttr) -> bool:
"""
Returns True only when 'attr' is a right zero for the operation
https://en.wikipedia.org/wiki/Absorbing_element
Note that this depends on the operation and does *not* imply that
attr.value.data == 0
"""
return False

@staticmethod
def is_right_unit(attr: AnyIntegerAttr) -> bool:
"""
Return True only when 'attr' is a right unit/identity for the operation
https://en.wikipedia.org/wiki/Identity_element
"""
return False

def __init__(
Expand Down

0 comments on commit d883932

Please sign in to comment.