String attractors: Verification and optimization