Temporal Functional dependencies with multiple granularities: a logic based approach