Skip to content

Wrong results when using parallel compositions #132

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

Open
MatCos opened this issue Aug 2, 2023 · 2 comments
Open

Wrong results when using parallel compositions #132

MatCos opened this issue Aug 2, 2023 · 2 comments

Comments

@MatCos
Copy link

MatCos commented Aug 2, 2023

I came across some unexplainable behavior when using the parallel composition of two AIGER circuits.

Given the following minimal example:

    circ0 = aiger.parse("aag 2 1 1 1 0\n2\n4 2\n4\ni0 i0\nl0 l0\no0 o0")
    circ1 = aiger.parse("aag 2 1 1 1 0\n2\n4 2\n4\ni0 i1\nl0 l0\no0 o1")

of two AIGER circuits that are copies of each other but with disjunct inputs/outputs.
Both circuits have one latch that delays the only input to the output by one step.
The composed circuit:

   circ0 | circ1
   aag 3 2 1 2 0
   2
   4
   6 4 0
   6
   6
   i0 i0
   i1 i1
   o0 o0
   o1 o1
   l0 l0

consists of only one latch, hence input i0 is ignored and circ0 is not subsumed by the composed result

@MatCos
Copy link
Author

MatCos commented Aug 2, 2023

The problem seems to be that the latches have identical names. When losing the definition in the symbol table (or renaming the latches), it works as expected.

   circ2 = aiger.parse("aag 2 1 1 1 0\n2\n4 2\n4\ni0 i0\nl0 l0\no0 o0")
   circ3 = aiger.parse("aag 2 1 1 1 0\n2\n4 2\n4\ni0 i1\nl0 l1\no0 o1")
   circ2 | circ3

  aag 4 2 2 2 0
  2
  4
  6 2 0
  8 4 0
  6
  8
  i0 i0
  i1 i1
  o0 o0
  o1 o1
  l0 l0
  l1 l1

While this makes sense from an implementation perspective, I still see a problem with this interpretation.

If the name of a latch is considered when composing systems, it should not be possible to compose circ0 and circ1, because no circuit can exist that is the composition of the two circuits. It might be dangerous to have undefined behavior in this setting.

I'll leave the issue open and let the developer decide whether this is an issue.

@mvcisback
Copy link
Owner

Thanks for letting me know. I'll try to find to look into resolving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants