chiark / gitweb /
fix a few bugs in THEORY
[topbloke.git] / THEORY
diff --git a/THEORY b/THEORY
index 5dd24c3c25bccc8dcecd2110eb90b7b3ef85d927..13c20af1cf6e2c98d8e696761cbb3cf7419371c0 100644 (file)
--- a/THEORY
+++ b/THEORY
@@ -1,10 +1,14 @@
 GENERAL
 
  C >= D                        C is descendant of D, partial order
C \haspatch D         C contains changes from D, partial order
D \isin C             C contains changes from D, partial order
  Patch P has two sets P+, P-
- Ancestors A(C,P) = { Ca \elem C | Ca \elem P }
- Ends E(C,P) = maximal elements of A(C,P)
+ Ancestors A(C,P) = { Ca \elem P | Ca <= C }
+ Ends E(C,P) = <=-maximal elements of A(C,P)
+ Patch inclusion
+   C \haspatch P    <=> [ \forall D \elem P+: D \isin C <=> D <= C ]
+   C \nothaspatch P <=> [ \forall D \elem P+: D \notisin C ]
+   and we maintain C \haspatch P v C \nothaspatch P
 
 COMMIT ANNOTATIONS
 
@@ -12,14 +16,27 @@ COMMIT ANNOTATIONS
 
  P(C)
    Either P s.t. C \elem P
-   or \bottom meaning \notexists_{P} C \elem P.
+   or _|_ meaning \notexists_{P} C \elem P.
+
+ { Pi | C \haspatch Pi }
+   ie the set of included patches
 
  For every Px, E(C,Px+)
    Implicitly for C \elem Pc+, E(C,Pc+) = { C } 
    and this is not annotated explicitly.
-   Also implicitly for P(C) = \bottom, \forall_{Px} E(C,Px+) = { }
+   Also implicitly for P(C) = _|_, \forall_{Px} E(C,Px+) = { }
    and this is also not annotated explicitly.
 
+ B(C)
+   For C \elem P+:       B s.t. E(C,P-) = { B }
+       P(C) = P- or _|_: _|_
+
+ Of these in principle all except P(C) can be recalculated from the
+ commit history, but that would involve a complete history scan and in
+ the case of \haspatch is clearly impractical.  At some point we may
+ provide a checker/sanitiser that recalculates E(C,Px+) and B(C) from
+ the commit history.
+
 SIMPLE COMMIT
 
  make C >1 { A } 
@@ -101,7 +118,7 @@ CREATE BASE
  from L, P
 
  where
-  P(L) = Pl+ v P(L) = \bottom
+  P(L) = Pl+ v P(L) = _|_
   P(L) != P(B)
   E(B,P+) = { }