https://123dok.net/document/yj7r004p-revisiting-the-tree-constraint.html