Will artificial intelligence destroy mankind?

In 1968, Stanley Kubrick shot the cult film 2001: Space Odyssey based on a story by Arthur C. Clarke. It brings a vision of the future based on a story of an expedition sent to Jupiter in order to gain evidence of a possible existence of another civilization in space.

Five people and an artificial intelligence computer HAL 9000 travel across the universe. HAL controls all on-board systems. When the computer starts reporting wrong messages, the crew decides to turn it off, which becomes fatal for its members. HAL evaluated the goal of the mission as more important than human lives.

Since then, lots of other works have been created asking the question whether people could become victims of their own creations that get out of control. Since artificial intelligence is no longer science fiction, it's legitimate to ask whether we should fear further developments.