As a pilot and instructor myself I would say yes, pilots can be replaced by good technology.
For any abnormal event, we train pilots to follow procedures. Some abnormal events have defined procedures, others you need to make it up as you go - but based on a structured process of elimination. No doubt a machine would do a great job if programmed properly.
Anyone who say's it's not possible lacks imagination!