A formal theory for reasoning about action, knowledge and time