Exemplo n.º 1
0
void ProofOutputChannel::conflict(TNode n, std::unique_ptr<Proof> pf)
{
  Trace("pf::tp") << "ProofOutputChannel: CONFLICT: " << n << std::endl;
  Assert(!hasConflict());
  Assert(!d_proof);
  d_conflict = n;
  d_proof = std::move(pf);
  Assert(hasConflict());
  Assert(d_proof);
}
Exemplo n.º 2
0
void Sudoku::updateConflictAfterClean(int x, int y, int res){
	int i, j;
	conflict[x][y] = false;
	for(i = 0; i < 9; i++){
		if(i != y && puzzel[x][i] == res){
			conflict[x][i] = hasConflict(x, i);
		}
		if(i != x && puzzel[i][y] == res){
			conflict[i][y] = hasConflict(i, y);
		}
	}

	int sx = x / 3 * 3;
	int sy = y / 3 * 3;
	for(i = sx; i < sx + 3; i++)
		for(j = sy; j < sy + 3; j++)
			if((i != x || j != y) && puzzel[i][j] == res) {
				conflict[i][j] = hasConflict(i, j);
			}
}
Exemplo n.º 3
0
bool PpMatrix::isConflictFree() const
{
  for (int col1 = 0; col1 < _n; ++col1)
  {
    for (int col2 = col1 + 1; col2 < _n; ++col2)
    {
      if (hasConflict(col1, col2))
      {
        return false;
      }
    }
  }
  
  return true;
}
Exemplo n.º 4
0
Future<InvalidationRequired> CheckoutAction::doAction() {
  // All the data is ready and we're ready to go!

  // Check for conflicts first.
  return hasConflict().thenValue(
      [this](
          bool conflictWasAddedToCtx) -> folly::Future<InvalidationRequired> {
        // Note that even if we know we are not going to apply the changes, we
        // must still run hasConflict() first because we rely on its
        // side-effects.
        if (conflictWasAddedToCtx && !ctx_->forceUpdate()) {
          // We only report conflicts for files, not directories. The only
          // possible conflict that can occur here if this inode is a TreeInode
          // is that the old source control state was for a file. There aren't
          // really any other conflicts than this to report, even if we recurse.
          // Anything inside this directory is basically just untracked (or
          // possibly ignored) files.
          return InvalidationRequired::No;
        }

        // Call TreeInode::checkoutUpdateEntry() to actually do the work.
        //
        // Note that we are moving most of our state into the
        // checkoutUpdateEntry() arguments.  We have to be slightly careful
        // here: getEntryName() returns a PathComponentPiece that is pointing
        // into a PathComponent owned either by oldScmEntry_ or newScmEntry_.
        // Therefore don't move these scm entries, to make sure we don't
        // invalidate the PathComponentPiece data.
        auto parent = inode_->getParent(ctx_->renameLock());
        return parent->checkoutUpdateEntry(
            ctx_,
            getEntryName(),
            std::move(inode_),
            std::move(oldTree_),
            std::move(newTree_),
            newScmEntry_);
      });
}
Exemplo n.º 5
0
const Proof& ProofOutputChannel::getConflictProof() const
{
  Assert(hasConflict());
  return *d_proof;
}