fix pyeda unreliability for single-lit case
@@ -303,7 +303,9 @@ class TruthTableOracle(Oracle):
clauses.append((c[0], *clause))
else:
raise AquaError('Unrecognized logic expression: {}'.format(raw_ast))
- elif raw_ast[0] == 'const' or raw_ast[0] == 'lit':
+ elif raw_ast[0] == 'lit':
+ return 'lit', idx_mapping[raw_ast[1]] if raw_ast[1] > 0 else -idx_mapping[-raw_ast[1]]
+ elif raw_ast[0] == 'const':
return raw_ast
else:
raise AquaError('Unrecognized root expression type: {}.'.format(raw_ast[0]))
