A theory of the trial