A software system is continuously changed so many times. When we try to change a software, we must understand how the software is implemented, especially about the functions to be modified. However, such repeated changes may cause the bad situations that there is no document which reflects the changes and represents the behavior of the software correctly. So, it is important to develop a technique to extract the useful information to understand the behavior of the software from its own. We propose a method to extract compact sequence diagrams from dynamic information of object-oriented programs. Our method generates sequence diagrams by compacting a repetition included in the execution trace. This paper presents four compaction rules. The experiment illustrates how our rules effectively compact the execution trace and generate compact sequence diagrams.