I'd use similar predicates to specify the intended result. For example, one way to specify the merge of two sorted integer sequences is as follows:
Range(f) == {f[x] : x \in DOMAIN f} \* better: extend CommunityModules
Monotonic(f) == \A x,y \in DOMAIN f : x \leq y => f[x] \leq f[y]
Merge(s,t) ==
CHOOSE u \in Seq(Int) :
/\ Len(u) = Len(s) + Len(t)
/\ \E f \in [1 .. Len(s) -> 1 .. Len(u)], g \in [1 .. Len(t) -> 1 .. Len(u)] :
/\ Monotonic(f)
/\ Monotonic(g)
/\ Range(f) \inter Range(g) = {}
/\ Range(f) \union Range(g) = 1 .. Len(u)
/\ \A i \in 1 .. Len(s) : u[f[i]] = s[i]
/\ \A i \in 1 .. Len(t) : u[g[i]] = t[i]
Note that if you'd like to evaluate this operator using TLC, you'll have to rewrite the CHOOSE so that the quantifier ranges over a finite set, for example
CHOOSE u \in [1 .. Len(s) + Len(t) -> Range(s) \union Range(t)]
Again, such operators just serve as a logical specification of the result, they do not describe an algorithm for computing it.