A computational algebraic-geometry method for conditional-independence inference