Updates from master#879
Merged
Merged
Conversation
Instead of equations for a single function, `K` helper functions are
generated and the equations split (more or less?) evenly among them (by
modulo of the Int-valued IDs).
```
syntax TypeInfo ::= lookupType0(Int) [function, total]
syntax TypeInfo ::= lookupType1(Int) [function, total]
...
syntax Typeinfo ::= lookupType<K-1>(Int) [function, total]
rule lookupType(ty(N)) => lookupType0(N) requires N %Int K ==Int 0
rule lookupType(ty(N)) => lookupType1(N) requires N %Int K ==Int 1
...
rule lookupType(ty(N)) => lookupType<K-1>(N) requires N %Int K ==Int <K - 1>
```
Each of the helpers gets its own default, all are total.
```
rule lookupType0(_) => TypeInfoVoidType [owise] // (i.e., not found)
rule lookupType1(_) => TypeInfoVoidType [owise] // (i.e., not found)
...
```
For a given `TypeMapping(ty('X), 'TYPEINFO)`, the `X` is divided by `K`
and the equation is generated in the respective helper function `m = 'X
%Int K`
```
rule lookupType'<m>('X) => 'TYPEINFO
```
This stratification is applied for the `lookupAlloc` and `lookupTy`
functions.
…876) When using pointer offsets followed by dereferencing, the returned result is an array (subslice of the original). In some cases, the value is used as a single element, for instance by projecting out a field. This PR adds a special rule for the field projection case to proceed using the head element in those cases. Related: #771
Stevengre
approved these changes
Dec 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.