Referential Opacity and Modal Logic