Ex post facto is a law that retroactively changes the legal consequences of actions that were committed before the enactment of the law. In simpler terms, it punishes someone for an action that was not illegal when it was committed or increases the punishment for an offense after it was committed. Ex post facto laws are generally prohibited by most democratic legal systems because they violate the principle of fairness and due process.
Retroactive criminalization: Suppose a government passes a law that makes a certain behavior illegal, such as smoking in public parks, and then applies that law to punish people for smoking in parks before the law was enacted.
In relation to evidence
Supposed the Rules on Evidence were changed to receive less or different testimony than that required at the time of the commission of the offense to convict the accuse. If at the time of trial, the prosecution presented evidence based on the amended rules in order to convict the accused, this is an ex post facto law and is proscribed by the Constitution.