-
Notifications
You must be signed in to change notification settings - Fork 9
abc claims the aig is empty starting with version 6.1.7 #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @jbroot , Sorry about that. I recently rewrote the parser/writer to not use a PEG grammar due to performance issues. Looking at the commits, I think this was what changed in 6.1.7. Do you have a small executable example I could use to reproduce the regression? In particular, I'm curious what |
Sure, here is my smallest file that produces the error. |
Exact abc error: ABC command line: "read /tmp/a06d4685-a7f3-478c-be1e-6032cbabac03bin.aig; show". Here are the contents of the /tmp/...aig file: aig 10 2 0 1 7 i0 a |
Thanks! I will look into reproducing and extracting a regression test later today. |
So I've confirmed that this occurs. No need to get
*** [aigtoaig] line 2: invalid maximal variable index I don't readily see the problem, but I'll look into it more later today. |
I wrote out the corresponding circuit by hand it seems fine to me. One thing I noticed is that aigtoaig outputs a weird file. Namely, it has a header:
compared to the input header
AFAIK |
I will report this to Armin Biere. @jbroot if you can confirm that this is a correct AAG file, please let me know. |
I haven't investigated aags much. After surveying
http://fmv.jku.at/aiger/FORMAT.aiger I found the following:
The aag header has format "aag M I L O A" where M is the maximal variable
index, I=inputs, L=latches, O=outputs, and A=ands. If all variables and all
AND gates are used, then M = I + L + A. This likely implies that M <= I + L
+ A
The aig header has "aig M I L O A" format following aag syntax. However, it
says that all literals must be defined so M must be M = I + L + A.
In the aig and aag headers you gave, M > I + L + A so the syntax is invalid.
Running xorComplex in version 6.1.6 gives an aag of:
aag 9 2 0 1 7
2
4
19
6 2 4
8 2 7
10 2 4
12 2 11
14 3 4
16 13 14
18 9 17
i0 b
i1 a
o0 out
and an aig of:
aig 5 2 0 1 3
10
i0 a
i1 b
o0 out
c
In both cases, M = I + L + A which satisfies M <= I + L + A for aag and M =
I + L + A for aig.
…On Mon, Feb 8, 2021 at 2:33 PM Marcell Vazquez-Chanlatte < ***@***.***> wrote:
I will report this to Armin Biere.
@jbroot <https://github.com/jbroot> if you can confirm that this is a
correct AAG file, please let me know.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#121 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNLHAAE4DIUL56FE7LPQULS6BKBZANCNFSM4W6AATGQ>
.
|
I changed the maximum variable index from 9 to 8 since all ANDs and inputs are used and 8 = I+L+A. aigtoaig and ABC accepted this change and would not allow the prior. The xorComplex produced in 6.1.6 had header 9 2 0 1 7. All AND gates and inputs were used and 9 = 2 + 0 + 7. |
@jbroot I think you may have flipped I believe the spec is supposed to be This constraint is supposed to be checked at runtime in The thing that I'm worried about is that
Thus it is violating this equality constraint. In implementing the new parser/writer, I added infrastructure to soon support the binary format. What I'm thinking might be happening is that there is a weird code path being triggered since the |
So the This aag doesn't work
But this one does
I think there's an optimization to avoid recomputing the header if the body corresponds with the body for an |
regarding |
The latest version of If this works for you please close the issue. Also, if you're using py-aiger in any academic work, please use the citation at the bottom of the README :) |
Armin Biere responded and added it on the TODO for AIGER :) Closing. |
Step 1: write aig to file with aig.write(file) (pyaiger function)
Step 2: convert ascii aig to binary aig with aigtoaig
Step 3: read binary aig with abc
abc claims the aig is an empty network. These same steps worked in pyaiger version 6.1.6
using Python 3.8
The text was updated successfully, but these errors were encountered: