Factor out constraintToDecls