A syntactic approach to introspection and reasoning about the beliefs of other agents