We present a logical approach to plan recognition that builds on Kautz's theory of keyhole plan recognition, defined as the problem of inferring descriptions of high-level plans from a set of descriptions of observed, typically low-level, actions. Kautz's approach is based on a formalization of the structural information contained in an abstraction/decomposition hierarchy of plan schemas: the inferred plans are selected by an observer agent from amongst those that can be generated from this hierarchy. In this paper, we present two logics for plan recognition. The first theory, like Kautz's, is monotonic, meaning that all possible plans compatible with the observations are treated as equally plausible by the observer. The second theory is based on rejecting this simplifying assumption, and is nonmonotonic. To develop this theory, we adapt ideas from belief revision and conditional logic to define plan recognition inference as a nonmonotonic consequence operation based on...