Okay, I guess you could program a robot to "kill all humans."
1. Get an image or surroundings from a camera
2. Run facial recognition algorithms. These exist."
3. Send control commands to orient machine guns in general direction of target, if classified as "enemy"
4. Written and directed by James Cameron
Still, this is not artificial intelligence. This is software, combined with bad judgement.