Literature isn’t logic, but if you want to describe literature rigorously you will be using a logical system. All science is based on logic.
The scientific method is literally just proving/disproving a logical implication (the hypothesis) using axioms (model assumptions and evidence) to construct a proof (research paper).
Anyway, we’re off from your original statement. You were wondering if math counts as a science. Anything rigorously studied is science.Even in math, hypotheses are formed and tested and occasionally proven wrong.
Non-euclidean space, irrational numbers, Gödels incompleteness theorems, Tarski’s undefinability problem, etc. are all examples of when widely accepted scientific models of sets or geometry or logic etc. were tested and eventually disproven, leading to the creation of new models. That is science.