I want to break down a 2-3-4 tree to small nodes.
These are the types I am using:
type ele = int
type color = Red|Black
type ab = Vide | Node of ( ele * color * ab * ab *ab)
type ab234 = Vide
|Node_1 of (ele * ab234* ab234)
|Node_2 of(ele * ele * ab234 *ab234 *ab234) ``
|Node_3 of(ele * ele * ele *ab234 * ab234* ab234 *ab234)
I based my mapping on this:

I need help doing my transformation. I tried with this function but it doesn't seem to work, it does break down the root but it doesn't continue to the branches:
let rec eclat = function
| Vide -> Vide
| Node_3(r,x,y,ag,mg,md,ad) -> eclat ( Node_1(x,(Node_1(r,ag,mg)),Node_1(y,md,ad)))
| Node_2(r,x,ag,ml,ad) -> eclat(Node_1(r,(Node_1(x,ag,ml)),ad))
| _ -> failwith("zebi") ;;
If I enter your
eclatfunction as you have it now, I get this:So that's one problem.
I also note that you changed
abtoab234, but you didn't change the internal appearances inside the type. So the contents of theab234type are all defined to be of typeab. This doesn't seem correct.