Skip to content
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

Set statement: Check assignee for validity #3195

Closed
wants to merge 14 commits into from
Closed

Set statement: Check assignee for validity #3195

wants to merge 14 commits into from

Conversation

jwiesler
Copy link
Contributor

@jwiesler jwiesler commented Jul 6, 2023

Replaces set statements as copy assignments with proper set statements that do not have an Java-AST for the assigned value.

Pretty much copy-pastes what JML asserts do.

@jwiesler jwiesler added this to the v2.12.0 milestone Jul 6, 2023
@jwiesler jwiesler requested a review from mattulbrich July 6, 2023 12:47
@jwiesler jwiesler self-assigned this Jul 6, 2023
@github-actions
Copy link

github-actions bot commented Jul 6, 2023

Thank you for your contribution.

The test artifacts are available on Artiweb.
The newest artifact is here.

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Attention: 85 lines in your changes are missing coverage. Please review.

Comparison is base (4a2b5ce) 37.93% compared to head (f31f539) 37.96%.
Report is 5 commits behind head on main.

Files Patch % Lines
...in/java/de/uka/ilkd/key/rule/SetStatementRule.java 32.50% 26 Missing and 1 partial ⚠️
.../uka/ilkd/key/rule/SetStatementBuiltInRuleApp.java 0.00% 8 Missing ⚠️
...d/key/speclang/jml/translation/JMLSpecFactory.java 78.94% 5 Missing and 3 partials ⚠️
...rc/main/java/de/uka/ilkd/key/pp/PrettyPrinter.java 0.00% 7 Missing ⚠️
...main/java/de/uka/ilkd/key/speclang/SLEnvInput.java 58.33% 4 Missing and 1 partial ⚠️
...a/de/uka/ilkd/key/java/statement/SetStatement.java 60.00% 4 Missing ⚠️
.../uka/ilkd/key/java/visitor/CreatingASTVisitor.java 0.00% 4 Missing ⚠️
...ey/java/visitor/InnerBreakAndContinueReplacer.java 0.00% 4 Missing ⚠️
...a/visitor/OuterBreakContinueAndReturnReplacer.java 0.00% 4 Missing ⚠️
...ey/rule/metaconstruct/WhileLoopTransformation.java 0.00% 4 Missing ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3195      +/-   ##
============================================
+ Coverage     37.93%   37.96%   +0.02%     
- Complexity    17035    17064      +29     
============================================
  Files          2060     2064       +4     
  Lines        126284   126421     +137     
  Branches      21303    21318      +15     
============================================
+ Hits          47912    47990      +78     
- Misses        72487    72542      +55     
- Partials       5885     5889       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mattulbrich
Copy link
Member

This PR seems to replace set statements as copy assignments with proper set statements that do not have an Java-AST for the assigned value.

If that is so, that would be great and expressions can be supported in set statements like quantifiers etc.
We can then probably remove all the special java expression constructs for JML-artifacts, right?

@jwiesler
Copy link
Contributor Author

We can then probably remove all the special java expression constructs for JML-artifacts, right?

The Recoder removal branch does this except for set statements.

@wadoon wadoon enabled auto-merge July 20, 2023 09:05
@mattulbrich mattulbrich modified the milestones: v2.12.0, v2.14.0 Jul 21, 2023
* origin/main: (331 commits)
  increase spotless version (and thus also eclipse formatter) to fix missing space in instanceof formatting
  Spotless and fix rebase
  Some additional minor fixes and spotlessApply
  Update `collect(Collectors.toList())` to `toList()`
  Introduction of record classes where it seems useful.
  Refactor: Introduce a pattern variable were possible.
  Translate large string concatenations into raw string literal (text blocks)
  update beanshell version in recoder's dependencies
  Switch to Java 17 for KeY-2.14.0
  repair POM generation using afterEvaluate
  Adding license to KeY files
  Adding license to Java files
  add metadata for POM generation and update templates for license headers
  Bump ch.qos.logback:logback-classic from 1.4.8 to 1.4.11
  Fix bug in icon selection
  update samplesIndex.txt
  Repair example index
  better default keyboard shortcuts, corrected docs URL, cleanup
  removing the SmansEtAl example from first touch
  change docking frames dependencies to maven central versions
  ...
@wadoon wadoon requested a review from mattulbrich September 11, 2023 00:05
@wadoon
Copy link
Member

wadoon commented Sep 11, 2023

I have removed the var types and updated the branch to the current KeY version.

@mattulbrich You can re-review.

* origin/main: (180 commits)
  Use Amazon's Corretto
  add caching for gradle dependencies
  Update to Java 21 Runtime for testing
  Add HelpInfo to more extensions
  Add help buttons to extension settings
  Use pattern matching to avoid cast
  Change default notification setting to unfocused
  Renaming from reviewer suggestion (got lost when splitting the PR)
  Minor cleanup
  Prevent possible NullPointerException.
  Cleanup. Remove last usage of the legacy matcher.
  Check only new terms for well-typedness
  Move static metavariable cache to service caches
  Minor cleanup incl. spotless changes
  Use array of assumes instantiations
  Preparation for parallel prover engine - make Strategies stateless by introducing a specific explicit state object for TermBuffers and the Backtracking Manager   This will allow strategies to execute in parallel
  Update keyext.ui.testgen/src/main/java/de/uka/ilkd/key/gui/testgen/CounterExampleAction.java
  Update keyext.ui.testgen/src/main/java/de/uka/ilkd/key/gui/testgen/TGInfoDialog.java
  Some cleanup and proper switching to automode
  Avoid access of non-private field in synchronized context
  ...

# Conflicts:
#	key.core/src/main/java/de/uka/ilkd/key/speclang/njml/PreParser.java
@wadoon wadoon added Review Request Waiting for review Under Review Pull request is currently reviewed. Please assign only when you are currently doing the review! and removed Postponed labels Nov 24, 2023
This reverts commit c539948.

Reason for reverting: The implemented changes to pretty printing assertions
raised exceptions during interactive application. However this change has
nothing to do with the original intention of this branch.
Undoing some changes that accompanied the reverted commit before this.
@mattulbrich
Copy link
Member

This does not fully reach its potential: The JavaCC parser still runs over the expression which is set; this is unlike in the case for JML assertions where all expressions are supported. Hence

//@ set b = (\forall int k; true);

still raises an exception for a boolean ghost variable b.

@mattulbrich
Copy link
Member

I reverted commit c539948 since that has nothing to do with the problem here and introduces a GUI runtime exception due to pretty printing. The issue can be separated and be resolved properly elsewhere.

it makes the code more conservative.
@mattulbrich mattulbrich self-assigned this Jan 13, 2024
@mattulbrich
Copy link
Member

(this is WIP. forced updates to the branch are not unlikely in the near future.)

@wadoon wadoon closed this Feb 11, 2024
auto-merge was automatically disabled February 11, 2024 23:00

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaJMLParser Review Request Waiting for review Under Review Pull request is currently reviewed. Please assign only when you are currently doing the review!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants