Solving linear equations and inequalities in SAT math