Text this: Triangle-based consistencies for cost function networks.