If a statute states a mitigating or negating circumstance to a criminal charge, who has the burden of proof, the prosecution or the defense?
For example, if a state statute says that it is criminal for a person to threaten another, but in the same statute it says that such a threat will not constitute a crime if the threatened person was trespassing on the defendant's property, then who bears the burden of proof that the threatened person was trespassing (or not trespassing).
In other words, if the law has an exception to a criminal charge, who must prove that the exception does or does not apply? What is the precedent?