The Logic of Frames