1. A method for performing technology mapping, the method comprising: a) receiving a design that is not bounded to a particular technology; b) repeatedly: selecting from the design a candidate sub-network, generating a parameter based on a set of output functions performed by the selected candidate sub-network, based on the parameter, identifying at least one replacement sub-network from a storage structure that stores replacement sub-networks, replacing the selected candidate sub-network in the design with the replacement sub-network, c) wherein at least some of the selected candidate sub-networks have a graph structure that is different from a tree structure or a micro-leaf directed acyclic graph structure.