Logic is used in mathematics .
Predicate logic is the generic term for symbolic formal systems such as first-order logic , second-order logic , many-sorted logic , and infinitary logic .