Coherent specification of demand systems with corner solutions and endogenous regimes (Warwick economic research papers, 1988)