A General Algorithm for Deciding Transportability of Experimental Results