ortools/sat/cp_model_presolve.cc
std::vector<int> GetLiteralsFromSetPPCConstraint(ConstraintProto* ct) {
  std::vector<int> sorted_literals;
  if (ct->constraint_case() == ConstraintProto::ConstraintCase::kAtMostOne) {
    for (const int literal : ct->at_most_one().literals()) {
      sorted_literals.push_back(literal);
    }
  } else if (ct->constraint_case() ==
             ConstraintProto::ConstraintCase::kBoolOr) {
    for (const int literal : ct->bool_or().literals()) {
      sorted_literals.push_back(literal);
    }
  }
  std::sort(sorted_literals.begin(), sorted_literals.end());
  return sorted_literals;
}
// Returns the sorted list of literals for given bool_or or at_most_one
// constraint.
Returns the sorted list of literals for given bool_or or at_most_one
constraint.
Returns the sorted list of literals for given bool_or or at_most_one constraint .
std::vector<int> GetLiteralsFromSetPPCConstraint(ConstraintProto* ct) {
  std::vector<int> sorted_literals;
  if (ct->constraint_case() == ConstraintProto::ConstraintCase::kAtMostOne) {
    for (const int literal : ct->at_most_one().literals()) {
      sorted_literals.push_back(literal);
    }
  } else if (ct->constraint_case() ==
             ConstraintProto::ConstraintCase::kBoolOr) {
    for (const int literal : ct->bool_or().literals()) {
      sorted_literals.push_back(literal);
    }
  }
  std::sort(sorted_literals.begin(), sorted_literals.end());
  return sorted_literals;
}
std :: vector < int > GetLiteralsFromSetPPCConstraint ( ConstraintProto * ct ) { std :: vector < int > sorted_literals ; if ( ct -> constraint_case ( ) == ConstraintProto :: ConstraintCase :: kAtMostOne ) { for ( const int literal : ct -> at_most_one ( ) . literals ( ) ) { sorted_literals . push_back ( literal ) ; } } else if ( ct -> constraint_case ( ) == ConstraintProto :: ConstraintCase :: kBoolOr ) { for ( const int literal : ct -> bool_or ( ) . literals ( ) ) { sorted_literals . push_back ( literal ) ; } } std :: sort ( sorted_literals . begin ( ) , sorted_literals . end ( ) ) ; return sorted_literals ; }
Returns the sorted list of literals for given bool_or or at_most_one
constraint.
Returns the sorted list of literals for given bool_or or at_most_one constraint .