Constructive AIG optimization through functional composition