-
Notifications
You must be signed in to change notification settings - Fork 822
[analysis] Add an abstraction lattice #8036
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
base: main
Are you sure you want to change the base?
Conversation
0ed9242 to
82ce454
Compare
The abstraction lattice is composed of increasingly abstract sub-lattices. Elements of the abstraction lattice are variants that may hold the elements of any of its constituent lattices. When elements from different sub-lattices are compared or joined, the more concrete element is first abstracted into the lattice of the other element. Unrelated elements in the same lattice may be abstracted before they are joined. This choice and the abstraction operation itself are provided by CRTP subclasses of Abstraction. This is an important building block for eventually reconstructing PossibleContents on top of the lattice framework.
82ce454 to
7b596ad
Compare
| // template<size_t I, typename E> | ||
| // bool shouldAbstract(const E&. const E&) const | ||
| // | ||
| // shouldAbstract is only queries for unrelated elements. Related elements of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // shouldAbstract is only queries for unrelated elements. Related elements of | |
| // shouldAbstract is only queried for unrelated elements. Related elements of |
| } | ||
|
|
||
| using OddEvenInt = analysis::Flat<uint32_t>; | ||
| using OddEvenBool = analysis::Flat<bool>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "odd even int" mean? Every integer is already even or odd. This seems like just an integer?
"odd even bool" I can see as being interpreted as "a boolean saying whether it is even or odd"- is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is just an integer. I could use a namespace instead of the OddEven name prefix, perhaps. Yes, the bool is true for even, false for odd, and top when it can be either.
| return LESS; | ||
| case NO_RELATION: | ||
| case GREATER: | ||
| return NO_RELATION; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow this. We abstract a, then compare - but we turn that outcome into either "less" or "no"? Why can't we return "greater"or "equal"?
The abstraction lattice is composed of increasingly abstract
sub-lattices. Elements of the abstraction lattice are variants that may
hold the elements of any of its constituent lattices. When elements from
different sub-lattices are compared or joined, the more concrete element
is first abstracted into the lattice of the other element. Unrelated
elements in the same lattice may be abstracted before they are joined.
This choice and the abstraction operation itself are provided by CRTP
subclasses of Abstraction.
This is an important building block for eventually reconstructing
PossibleContents on top of the lattice framework.