Polymers and oligomers of carbon dioxide: ab initio and semiempirical calculations