Given a list in APL I would like to check that each adjacent pair is in order.
So, given (a0, a1, ..., an), I would like to calculate:
(a0 ≤ a1) ∧ (a1 ≤ a2) ∧ .... ∧ (a[n-1] ≤ an)
I don't want to compute an equivalent form and I want to use tacit programming.
My solution is ((¯1↓⊢)∧.≤(1↓⊢)) but it seems too verbose.
Does anyone have any ideas?
∧/2≤/⊢X f/ Ycomputes thef-reductions inYusing sliding windows of sizeX. Therefore, ifX←2then we get pair-wise reductions, or in other words, insertion offbetween subsequent pairs.⊢is needed to complete the 3-train2 ≤/ ⊢and then we just have to AND together all the resulting Booleans using∧/