let nonconstant_monomials_of a =
match a with
| Term.App((Sym.Arith(op), _), al, _) ->
(match op, al with
| Sym.Num(_), [] -> []
| Sym.Add, (Term.App((Sym.Arith(Sym.Num(_)), _), [], _) :: al') -> al'
| Sym.Add, _ -> al
| _ -> [a])
| _ ->
[a]