In Shakespeare's Macbeth, he uses 'sleepwalking' or 'somnambulism' to achieve poetic justice. Remember that at this point in the play (Act V I 40) the dread deeds have been done and she and her husband have long since begun to unravel mentally and emotionally. She is completely fixated on the night of the murder that it moves into her sleep. She tries, in her sleepwalking, to continue to wash the blood from her hands, but can't. It is poetic justice because she has been cursed with her own misdeeds and they are finally making an impact on her own inner landscape. This is the last scene where she makes an appearance and we learn later that she's fallen to her death (symbolically and literally).