Shop Semirings And Affine Equations Over Them: Theory And Applications