According to veteran criminal lawyer Dror Arad-Ayalon, there are two provisions for canceling the trial of a criminal defendant for mental reasons. According to the first, the court may decide that a defendant is incompetent to stand trial because at the moment of the trial, he is in such a poor mental state that he cannot understand the judicial process and therefore cannot contribute to it. This state of mind does not have to do with the defendant's mental condition at the time of the crime of which he is accused. The other provision has to do with the mental state of the defendant at the time he allegedly committed the crimes. In this case, the criterion is that the defendant was unable to differentiate between right and wrong regarding his actions. The longer the gap in time between the alleged crime and the trial, the more difficult it will be to determine what the defendant's state of mind was at the time of the crime. According to Arad-Ayalon, however, even if the court rules that the defendant was not insane (in the legal sense defined above), it is empowered to send him to prison for less than the customary life sentence prescribed by law if it decides that his emotional state at the time was a contributing factor in the crime. Generally speaking, it is the defendant's lawyer that raises the argument of mental incompetence or insanity. If he does, he will try to prove it by presenting the court with an affidavit from a psychiatrist backing the claim. In that case, the prosecution will also bring its own psychiatric opinion to counter the defense. In the end, it is the court that decides whether the defendant is capable of standing trial and whether he was insane at the time of the alleged crime.