Ex post facto
is Latin for from after the action.
The U.S. Constitution forbids ex post facto laws, which declare certain acts to be illegal after
the behavior occurs. That is, a law cannot be applied retroactively. For example, if a new law that forbids chocolate milk goes into effect on January 1, 2012, then any sales before that date are still legal. Just remember this: No law? No crime.
In The Federalist (Papers), Alexander Hamilton examines the judiciary department of the proposed United States government:
The complete independence of the courts of justice is peculiarly essential in a limited Constitution. By a limited Constitution, I understand one which contains certain specified exceptions to the legislative authority; such, for instance, as that it shall pass no bills of attainder, no ex post facto laws, and the like. Limitations of this kind can be preserved in practice no other way than through the medium of courts of justice, whose duty it must be to declare all acts contrary to the manifest tenor of the Constitution void. Without this, all the reservations of particular rights or privileges would amount to nothing.