Text this: The automatic detection of token structures and invariants using SAT checking