Calculus of Frames