implementation of cnf2cls method