Characteristic Lie algebra and classification of semidiscrete models