We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c27a3e9 commit 0eb8d97Copy full SHA for 0eb8d97
nnf/kissat.py
@@ -69,11 +69,9 @@ def solve(
69
log_lines = [line.strip() for line in log.split('\n')]
70
71
variable_lines = [line[2:] for line in log_lines if line[:2] == 'v ']
72
- lit_strings = ' '.join(variable_lines).split(' ')
73
- assert '0' == lit_strings[-1], \
74
- "Error: Last entry should be a 0\n%s" % str(lit_strings)
75
- lit_strings = lit_strings[:-1]
76
- literals = map(int, lit_strings) # Individual numbered literals
+ literals = [int(num) for line in variable_lines for num in line.split()]
+ assert literals[-1] == 0, "Last entry should be 0. Log:\n\n{}".format(log)
+ literals.pop()
77
model = {var_labels[abs(lit)]: lit > 0 for lit in literals}
78
79
return model
0 commit comments