Associative matching for linear terms