-
Notifications
You must be signed in to change notification settings - Fork 41
Modularization: InfFlow and WD as separate modules #3640
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
base: main
Are you sure you want to change the base?
Conversation
8fdae0d to
928ad61
Compare
55807a9 to
9f24067
Compare
19d1302 to
82f9ee6
Compare
564ba71 to
c08f3e7
Compare
* if IF is missing and a IF contract loaded a warning is on first discovery.
* add status line and loading options
|
@Drodt @unp1 Here I try to avoid a ClassCastExceptions by not directly casting the instantiation to a I would get rid of the else case (sysout). The only useful meaning would be to check each entry of an ImmutableArray if this entry is a Term. |
|
A lot of WD test cases assert the "unprovability". Besides these cases, the erroneous cases are limited:
|
|
Added @flo2702 for checking the block contract world. |


Related Issue
InfFlow and WD are functionalities that tear furrows through the
key.coremodule. Meaning, that each of both functionalities are an instance-of in-place hack of the default implementations.For example, consider the
WhileInvariantRulein which WD and IF fall together. On WD, four sub-goals are generated, on IF two-subgoals are altered.Isolating these functionalities and putting them into separate modules is a great improvement (a) for comprehensibility, (b) for modularity, and (c) a blueprint for "how to extend KeY".
Changes
key.core.infflowincl. tests.key.core,but the construction of contracts is in
key.core.infflow. Loading JavaRedux w/ok.c.infflowresults into a warning on stdout, giving you a notice that the IF module is missing and IF contracts are now loaded. This circumstance should only happen (a) on test cases, or (b) on library uses ofkey.core.testRunAllInfFlowis moved tokey.core.infflowand should work.key.core.wdkey.core.wd:testRunAllWdProofswhich activates the WD proofs from years ago. I do not guarantee their success.SpecificationRepositorywhich adds WD contracts when some other contracts are added.standardRules.keyset, and allow more standard Taclet files to be defined by Profiles.standardRules.keydoes not loadwdanymore. Taclet bases are now an immutable list ofRuleSource. It would be better if the taclet base classpath is not fix yet.key.uiKeYFileChooserfor enforcing a profile (required loading Java files directly)key.coreWhileInvariantRuleandBlockInternalContract.TacletPOGeneratorallows the generation of Taclets after the specifications are read. This interface is required to mimicvoid generateWdTaclets(InitConfig proofConfig)on a generic level.ComplexJustificationableallows to markBuiltinRules.t.Java Profilegenerates for marked rules aComplexRuleJustificationentry in the rule justification map. Previously, this was a static IF query for four fixed built-in rules.Todo
Bug, confirmed, 12.01.2026 UI Proof Tree is nearly empty after usage of the
auto-infflowmacro:Exception is
This bug EXISTS also on the main branch!
Type of pull request
key.corefor deep functionality manipulationEnsuring quality
.github/workflows/tests.ymlOld Stuff
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