server/msplanner.py
changeset 6598 78eaccfbd2b7
parent 6427 c8a5ac2d1eaa
child 6633 7baea108d326
equal deleted inserted replaced
6597:ba9fb496ad87 6598:78eaccfbd2b7
  1030                                  and x._ms_may_be_processed(terms, linkedterms)
  1030                                  and x._ms_may_be_processed(terms, linkedterms)
  1031                                  and not exclude.get(x) in terms)
  1031                                  and not exclude.get(x) in terms)
  1032         if isinstance(term, Relation) and term in cross_rels:
  1032         if isinstance(term, Relation) and term in cross_rels:
  1033             cross_terms = cross_rels.pop(term)
  1033             cross_terms = cross_rels.pop(term)
  1034             base_accept_term = accept_term
  1034             base_accept_term = accept_term
  1035             accept_term = lambda x: (accept_term(x) or x in cross_terms)
  1035             accept_term = lambda x: (base_accept_term(x) or x in cross_terms)
  1036             for refed in cross_terms:
  1036             for refed in cross_terms:
  1037                 if not refed in candidates:
  1037                 if not refed in candidates:
  1038                     terms.append(refed)
  1038                     terms.append(refed)
  1039         # repeat until no term can't be added, since addition of a new
  1039         # repeat until no term can't be added, since addition of a new
  1040         # term may permit to another one to be added
  1040         # term may permit to another one to be added
  1123         return result
  1123         return result
  1124 
  1124 
  1125     def build_final_part(self, select, solindices, inputmap,  sources,
  1125     def build_final_part(self, select, solindices, inputmap,  sources,
  1126                          insertedvars):
  1126                          insertedvars):
  1127         solutions = [self._solutions[i] for i in solindices]
  1127         solutions = [self._solutions[i] for i in solindices]
  1128         if self._conflicts:
  1128         if self._conflicts and inputmap:
  1129             for varname, mappedto in self._conflicts:
  1129             for varname, mappedto in self._conflicts:
  1130                 var = select.defined_vars[varname]
  1130                 var = select.defined_vars[varname]
  1131                 newvar = select.make_variable()
  1131                 newvar = select.make_variable()
  1132                 # XXX should use var.scope but scope hasn't been computed yet
  1132                 # XXX should use var.scope but scope hasn't been computed yet
  1133                 select.add_relation(var, 'identity', newvar)
  1133                 select.add_relation(var, 'identity', newvar)