 As I said earlier, the integration of the person such that you rebel against the bodily appetite that's urging you to do something that you know is not right. Now, is there any sin that you can actually commit in a dream? St. Thomas has a few thoughts on this issue.