A set of general rules for not losing a connection to reality. Could be used in reasoning or computer programming.
this is amusingly missing the point. logic is, by its nature, an abstraction away from reality. it's a set of specific (not general) rules for evaluating statements of language (whether that language is natural, mathematical, or artificial/computer) such that meaning can be disambiguated. "reality", whatever it is, has no such requirement that it can be expressed in unambiguous statements.
Not the OP, but you could say that no "language" exists outside of "reality", and stretching it further you could also say that all types of languages (formal, mathematical, artificial/computer), including the associated "rules", are social constructs which depend heavily on the time and place of their "existence", i.e. on "reality".
Until we meet some quantum-like entity which might "talk" to us from outside the boundaries of this physical Universe we're doomed to be solipsistic: we construct "abstractions" that are meant to distance us from "reality" only to find out in the end that "reality" was behind those "abstractions" all along.