A theory of algebraic integration