Temporal reasoning algorithms