The Temporal Logic of Causal Structures