We describe a tweezer-like molecule constituted of two 4,4'-bipyridinium arms connected by means of alkyl spacers to a 1,1'-binaphthyl unit acting as a hinge. In aqueous solution the twist angle of the binaphthyl can be reversibly modulated by chemical or photochemical reduction of the bipyridinium moieties, and/or addition of cucurbit[8]uril, showing a non-trivial XNOR logic behavior.