A framework for referential sequence compression