Design patterns are traditionally outlined in an informal
manner. If they could be formalised, we could derive tools
that automatically recognise design patterns and refactor
designs and code. Our approach is to deploy predicate logic
to specify conditions on the class diagrams that describe
design patterns. The structure of class diagrams is itself
described with a novel meta-notation that can be used for
defining any graphical modelling language. As a result, the
constraints, while based on UML, are highly readable and
have much expressive power. This enables us not only to
recognise design patterns in legacy code, but also to reason
about them at the design stage, such as showing one pattern
to be a special case of another. The paper discusses our
specification of the original 23 design patterns and presents
a representative sample of some of them