  This paper studies the unification problem with associative, commutative, and
associative-commutative functions mainly from a viewpoint of the parameterized
complexity on the number of variables. It is shown that both associative and
associative-commutative unification problems are $W[1]$-hard. A fixed-parameter
algorithm and a polynomial-time algorithm are presented for special cases of
commutative unification in which one input term is variable-free and the number
of variables is bounded by a constant, respectively. Related results including
those on the string and tree edit distance problems with variables are shown
too.
