AI Systems Under Criminal Law: a Legal Analysis and a Regulatory Perspective