A mathematical framework for Dirac's calculus