TOWARDS A LEGAL FRAMEWORK FOR ARTIFICIAL INTELLIGENCE