generalize to associative