A pair of regio-isomeric compounds acting as molecular logic gates with different functions