An extended algebra for constraint databases