This paper investigates perceptual grouping from a logical point of view, defining a grouping interpretation as a particular kind of logical expression, and then developing an explicit inference theory in terms of such expressions. First, a regularity-based interpretation language is presented, in which an observed configuration is characterized in terms of the regularities (special configurational classes, e.g. nonaccidental properties) it obeys. The most preferred interpretation in such a system is shown to be the most-regular (maximum ''codimension'') model the observed configuration obeys, which is also the unique model in which it is generic (typical). inference then reduces to a straightforward exercise in Logic Programming. Because generic model assignment involves negation, this reduction requires that a version of the Closed World Assumption (CWA) be adopted. Next, this entire regularity-based machinery is generalized to the grouping problem: here an interpretation is a hierarchical (recursive) version of a model called a parse tree. For a given number of dots and a fixed choice of regularity set, it is possible to explicitly enumerate the complete set of possible grouping interpretations, partially ordered by their degree of regularity (codimension). The most preferred interpretation is the one with maximum codimension (i.e., the most regular interpretation), which we call the qualitative parse. An efficient procedure(worst case O (n(2))) for finding the qualitative parse is presented. The qualitative parse has a unique epistemic status: given a choice of regularity set, it is the only grouping interpretation that both (a) is maximally regular, and (b) satisfies the CWA. This unique status, it is argued, accounts for the perceptually compelling quality of the qualitative parse.