Skip to content

[WIP][C++ BoundsSafety] Experimental change of how we substitute and compare expressions #11148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

ziqingluo-90
Copy link

@ziqingluo-90 ziqingluo-90 commented Aug 8, 2025

The basic idea is to create a wrapper class that owns a container holding AST nodes. With that, substitution can be done by manipulating the container. This implementation uses a list to hold sequentialized Exprs.

With extra handling of DREs representing MemExprs, the implementation guarantees that if two expressions are equivalent, their sequentialized representation will have the same number of elements. Then the comparison can be done element-wise.

Examples of sequentialized expressions:

  1. x + y -> | + | x | y |, where + denotes a binary plus operation
  2. x[4].f -> | .f | [] | x | 4 | , where .f denotes a member field access; [] denotes array subscript;

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