An index for operational flexibility in chemical process design. Part I: Formulation and theory