The Horn complexity of Boolean functions and Cook's problem