let poly_of a =
match a with
| App(Arith(op), l) ->
(match op, l with
| Num(q), [] -> (q, [])
| Multq _, _ -> (Q.zero, [a])
| Add, ((x :: xl') as xl) ->
(match x with
| App(Arith(Num(q)), []) -> (q, xl')
| _ -> (Q.zero, xl))
| _ -> assert false)
| _ ->
(Q.zero, [a])