cjdrake / pyeda

Python EDA
BSD 2-Clause "Simplified" License
304 stars 54 forks source link

Another question about espresso_tts #125

Closed E-Neo closed 1 year ago

E-Neo commented 9 years ago

Excuse me, I have another question about Espresso

A, B, C = map(exprvar, 'ABC') f_tt = truthtable((C, B, A), '10110101') f_ex = truthtable2expr(f_tt) g_ex = espresso_tts(f_tt)[0] f_ex.equivalent(g_ex)

I think it should return True?

cjdrake commented 9 years ago

Seems like a bug.

E-Neo commented 9 years ago

It seems like espresso converts the permutation of the variables.

f_tt = truthtable((D, C, B, A), '1011010110010100') g_tt = expr2truthtable(espresso_tts(f_tt)[0]) f_tt A B C D 0 0 0 0 : 1 0 0 0 1 : 0 0 0 1 0 : 1 0 0 1 1 : 1 0 1 0 0 : 0 0 1 0 1 : 1 0 1 1 0 : 0 0 1 1 1 : 1 1 0 0 0 : 1 1 0 0 1 : 0 1 0 1 0 : 0 1 0 1 1 : 1 1 1 0 0 : 0 1 1 0 1 : 1 1 1 1 0 : 0 1 1 1 1 : 0 g_tt D C B A 0 0 0 0 : 1 0 0 0 1 : 0 0 0 1 0 : 1 0 0 1 1 : 1 0 1 0 0 : 0 0 1 0 1 : 1 0 1 1 0 : 0 0 1 1 1 : 1 1 0 0 0 : 1 1 0 0 1 : 0 1 0 1 0 : 0 1 0 1 1 : 1 1 1 0 0 : 0 1 1 0 1 : 1 1 1 1 0 : 0 1 1 1 1 : 0

cjdrake commented 1 year ago

danjujan, this fix looks good to me.