Diffusion in solid proton conductors: theoretical aspects and nuclear magnetic resonance analysis