Polyvalent logic