# [darcs-users] Patch Theory in action

Kevin Smith yarcs at qualitycode.com
Sat Nov 22 17:09:07 UTC 2003

```Marnix Klooster wrote:
> A tree is...
> A patch is...
> A change is.. the intention
...

Very nice summary! I hope the upcoming manual revision includes stuff
like this, as well as concrete examples.

While on the subject of the manual, I found a couple other things in
Appendix A hard to follow:

1. Why are the patch lists "backward"? I expect ABC to mean that patch A
was applied first, not last.

2. The M(A, B) notation is never mapped back to the ABC notation, which
seemed jarring.

3. The statement "it is possible to show that the right inverse of a
patch is equal to its left inverse." is never really explained. What is
a "left inverse" or a "right inverse"?

4. I found this statement (immediately after Theorem 2) difficult to
follow "This can easily be proven by multiplying both sides of the first
commutation by * on the left, and by * on the right." As a programmer
(not a mathematician), the idea of "multiplying" patches seems odd.

I didn't know what you meant by "on the left" and "on the right", so it
took me a couple tries to get the proof to work. I would definitely
include the proof in the appendix:

P2' P1       <==>       P1' P2
P1'-1 P2' P1 P1-1  <==> P1'-1 P1' P2 P1-1
P1'-1 P2'          <==>           P2 P1-1

I would also change the wording to something like: "This can easily be
proven by starting with the first commutation, and applying P1'-1 to the
left end of each side of the commutation, and applying P1-1 to the right
end of each side."

If ABC meant to do patch A first (instead of last), then this wording
could use "beginning" and "end", because they would refer both to the
symbolic representation, and to the chronological application of the
patches.

Whew.

> By the way, I don't see it as "creepy" that a patch is meaningless
> without its context.

You are right, of course, that any patch (regardless of RCS) floating
without context is not particularly helpful. The part I found slightly
creepy (but powerful) is that darcs silently alters the representation
of a "change" as necessary to fit the context. It is a different way of
thinking about changes/patches, and I think I like it, but it requires