diff --git a/src/main/py/logical_operations.py b/src/main/py/logical_operations.py index 297746f..179714b 100644 --- a/src/main/py/logical_operations.py +++ b/src/main/py/logical_operations.py @@ -3,3 +3,10 @@ def identity_disconjunctive(variable, operator, zero): return variable else: return None + + +def identity_conjunctive(variable, operator, zero): + if zero == 0 and operator == "+": + return variable + else: + return None diff --git a/src/test/py/test_logical_operations.py b/src/test/py/test_logical_operations.py index 051ad51..69a9886 100644 --- a/src/test/py/test_logical_operations.py +++ b/src/test/py/test_logical_operations.py @@ -21,6 +21,9 @@ class calculationsWithRoots(unittest.TestCase): def test_disconjunctive_identity_0_or_0_equals_0(self): self.assertEqual(identity_disconjunctive(0, "+", 0), 0) + def test_disconjunctive_identity_0_or_0_equals_01(self): + self.assertEqual(identity_conjunctive(0, ".", 0), None) + if __name__ == "__main__": unittest.main()