Generalized plasticity and shape-memory alloys