state diagram generation (partial)