Tipping the foot into InfFlow refactoring #3640
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
InfFlow (and WD) are functionalities that tear furrows through the
key.coremodule. Following packages/classes are directly depending on the infflow classes:Isolating these functionalities could be a great improvement (a) for comprehensibility and (b) for modularity.
Current state: A prototype for evaluating the possible strategies:
Strategy: Hooks
In
WileInvariantRule, InfFlow manipulates the "bodyGoal", while WD adds a fourth goal. The new hookWhileInvariantHookallows both functionalities by supplying too many parameters.In the end, I would propose the following base class:
Strategy 2: Inheritance + Profile
BlockContractInternalRulehad an isolated decision for validity in InfFlow proofs. Here, using inheritance is a good option. The downside is that we now need a "Java InfFlow Profile", because we need to disable the traditionalBlockContractInternalRuleand activateInfFlowBlockContractInternalRule:But in many places,
BlockContractInternalRuleis directly used:This might result in strange behavior, e.g., the context menu
CurrentGoalViewMenuhas a special treatment for which it checks for identity withBlockContractInternalRule.INSTANCE.Discussion
Profiles low.rule == XXX.INSTANCE) needs to be removed.Profileis already built-in and allows the manipulation of much more than built-in rules, e.g., Taclet Options, Taclet paths, etc.Side Observations
WD is globally in KeY, but it should rather be dependent on the proof settings.
Using Profiles can tighten the
standardRules.keyto the base case.Intended Change
Isolating InfFlow (and WD) inside core into their own package s.t. these functionalities are concentrated and do not pollute the system architecture. InfFlow/WD was integrated using the "instanceOf" and patch-style, hence, you can find hard dependencies in many Built-in Rules to these classes.
We might not get infflow/wd inside external modules (b/c of cycle dependency to
key.core), but an encapsulation should be achievable.This might also be a great opportunity to sharpen the modularity of
key.core.Plan
Type of pull request
key.corefor deep functionality manipulationEnsuring quality
.github/workflows/tests.yml