Skip to content

[injector] Unfold rules at the recursive end of the rule#99

Merged
filipeom merged 2 commits into
mainfrom
filipe/fix-rules-unfolding
Jun 30, 2026
Merged

[injector] Unfold rules at the recursive end of the rule#99
filipeom merged 2 commits into
mainfrom
filipe/fix-rules-unfolding

Conversation

@filipeom

Copy link
Copy Markdown
Member

To optimize depth calculation, unfolding of recursive rules should only be done at the recursive end of the rule i.e., in a graph with:

A -> B -> C -> A

Unfolding to k-depth should yield:

A_k := B_k
B_k := C_k
C_k := A_{k - 1}

This is acheived using a sort of topological sort on recursive rules to obtain an order to break up loops.

filipeom added 2 commits June 30, 2026 09:42
To optimize depth calculation, unfolding of recursive rules should only
be done at the recursive end of the rule i.e., in a graph with:

```
A -> B -> C -> A
```

Unfolding to k-depth should yield:

```
A_k := B_k
B_k := C_k
C_k := A_{k - 1}
```

This is acheived using a sort of topological sort on recursive rules to
obtain an order to break up loops.
@filipeom filipeom force-pushed the filipe/fix-rules-unfolding branch from e39089f to 4cd9108 Compare June 30, 2026 08:56
@filipeom filipeom merged commit 58d911a into main Jun 30, 2026
0 of 3 checks passed
@filipeom filipeom deleted the filipe/fix-rules-unfolding branch June 30, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant