We first attempt decomposing the term a further and if it is a value of arity k, then we decompose the context E up to k left-application levels.

     
let decompose ce = try decompose_down ce with Value k -> decompose_up k ce;;