Theoretical Background for AfterMath Techniques