-
Notifications
You must be signed in to change notification settings - Fork 152
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
Reverse pyk match operator #2599
Conversation
Also,
|
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.
A previous discussion we had on this topic: #2470 (comment).
To sum up. my take on the issue is the following.
- Both "pattern matches term" and "term matches pattern" are in use.
- Both
map(patterm.match, iterable)
andmap(term.match, iterable)
have natural use cases. term.match(pattern) is not None
corresponds to "the set of models ofterm
is a subset of the set of models ofpattern
". Notice that the order of operands is the same in both the code and its logical interpretation. This is also the direction we draw our abstraction edges inKCFG
.
But I do not have a strong opinion on this one, so I'm fine with pattern.match(term)
.
Yeah, I remember being unsure what the correct direction was before, but I think the fact that I spent an hour being baffled at how the summarization algorithm was working was a strong enough indicator of what I naturally expected while working with the library. |
I was trying to explain the algorithm behind summarization to @xc93 and realized that on this line:
https://github.com/runtimeverification/erc20-verification/blob/master/ksummarize/src/ksummarize/kevm_summarize.py#L211
we are saying
term.match(pattern)
. I would much prefer for us to saypattern.match(term)
, it matches the same direction asmatch(pattern, term)
that I'm used to for a long time and makes more sense in my head. I can't provide a better justification for it than this, but I did confirm that this is the only use that needs to change.