-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Shared: Generalize the number of columns in a generated MaD row #18612
Conversation
598d4ec
to
13e0829
Compare
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.
Very nice approach!
or | ||
i = 4 and ExternalFlow::partialModel(api, _, _, _, _, result) // parameters | ||
or | ||
i = 5 and result = "" and exists(api) // ext |
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.
So replacing the conjunction with disjuncts (and index) and a subsequent concat works because the values in each column is a function of the api
(just an observation and not anything that requires action).
+ parameters + ";" // | ||
+ /* ext + */ ";" // | ||
) | ||
result = concat(int i | | Lang::partialModelRow(api, i), ";" order by i) + ";" |
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.
maybe use strictconcat
instead.
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.
Makes sense, there should always be at least one column.
+ name + ";" // | ||
+ parameters + ";" // | ||
) | ||
result = concat(int i | | Lang::partialNeutralModelRow(api, i), ";" order by i) + ";" |
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.
same comment as above.
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.
LGTM 🎉
Currently the
partialModel
predicate inModelGeneratorInputSig
requires exactly 5 columns to specify each target for a model. In Rust we only need 2 columns to identify a function. This PR generalizes thepartialModel
to apartialModelRow
where any number of columns is supported.