Nucleosynthesis and chemical evolution of intermediate-mass stars: results from planetary nebulae