Chiral rings, singularity theory and electric-magnetic duality