A Formal Perspective On Hyperdimensional Computing