Minimization of P-Circuits using Boolean Relations