0
$\begingroup$

Given a sequence/string of values and an algorithm that can process said sequence in both directions and obtain the same result - does it follow that the problem can in fact be decomposed in a divide-and-conquer sort of manner?

The sum of a sequence of numbers can be computed sequentially both from left to right and from right to left - it also can be computed if we recursively compute the sum of the left/right halves of the sequence and apply the sum operator on the results of the subproblems. Would work for any associative operation (sum, mul, max, min, etc etc).

Even more, the argument can be made for parsing some languages - json/lisps can be parsed in both directions and all it takes is to find a good way to merge partial results.

Intuitively this should work - is there a theorem that proves this? Does it have a name?

$\endgroup$

1 Answer 1

0
$\begingroup$

http://research.nii.ac.jp/~hu/pub/popl09.pdf

I watched a talk by Guy Steele years ago which was nowhere to be found so I thought it's my imagination. Said talk was reuploaded and he mentions this implication and paper at https://youtu.be/dPK6t7echuA?t=3755 this timestamp

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.