Term logic with a selection operator