Added comments and explainer output.
Added lots of comments to make this problem clearer. Also added code to generate "explainer output" when a solution has been found. Note that there is a typo which remains: "leave" instead of "leaf" but I left this as-is.
I can't believe it's been 3 years already, my brain has lost any knowledge about minizinc like a leaky sieve. Guess I will have to take the course again. Such is life in the zone.
But apart from that, I don't think this change will ever be taken up, should I drop my forked "specialization-examples" repository?
I'm sorry that it has been so long and nothing has been done with your suggested improvements. It certainly is something that I would like to have a look at, but it is hard to find time to do so. I will see whether I can do so within the next month or so.
Thanks Jip. I know that feel.