The paper proposes a formal approach for constructing UML activity diagrams from sequence diagrams by using graph transformations. Activity diagrams are good at describing the overall flow of control in a system, as they provide support for conditional and parallel behaviour, but do not capture well object interactions. Activity diagrams are mostly used in the preliminary stages of analysis and design. As the design progresses, more detailed descriptions of object interactions become necessary, and interaction diagrams are used for this purpose. During the transition from a high level to a detailed design, the mapping between the behavior represented in activity diagrams and that described in interaction diagrams may be lost, and the two views may become inconsistent. By reconstructing the activity diagrams from sequence diagrams, consistency is re-enforced. Every activity block is cross-referenced with the corresponding sequence diagram messages, which helps designers to correlate the two views. The transformation from sequence to activity diagrams is based on PROGRES, a known visual language and environment for programming with graph rewriting systems.