(p1, p2, ring)
return s
Compute LCM(LM(p1), LM(p2))/LM(p1)*p1 - LCM(LM(p1), LM(p2))/LM(p2)*p2
    This is the S-poly provided p1 and p2 are monic
Compute LCM(LM(p1), LM(p2))/LM(p1)*p1 - LCM(LM(p1), LM(p2))/LM(p2)*p2
    This is the S-poly provided p1 and p2 are monic
Compute LCM ( LM ( p1 ) LM ( p2 )) / LM ( p1 ) * p1 - LCM ( LM ( p1 ) LM ( p2 )) / LM ( p2 ) * p2 This is the S - poly provided p1 and p2 are monic
def spoly(p1, p2, ring):
    """
    Compute LCM(LM(p1), LM(p2))/LM(p1)*p1 - LCM(LM(p1), LM(p2))/LM(p2)*p2
    This is the S-poly provided p1 and p2 are monic
    """
    LM1 = p1.LM
    LM2 = p2.LM
    LCM12 = ring.monomial_lcm(LM1, LM2)
    m1 = ring.monomial_div(LCM12, LM1)
    m2 = ring.monomial_div(LCM12, LM2)
    s1 = p1.mul_monom(m1)
    s2 = p2.mul_monom(m2)
    s = s1 - s2
    return s
def spoly ( p1 , p2 , ring ) : LM1 = p1 . LM LM2 = p2 . LM LCM12 = ring . monomial_lcm ( LM1 , LM2 ) m1 = ring . monomial_div ( LCM12 , LM1 ) m2 = ring . monomial_div ( LCM12 , LM2 ) s1 = p1 . mul_monom ( m1 ) s2 = p2 . mul_monom ( m2 ) s = s1 - s2 return s