From 45bbc2df857b4d45a1309382b8aa092d6a39c655 Mon Sep 17 00:00:00 2001 From: Joshua Moerman Date: Wed, 22 May 2024 11:29:07 +0200 Subject: [PATCH] better output --- other/decompose_fsm.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/other/decompose_fsm.py b/other/decompose_fsm.py index a8b92a3..5d0fd65 100644 --- a/other/decompose_fsm.py +++ b/other/decompose_fsm.py @@ -87,6 +87,8 @@ with open(args.filename) as file: if args.verbose: print(machine) +print(f'Initial size: {len(machine.states)}') + ################################### # Utility function @@ -223,6 +225,7 @@ with Solver(bootstrap_with=cnf) as solver: print('- actual solve') sat = solver.solve() + print('===============') if not sat: print('unsat :-(') exit() @@ -259,7 +262,7 @@ with Solver(bootstrap_with=cnf) as solver: print(f'- representative state {s}') # count moet gelijk zijn aan cost (of kleiner) - print(f'total size = {count}') + print(f'Reduced size = {count}') projections = {} for rid in rids: @@ -285,6 +288,6 @@ with Solver(bootstrap_with=cnf) as solver: count += 1 -print('===============') -print('Output mapping:') -print_table(lambda o, rid: projections[rid][o], machine.outputs, rids) + print('===============') + print('Output mapping:') + print_table(lambda o, rid: projections[rid][o], machine.outputs, rids)