Toumaima commited on
Commit
d05c6d4
·
verified ·
1 Parent(s): 7a48a62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -35,17 +35,19 @@ class BasicAgent:
35
  }
36
 
37
  def check_commutativity(self):
38
- S = ['a', 'b', 'c', 'd', 'e']
39
- counter_example_elements = set()
40
-
41
- # Check for commutativity violations
42
- for x in S:
43
- for y in S:
44
- if self.operation_table[x][y] != self.operation_table[y][x]:
45
- counter_example_elements.add(x)
46
- counter_example_elements.add(y)
47
-
48
- return sorted(counter_example_elements)
 
 
49
 
50
  def maybe_reversed(self, text: str) -> bool:
51
  words = text.split()
 
35
  }
36
 
37
  def check_commutativity(self):
38
+ S = ['a', 'b', 'c', 'd', 'e']
39
+ counter_example_elements = set()
40
+
41
+ # Check for commutativity violations
42
+ for x in S:
43
+ for y in S:
44
+ if self.operation_table[x][y] != self.operation_table[y][x]:
45
+ counter_example_elements.add(x)
46
+ counter_example_elements.add(y)
47
+
48
+ # Return the sorted list of elements involved in violations
49
+ return sorted(counter_example_elements)
50
+
51
 
52
  def maybe_reversed(self, text: str) -> bool:
53
  words = text.split()