  Rewriting systems on words are very useful in the study of monoids. In good
cases, they give finite presentations of the monoids, allowing their
manipulation by a computer. Even better, when the presentation is confluent and
terminating, they provide one with a notion of canonical representative for the
elements of the presented monoid. Polygraphs are a higher-dimensional
generalization of this notion of presentation, from the setting of monoids to
the much more general setting of n-categories. Here, we are interested in
proving confluence for polygraphs presenting 2-categories, which can be seen as
a generalization of term rewriting systems. For this purpose, we propose an
adaptation of the usual algorithm for computing critical pairs. Interestingly,
this framework is much richer than term rewriting systems and requires the
elaboration of a new theoretical framework for representing critical pairs,
based on contexts in compact 2-categories.
