Usually a court will not make a ruling using an argument which the parties to the case have not raised. This subject has been discussed on this site previously. However, I would argue that this legal principle only applies to substantive arguments, in other words when the argument involves interpretation of evidence. When an argument involves no interpretation and is based either on logic alone, or on evidence which admits of no alternative interpretations, then I would argue that a judge has the right to intervene. The question here is when does that right become a duty? Also, is there a Latin or other terminology that applies to this situation?
So, as an example of this, imagine a situation where a judge has previously presided over a criminal case in which a particular defendant was acquitted by a jury. Later, that same defendant is brought before the judge again on the same charge. For whatever reason, the defending attorney fails to argue that his client should be not be tried twice on the same charge. However, the judge knows for a fact that this is the case because he presided over the previous trial himself. Is it encumbent on the judge to dismiss the charge?
Here is another example involving logic alone. Imagine that a defendant is tried on a criminal charge and convicted by a jury on that charge. Before sentencing however, the judge discovers that the legislature had repealed the law under which the defendant was charged several weeks before the alleged crime had occurred. At this point the judge realizes that he made an error at the arraignment by allowing the case to come to trial at all. Is it now encumbent on the judge to set aside the jury verdict and dismiss the charge?