mvcisback / py-AIGAR

py-AIGAR: Tools for analyzing aiger circuits.
MIT License
2 stars 4 forks source link

Variable naming in to_bdd() #27

Closed ericskim closed 6 years ago

ericskim commented 6 years ago

@mvcisback

Renamer only accepts integers in the line below. input_refs_to_var = {ref: renamer(i) for i, ref in enumerate(circ.inputs)}

Ideally, calling the line below or a similar variant would yield a bdd with variable names that are identical to the names in aiger circuit. to_bdd(aagcircuit, renamer = lambda x: str(x))

Otherwise, we need to get the desired outcome above we need to rename with the dd interface after calling to_bdd.

mvcisback commented 6 years ago

@ericskim

renamer now has the following signature:

def renamer(idx: int, ref: str) -> str:
    pass

So to get the names in the aiger circuit, you can use: to_bdd(aagcircuit, renamer = lambda x: str(x[0]))

I still pass in the index in case you want to use the index in your renaming.