Add Before/After prints
This commit is contained in:
parent
9b6d9b47de
commit
a1f1a1269d
2 changed files with 18 additions and 2 deletions
|
@ -399,13 +399,15 @@ class Automate:
|
|||
"""Make automate recognize the complementary language"""
|
||||
|
||||
if not self.is_deterministe():
|
||||
print("Determinizing")
|
||||
self.determinize()
|
||||
assert self.is_deterministe()
|
||||
self.print_transition_table()
|
||||
if not self.is_complete():
|
||||
print("Completing")
|
||||
self.complete()
|
||||
assert self.is_complete()
|
||||
|
||||
self.print_transition_table()
|
||||
self.print_transition_table()
|
||||
|
||||
current_non_terminal_states = [
|
||||
state for state in self.states if state not in self.terminal_states
|
||||
|
|
14
src/main.py
14
src/main.py
|
@ -56,32 +56,46 @@ def main() -> None:
|
|||
else:
|
||||
print("Non accepté")
|
||||
elif command == "determinize":
|
||||
print("Avant :")
|
||||
automate.print_transition_table()
|
||||
automate.determinize()
|
||||
print("Après :")
|
||||
automate.print_transition_table()
|
||||
elif command == "complete":
|
||||
print("Avant :")
|
||||
automate.print_transition_table()
|
||||
automate.complete()
|
||||
print("Après :")
|
||||
automate.print_transition_table()
|
||||
elif command == "minimize":
|
||||
print("Avant :")
|
||||
automate.print_transition_table()
|
||||
automate.minimize()
|
||||
print("Après :")
|
||||
automate.print_transition_table()
|
||||
elif command == "standardize":
|
||||
print("Avant :")
|
||||
automate.print_transition_table()
|
||||
automate.standardize()
|
||||
print("Après :")
|
||||
automate.print_transition_table()
|
||||
elif command == "add_empty_word":
|
||||
print("Avant :")
|
||||
automate.print_transition_table()
|
||||
automate.add_empty_word()
|
||||
print("Après :")
|
||||
automate.print_transition_table()
|
||||
elif command == "remove_empty_word":
|
||||
print("Avant :")
|
||||
automate.print_transition_table()
|
||||
automate.remove_empty_word()
|
||||
print("Après :")
|
||||
automate.print_transition_table()
|
||||
elif command == "to_complementary":
|
||||
print("Avant :")
|
||||
automate.print_transition_table()
|
||||
automate.to_complementary()
|
||||
print("Après :")
|
||||
automate.print_transition_table()
|
||||
elif command == "graph":
|
||||
filename = automate_file.name
|
||||
|
|
Loading…
Reference in a new issue