Open MihailoIsakov opened 1 year ago
I do can reproduce what you have mentioned here, I think that since read_truth
uses sop format so it uses minterms to represent, constant function indeed needs to be dealt with here.
I briefly went through the source code, bin notation does have a check on constant function while hex notation doesn't.
And, I also notice truth table in hexadecimal such as
abc -c "read_truth 00; bdd"
will abort with
Assertion failed: (0), function Abc_SopIsExorType, file abcSop.c, line 851.
So even in hex notation it can not take constant 0 since it does not cover all condition.
BTW, from a logic synthesis perspective, may I ask why you apply bdd to a constant boolean function?
Hi, thank you for tackling this.
I've encountered this issue while working on a script that minimizes binarized neural networks (BNNs). It's quite common for BNNs to have 'dead' neurons that have a constant output, hence the issue. Of course its trivial to check whether the input circuit is constant, but I think we should avoid the segfault in any case.
@MihailoIsakov I think this issue has been taken care by @alanminko in commit c4839c9 .
UC Berkeley, ABC 1.01 (compiled Aug 18 2023 20:01:36)
abc 01> read_truth -x 11111111
abc 02> bdd
Warning: The network has only constant nodes.
abc 02>
Hi folks,
I noticed the discrepancy where:
throws an error saying:
At the same time, expressing the truth table in hexadecimal such as:
returns:
As I understand, this is not the desired behavior.