Skip to content

Commit 779fe03

Browse files
pmderodatraph-amiard
authored andcommitted
Adalog: rework Topo_Sort to use recursion
While Topo_Sort was so far using several linear passes over the atoms to sort, this new version uses a recursive traversal to add dependencies before the atom that depends on them. This will make it possible to handle atoms that have several dependencies. We had a satisfying workaround for N_Predicate so far as they can always all go at the end of the sorted list of atoms. An upcoming change will introduce N_Propagate, which will not only depend on several logic variables, but will also provide a definition for one, making the current Topo_Sort unsuitable. Since Topo_Sort now no longer adds relations with unsatisfied dependencies to its result (it used to do it for N_Predicate), there is no need to have the corresponding protections in Solve_Atomic. TN: SB20-024 For libadalang/langkit#618
1 parent 3254a7d commit 779fe03

File tree

2 files changed

+135
-177
lines changed

2 files changed

+135
-177
lines changed

0 commit comments

Comments
 (0)