Characterizing Termination of Logic Programs with Level Mappings