A Logic Approach to Granular Computing