Synthesis and studies of molecules exhibiting excited state proton transfer and aggregation induced emission as sensors and logic devices