Implementation of gin triconsistent functions.