Skip to content

Commit 486b0d1

Browse files
committed
Fix python fmt
1 parent 9cc648b commit 486b0d1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

library/core/src/str/solve_dfa.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@
3535
]
3636

3737
o = Optimize()
38-
offsets = [BitVec(f'o{i}', 32) for i in range(STATE_CNT)]
39-
trans_table = [BitVec(f't{i}', 32) for i in range(len(TRANSITIONS))]
38+
offsets = [BitVec(f"o{i}", 32) for i in range(STATE_CNT)]
39+
trans_table = [BitVec(f"t{i}", 32) for i in range(len(TRANSITIONS))]
4040

4141
# Add some guiding constraints to make solving faster.
4242
o.add(offsets[0] == 0)
4343
o.add(trans_table[-1] == 0)
4444

4545
for i in range(len(offsets)):
46-
o.add(offsets[i] < 32 - 5) # Do not over-shift. It's not necessary but makes solving faster.
46+
# Do not over-shift. It's not necessary but makes solving faster.
47+
o.add(offsets[i] < 32 - 5)
4748
for j in range(i):
4849
o.add(offsets[i] != offsets[j])
4950
for trans, (targets, _) in zip(trans_table, TRANSITIONS):
@@ -54,10 +55,10 @@
5455
goal = Concat(*offsets, *trans_table)
5556
o.minimize(goal)
5657
print(o.check())
57-
print('Offset[]= ', [o.model()[i].as_long() for i in offsets])
58-
print('Transitions:')
58+
print("Offset[]= ", [o.model()[i].as_long() for i in offsets])
59+
print("Transitions:")
5960
for (_, label), v in zip(TRANSITIONS, [o.model()[i].as_long() for i in trans_table]):
60-
print(f'{label:14} => {v:#10x}, // {v:032b}')
61+
print(f"{label:14} => {v:#10x}, // {v:032b}")
6162

6263
# Output should be deterministic:
6364
# sat

0 commit comments

Comments
 (0)