One Color Theory ---------------- Theory makeOneColorTheory(cell) { var color = cell.averageColor(); var theory = postAssumption("Color of every pixel in $cell is $color.", +cell, +color, validity := "unknown"); testOneColorTheory(cell, theory); return theory; } void noteCellColor(cell, theory) { var desc = "Pixel check at " + cell; if theory.hasExampleNamed(desc) return; var strength = cell.area/theory.cell.area; // how much do we have to say about the cell in the theory? var p = derivationToProbability(derivation); addExampleToTheory(theory, desc, +p, +strength); } void testOneColorTheory(cell, theory) { noteCellColor(cell, theory); at shouldSplitCell(cell) do: for split, splitProbability in usefulSplits(cell): at splitProbability do: for cell in split: testOneColorTheory(cell, theory/*.branch(description := "recursion to " + cell)*/); /* I think the following is actually BS: for dimension in x/y: var split = cell.equalSplit(dimension); var op = outlierProbabilities(split.colors()); for idx, p in op: at p do: var sub = likelyNonOutlyingContingent(split, op); testOneColorTheory(sub, theory);*/ }