Reasoning about actions foundations and applications