Does list_all_roots always return the minimum set of roots?
No. There are some special cases where the number of roots returned is not minimum. However, even for these cases, the number of roots returned is only one more than the minimum number. The reason for this limitation is not due any defect in the algorithm used for computing the number of roots. It is because we want the list_all_root to return the distinguished root context among all the root contexts. Thus, in the scenario where you have only two contexts, a context containing the distinguished root context, the list_all_root operation will return both contexts as roots.