Algorithm and Tools for Constructing Canonical Forms of Linear Semi-Algebraic Formulas