Skip to content

Add an API for lambda expressions [blocks: #4651] #4672

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

Merged
merged 3 commits into from
May 19, 2019

Conversation

tautschnig
Copy link
Collaborator

This is factored out from/in preparation of #4651, which will eventually also add testing for this code.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

We have support for ID_lambda expressions in some places, but did not
yet have a proper API for them.
The API increases the readability of the code and also enables early
checking for valid expression structure.
Replacing the lambda parameter by the argument value may permit further
simplification, for example in case of constant arguments.
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 548e8e2).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112369892
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

@peterschrammel peterschrammel removed their assignment May 19, 2019
@tautschnig tautschnig merged commit 09a5ad9 into diffblue:develop May 19, 2019
@tautschnig tautschnig deleted the lambda-exprt branch May 19, 2019 22:01
@antlechner
Copy link
Contributor

@tautschnig This change is causing problems in TG, and it took me a while to understand it because I was thinking about lambdas in general (= any kind of anonymous function) and didn't understand why the documentation and constructor were about array types only. @smowton explained to me that these "lambda_exprts" aren't general lambdas, but they are used for the specific case of defining an array using a kind of list comprehension. I think it would be clearer to name them array_comprehension_exprt, even if their ID_lambda and related functions can't be changed for compatibility reasons. I'll make a PR for the renaming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants