Add state diagram for finite-state machine.