A logical approach to time granularity