Text this: Algorithms for partitioning logical circuits into subcircuits