code: def get_consistent_labelings(instance,nmodels=0,exclude=[]):
      '''
      [consistent_labelings(instance,nmodels,exclude)] returns a list containing
      [nmodels] TermSet objects representing consistent extensions of the system
      described by the TermSet [instance]. The list [exclude] should contain TermSet objects
      representing (maybe partial) solutions that are to be avoided. If [nmodels] equals [0]
      then the list contain all feasible models.
      '''
      #inputs = get_reductions(instance)
      inst   = instance.to_file()
      prg    = [ consistency_prg, inst, exclude_sol(exclude) ]
      co     = str(nmodels)
      solver = GringoClasp(clasp_options=co)
      models = solver.run(prg)
      os.unlink(inst)
      os.unlink(prg[2])
      return modelf get_consistent_labelings(instance,nmodels=0,exclude=[]):
      '''
      [consistent_labelings(instance,nmodels,exclude)] returns a list containing
      [nmodels] TermSet objects representing consistent extensions of the system
      described by the TermSet [instance]. The list [exclude] should contain TermSet objects
      representing (maybe partial) solutions that are to be avoided. If [nmodels] equals [0]
      then the list contain all feasible models.
      '''
      #inputs = get_reductions(instance)
      inst   = instance.to_file()
      prg    = [ consistency_prg, inst, exclude_sol(exclude) ]
      co     = str(nmodels)
      solver = GringoClasp(clasp_options=co)
      models = solver.run(prg)
      os.unlink(inst)
      os.unlink(prg[2])
      return models
docs: [consistent_labelings(instance,nmodels,exclude)] returns a list containing
      [nmodels] TermSet objects representing consistent extensions of the system
      described by the TermSet [instance]. The list [exclude] should contain TermSet objects
      representing (maybe partial) solutions that are to be avoided. If [nmodels] equals [0]
      then the list contain all feasible models.