Article 29 (Application of criminal law) (1) No one may be sentenced under the criminal law unless the action or omission in question is punishable under a pre-existing law, nor may any person be the object of a security measure unless the prerequisites therefore are laid down by a pre-existing law. (2) The provisions of the previous paragraph do not preclude the punishment up to the limits laid down by internal Portuguese law of an action or omission which was deemed criminal under the general principles of international law that were commonly recognised at the moment of its commission. (3) No sentence or security measure may be applied unless it is expressly sanctioned by a pre-existing law. (4) No one may be the object of a sentence or security measure that is more severe than those provided for at the moment of the conduct in question, or at that at which the prerequisites for the application of such a measure were fulfilled, while criminal laws whose content is more favourable to the accused person shall be applied retroactively. (5) No one may be tried more than once for commission of the same crime. (6) Citizens who are unjustly convicted have the right to the review of their sentences and to compensation for the damages they have suffered, as laid down by law. Article 30 (Limits on sentences and security measures) (1) No sentence or security measure that deprives or restricts freedom may be perpetual in nature or have an unlimited or undefined duration. (2) In cases of danger based on a serious psychic abnormality in which therapy in an open environment is impossible, security measures that deprive or restrict freedom may be successively extended for as long as the psychic state in question is maintained, but always by judicial decision. (3) Criminal liability is not transferable. (4) No sentence shall automatically involve the loss of any civil, professional or political right. (5) Convicted persons who are the object of a sentence or security measure that deprives them of their freedom retain their fundamental rights, save for the limitations that are inherent to the purpose of their convictions and to the specific requirements imposed by the execution of the respective sentences.