Aiger parser: correct input and output names
* spot/twaalgos/aiger.cc: here. * tests/python/aiger.py: add tests * tests/python/synthesis.ipynb: correct notebook
This commit is contained in:
parent
8aa9da7fc8
commit
aff04c2207
3 changed files with 1581 additions and 1583 deletions
|
|
@ -228,14 +228,20 @@ namespace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((not input_names.empty()) && (input_names.size() != nb_inputs))
|
if (!input_names.empty())
|
||||||
|
{
|
||||||
|
if (input_names.size() != nb_inputs)
|
||||||
error_aig(__LINE__, "Either all or none of the inputs can be named",
|
error_aig(__LINE__, "Either all or none of the inputs can be named",
|
||||||
0);
|
0);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
input_names = name_vector(nb_inputs, "i");
|
input_names = name_vector(nb_inputs, "i");
|
||||||
if ((not output_names.empty()) && (output_names.size() != nb_outputs))
|
if (!output_names.empty())
|
||||||
|
{
|
||||||
|
if (output_names.size() != nb_outputs)
|
||||||
error_aig(__LINE__, "Either all or none of the outputs can be named",
|
error_aig(__LINE__, "Either all or none of the outputs can be named",
|
||||||
0);
|
0);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
output_names = name_vector(nb_outputs, "o");
|
output_names = name_vector(nb_outputs, "o");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3383,6 +3383,24 @@ for (i, e_latch) in zip(ins, exp_latches):
|
||||||
(aig.circ_state()[4], aig.circ_state()[6]))
|
(aig.circ_state()[4], aig.circ_state()[6]))
|
||||||
aig.circ_step([i])
|
aig.circ_step([i])
|
||||||
|
|
||||||
|
# Variable names
|
||||||
|
|
||||||
|
assert(spot.aiger_circuit("""aag 2 2 0 2 0
|
||||||
|
2
|
||||||
|
4
|
||||||
|
2
|
||||||
|
1
|
||||||
|
i0 a
|
||||||
|
i1 b
|
||||||
|
c
|
||||||
|
""").to_str() == 'aag 2 2 0 2 0\n2\n4\n2\n1\ni0 a\ni1 b\no0 o0\no1 o1')
|
||||||
|
|
||||||
|
assert(spot.aiger_circuit("""aag 2 2 0 2 0
|
||||||
|
2
|
||||||
|
4
|
||||||
|
2
|
||||||
|
1
|
||||||
|
o0 x
|
||||||
|
o1 y
|
||||||
|
c
|
||||||
|
""").to_str() == 'aag 2 2 0 2 0\n2\n4\n2\n1\ni0 i0\ni1 i1\no0 x\no1 y')
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue