Skip to content

Commit

Permalink
typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgm committed Jun 16, 2024
1 parent a04c2b3 commit b9f2982
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion clause.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __hash__(self) -> int:
""" Hash function for Clause using the signature bit """
return hash(self.signature.tobytes())

def __eq__(self, other: 'Clause') -> bool:
def __eq__(self, other) -> bool:
return isinstance(other, Clause) and \
self.cardinality == other.cardinality and \
self.signature == other.signature
Expand Down
4 changes: 2 additions & 2 deletions function.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from clause import *
from typing import List
from typing import Set

class Function:
def __init__(self, nvars:int, clauses: Set['Clause']) -> None:
Expand Down Expand Up @@ -79,7 +79,7 @@ def getAbsorbed(self, c: Clause) -> Set[Clause]:
absorbed.add(s)
return absorbed

def __eq__(self, other: 'Function') -> bool:
def __eq__(self, other) -> bool:
return isinstance(other, Function) and \
self.nvars == other.nvars and \
self.clauses == other.clauses
Expand Down
14 changes: 7 additions & 7 deletions hassediagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ class HasseDiagram:
# Dedeking number: number of monotone Boolean functions of n variables:
# https://oeis.org/A000372
# Number of monotone non-degenerate Boolean functions of n variables:
# n=2 -> 2 functions
# n=3 -> 9 functions
# n=4 -> 114 functions
# n=5 -> 6 894 functions
# n=6 -> 7 785 062 functions
# n=7 -> 2 414 627 396 434 functions
# n=8 -> 56 130 437 209 370 320 359 966 functions
# n=2 -> 2 functions
# n=3 -> 9 functions
# n=4 -> 114 functions
# n=5 -> 6 894 functions
# n=6 -> 7 785 062 functions
# n=7 -> 2 414 627 396 434 functions
# n=8 -> 56 130 437 209 370 320 359 966 functions
# n=9 -> 286 386 577 668 298 410 623 295 216 696 338 374 471 993 functions

def __init__(self, nvars: int) -> None:
Expand Down
5 changes: 1 addition & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_children():

def default_values():
varFunction.set('{{1,2,3},{1,3,4},{2,3,4}}')
varDimension.set('4')
varDimension.set(4)
outputText.delete(1.0, "end") # Clear previous output
outputText.insert(1.0, '')

Expand Down Expand Up @@ -115,9 +115,6 @@ def close_window():
# Text area with grid placement and set state to disabled
outputText = tk.Text(bottomFrame, width=60, height=10)#, state="disabled")
outputText.grid(row=row, columnspan=2) # Span across two columns
# scrollbar = tk.Scrollbar(bottomFrame)
# outputText.config(yscrollcommand=scrollbar.set)
# scrollbar.config(command=outputText.yview)

row += 1
# Default values
Expand Down
2 changes: 1 addition & 1 deletion powerset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from clause import *
from typing import List, Dict
from typing import Set
from collections import defaultdict

class PowerSet:
Expand Down

0 comments on commit b9f2982

Please sign in to comment.