Definition of ex Post Facto
Ex post facto laws or laws "after the fact" are expressly forbidden by the United States Constitution in Article 1, Section 9, Clause 3. Under this clause a person cannot be convicted and punished for a crime if the action was legal at the time it was performed but has since been made illegal.
For example, if someone was driving their car on Tuesday and the speed limit was 40 mph and the police clocked them under the speed limit but the next day the city changed the speed limit in the same area to 30 mph and because the officer had evidence the driver was driving over the speed limit the day before he decided to stop the lady and give her a ticket, under the concept of ex post facto she could not be charged with speeding because it was legal when she performed the action.
Some laws can be changed ex post facto which makes a formerly illegal act, legal. For example, some individuals dodged the draft for the Vietnam War but were given amnesty after the war and their once illegal act was no longer considered illegal.