Skip to content

Commit 5037adf

Browse files
committed
Implemented repr for clauses objects
1 parent 7f77ab6 commit 5037adf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/logicalpy/normal_forms.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def __str__(self):
3636
return str(self.literals[0])
3737
else:
3838
return "◻"
39+
40+
def __repr__(self) -> str:
41+
return f"DisjunctiveClause({", ".join([repr(literal) for literal in self.literals])})"
3942

4043
def __eq__(self, other):
4144
if isinstance(other, DisjunctiveClause):
@@ -83,6 +86,9 @@ def __str__(self):
8386
return str(self.literals[0])
8487
else:
8588
return "◻"
89+
90+
def __repr__(self) -> str:
91+
return f"ConjunctiveClause({", ".join([repr(literal) for literal in self.literals])})"
8692

8793
def __eq__(self, other):
8894
if isinstance(other, ConjunctiveClause):

0 commit comments

Comments
 (0)