Skip to content

"TypeError" using class ForeachPrimeIteretor #4

@giulitu95

Description

@giulitu95

In my pySMT project I have to use a bdd converter in order to call some cudd-specific APIs. More specifically I should iterate over the prime implicants of a formula. The example 2 that I found in this repository shows how to Iterate on the Prime Implicants by calling the constructor of the class ForeachPrimeImplicants:

# Over primes
# print("Over primes ...")
# repycudd.set_iter_meth(2)
# for prime in repycudd.ForeachPrimeIterator(m, repycudd.NodePair(rel, rel)):
# print(repycudd.cube_tuple_to_str(prime))

I've tried to uncomment those lines of code and launch the entire example but at line 59, python gives me the following exception:

TypeError: NodePair_FirstPrime() takes exactly 3 arguments (2 given)

Inspecting the generated file repycudd.py, inside the class ForeachPrimeIterator (at line 2538 and 2546), the FirstPrime() and NextPrime() methods are called by passing only one parameter, an object which corresponds to a "generator". However those methods should accept 2 parameters, a generator and a manager.
I tried so adding to the two methods also the second parameter corresponding to the manager which was already instantiated as class attribute. Now everything seems to be working fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions