Skip to content

Commit 9791002

Browse files
committed
fixing TacletIndex change
* I do not understand why these proofs failed
1 parent 519f6d1 commit 9791002

11 files changed

Lines changed: 938 additions & 377 deletions

File tree

key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/macros/AbstractFinishAuxiliaryComputationMacro.java

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
* SPDX-License-Identifier: GPL-2.0-only */
44
package de.uka.ilkd.key.informationflow.macros;
55

6-
import java.util.Map;
7-
import java.util.Set;
8-
96
import de.uka.ilkd.key.informationflow.ProofObligationVars;
107
import de.uka.ilkd.key.informationflow.po.IFProofObligationVars;
118
import de.uka.ilkd.key.java.Services;
@@ -17,16 +14,15 @@
1714
import de.uka.ilkd.key.macros.AbstractProofMacro;
1815
import de.uka.ilkd.key.proof.Goal;
1916
import de.uka.ilkd.key.proof.Proof;
20-
import de.uka.ilkd.key.rule.NoPosTacletApp;
21-
import de.uka.ilkd.key.rule.Taclet;
2217
import de.uka.ilkd.key.rule.inst.SVInstantiations;
2318
import de.uka.ilkd.key.util.InfFlowProgVarRenamer;
24-
2519
import org.key_project.logic.Named;
2620
import org.key_project.logic.Namespace;
2721
import org.key_project.prover.sequent.SequentFormula;
2822
import org.key_project.util.collection.ImmutableList;
2923

24+
import java.util.Map;
25+
3026

3127
/**
3228
*
@@ -51,9 +47,9 @@ public String getDescription() {
5147

5248
static JTerm calculateResultingTerm(Proof proof, IFProofObligationVars ifVars, Goal initGoal) {
5349
final JTerm[] goalFormulas1 =
54-
buildExecution(ifVars.c1, ifVars.getMapFor(ifVars.c1), proof.openGoals(), initGoal);
50+
buildExecution(ifVars.c1, ifVars.getMapFor(ifVars.c1), proof.openGoals(), initGoal);
5551
final JTerm[] goalFormulas2 =
56-
buildExecution(ifVars.c2, ifVars.getMapFor(ifVars.c2), proof.openGoals(), initGoal);
52+
buildExecution(ifVars.c2, ifVars.getMapFor(ifVars.c2), proof.openGoals(), initGoal);
5753
final TermBuilder tb = proof.getServices().getTermBuilder();
5854
JTerm composedStates = tb.ff();
5955
for (int i = 0; i < goalFormulas1.length; i++) {
@@ -69,7 +65,7 @@ static JTerm calculateResultingTerm(Proof proof, IFProofObligationVars ifVars, G
6965
* Merge namespaces.
7066
*
7167
* @param initiatingProof the initiating proof
72-
* @param sideProof the side proof
68+
* @param sideProof the side proof
7369
*/
7470
protected final void mergeNamespaces(Proof initiatingProof, Proof sideProof) {
7571
NamespaceSet initiatingProofNS = initiatingProof.getServices().getNamespaces();
@@ -95,11 +91,11 @@ private final <E extends Named> void mergeNamespace(Namespace<E> tar, Namespace<
9591
}
9692

9793
private static JTerm[] buildExecution(ProofObligationVars c, Map<JTerm, JTerm> vsMap,
98-
ImmutableList<Goal> symbExecGoals, Goal initGoal) {
94+
ImmutableList<Goal> symbExecGoals, Goal initGoal) {
9995
Services services = initGoal.proof().getServices();
10096
final JTerm[] goalFormulas = buildFormulasFromGoals(symbExecGoals);
10197
final InfFlowProgVarRenamer renamer = new InfFlowProgVarRenamer(goalFormulas, vsMap,
102-
c.postfix, initGoal, services.getOverlay(initGoal.getLocalNamespaces()));
98+
c.postfix, initGoal, services.getOverlay(initGoal.getLocalNamespaces()));
10399
final JTerm[] renamedGoalFormulas = renamer.renameVariablesAndSkolemConstants();
104100
JTerm[] result = new JTerm[renamedGoalFormulas.length];
105101
final TermBuilder tb = services.getTermBuilder();
@@ -137,13 +133,11 @@ private static JTerm buildFormulaFromGoal(Goal symbExecGoal) {
137133
protected static void addContractApplicationTaclets(Goal initiatingGoal, Proof symbExecProof) {
138134
final ImmutableList<Goal> openGoals = symbExecProof.openGoals();
139135
for (final Goal openGoal : openGoals) {
140-
final Set<NoPosTacletApp> ruleApps = openGoal.indexOfTaclets().allNoPosTacletApps();
141-
for (final NoPosTacletApp ruleApp : ruleApps) {
142-
final Taclet t = ruleApp.taclet();
143-
if (t.getSurviveSymbExec()) {
144-
initiatingGoal.addTaclet(t, SVInstantiations.EMPTY_SVINSTANTIATIONS, true);
145-
}
146-
}
136+
openGoal.indexOfTaclets()
137+
.allNoPosTacletAppsStream()
138+
.filter(it -> it.taclet().getSurviveSymbExec())
139+
.forEach(it ->
140+
initiatingGoal.addTaclet(it.taclet(), SVInstantiations.EMPTY_SVINSTANTIATIONS, true));
147141
}
148142
}
149143
}

key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public Object clone() {
267267

268268
@Override
269269
public Set<NoPosTacletApp> allNoPosTacletApps() {
270-
return allNoPosTacletAppsStream().collect(Collectors.toUnmodifiableSet());
270+
return new HashSet<>(allNoPosTacletAppsStream().collect(Collectors.toUnmodifiableSet()));
271271
}
272272

273273
public Stream<NoPosTacletApp> allNoPosTacletAppsStream() {
@@ -506,12 +506,10 @@ public ImmutableList<NoPosTacletApp> getNoFindTaclet(RuleFilter filter,
506506
*/
507507
@Override
508508
public NoPosTacletApp lookup(Name name) {
509-
for (NoPosTacletApp tacletApp : allNoPosTacletApps()) {
510-
if (tacletApp.taclet().name().equals(name)) {
511-
return tacletApp;
512-
}
513-
}
514-
return null;
509+
return allNoPosTacletAppsStream()
510+
.filter(tacletApp -> tacletApp.taclet().name().equals(name))
511+
.findAny()
512+
.orElse(null);
515513
}
516514

517515

key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@ private TacletApp constructTacletApp(TacletAppIntermediate currInterm, Goal curr
523523
}
524524

525525
ourApp = constructInsts(ourApp, currGoal, currInterm.getInsts(), services);
526+
if(ourApp==null) {
527+
System.out.println("§sdsfs");
528+
}
526529

527530
ImmutableList<AssumesFormulaInstantiation> ifFormulaList = ImmutableSLList.nil();
528531
for (String ifFormulaStr : currInterm.getIfSeqFormulaList()) {

key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ private ImmutableList<Taclet> tacletsForRuleSet(Proof proof, String ruleSetName,
119119
ImmutableList<Taclet> result = ImmutableSLList.nil();
120120

121121
// collect apps present in all open goals
122-
Set<NoPosTacletApp> allApps = new HashSet<>(
123-
proof.openGoals().head().ruleAppIndex().tacletIndex().allNoPosTacletApps());
122+
Set<NoPosTacletApp> allApps = proof.openGoals().head().ruleAppIndex().tacletIndex().allNoPosTacletApps();
124123
for (Goal goal : proof.openGoals().tail()) {
125124
allApps.retainAll(goal.ruleAppIndex().tacletIndex().allNoPosTacletApps());
126125
}

key.core/src/main/java/de/uka/ilkd/key/scripts/meta/ValueInjector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ private void injectIntoField(ProofScriptArgument meta, ScriptCommandAst args, Ob
183183

184184
if (meta.isFlag()) {
185185
val = args.namedArgs().get(meta.getName());
186-
System.out.println("X" + val + " " + args.namedArgs() + " " + meta.getName());
187186
if (val == null) {
188187
// can also be given w/o colon or equal sign, e.g., "command hide;"
189188
var stringStream = args.positionalArgs().stream()

key.core/tacletProofs/locSet/Taclet_disjointArrayRangeAllFields1.proof

Lines changed: 95 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,105 @@
11
\profile "Java Profile";
22

33
\settings {
4-
"#Proof-Settings-Config-File
5-
#Wed Apr 12 13:28:59 CEST 2023
6-
[NewSMT]NoTypeHierarchy=false
7-
[Labels]UseOriginLabels=true
8-
[StrategyProperty]QUERYAXIOM_OPTIONS_KEY=QUERYAXIOM_ON
9-
[NewSMT]Presburger=false
10-
[SMTSettings]invariantForall=false
11-
[Strategy]ActiveStrategy=JavaCardDLStrategy
12-
[StrategyProperty]USER_TACLETS_OPTIONS_KEY1=USER_TACLETS_OFF
13-
[StrategyProperty]QUANTIFIERS_OPTIONS_KEY=QUANTIFIERS_NON_SPLITTING_WITH_PROGS
14-
[StrategyProperty]USER_TACLETS_OPTIONS_KEY2=USER_TACLETS_OFF
15-
[Choice]DefaultChoices=JavaCard-JavaCard\\:on, Strings-Strings\\:on, assertions-assertions\\:safe, bigint-bigint\\:on, finalFields-finalFields\\:immutable, floatRules-floatRules\\:strictfpOnly, initialisation-initialisation\\:disableStaticInitialisation, intRules-intRules\\:arithmeticSemanticsIgnoringOF, integerSimplificationRules-integerSimplificationRules\\:full, javaLoopTreatment-javaLoopTreatment\\:efficient, mergeGenerateIsWeakeningGoal-mergeGenerateIsWeakeningGoal\\:off, methodExpansion-methodExpansion\\:modularOnly, modelFields-modelFields\\:treatAsAxiom, moreSeqRules-moreSeqRules\\:on, permissions-permissions\\:off, programRules-programRules\\:Java, reach-reach\\:on, runtimeExceptions-runtimeExceptions\\:ban, sequences-sequences\\:on, wdChecks-wdChecks\\:off, wdOperator-wdOperator\\:L
16-
[StrategyProperty]LOOP_OPTIONS_KEY=LOOP_SCOPE_INV_TACLET
17-
[StrategyProperty]INF_FLOW_CHECK_PROPERTY=INF_FLOW_CHECK_FALSE
18-
[SMTSettings]UseBuiltUniqueness=false
19-
[SMTSettings]explicitTypeHierarchy=false
20-
[SMTSettings]instantiateHierarchyAssumptions=true
21-
[StrategyProperty]NON_LIN_ARITH_OPTIONS_KEY=NON_LIN_ARITH_DEF_OPS
22-
[SMTSettings]SelectedTaclets=
23-
[StrategyProperty]DEP_OPTIONS_KEY=DEP_ON
24-
[StrategyProperty]AUTO_INDUCTION_OPTIONS_KEY=AUTO_INDUCTION_OFF
25-
[Strategy]MaximumNumberOfAutomaticApplications=10000
26-
[StrategyProperty]STOPMODE_OPTIONS_KEY=STOPMODE_DEFAULT
27-
[StrategyProperty]CLASS_AXIOM_OPTIONS_KEY=CLASS_AXIOM_DELAYED
28-
[SMTSettings]useConstantsForBigOrSmallIntegers=true
29-
[StrategyProperty]MPS_OPTIONS_KEY=MPS_MERGE
30-
[StrategyProperty]SYMBOLIC_EXECUTION_NON_EXECUTION_BRANCH_HIDING_OPTIONS_KEY=SYMBOLIC_EXECUTION_NON_EXECUTION_BRANCH_HIDING_OFF
31-
[Strategy]Timeout=-1
32-
[StrategyProperty]SYMBOLIC_EXECUTION_ALIAS_CHECK_OPTIONS_KEY=SYMBOLIC_EXECUTION_ALIAS_CHECK_NEVER
33-
[StrategyProperty]QUERY_NEW_OPTIONS_KEY=QUERY_OFF
34-
[SMTSettings]useUninterpretedMultiplication=true
35-
[NewSMT]sqrtSMTTranslation=SMT
36-
[StrategyProperty]BLOCK_OPTIONS_KEY=BLOCK_CONTRACT_INTERNAL
37-
[StrategyProperty]METHOD_OPTIONS_KEY=METHOD_CONTRACT
38-
[StrategyProperty]USER_TACLETS_OPTIONS_KEY3=USER_TACLETS_OFF
39-
[NewSMT]identifier=OPEN
40-
[SMTSettings]maxGenericSorts=2
41-
[StrategyProperty]OSS_OPTIONS_KEY=OSS_ON
42-
[NewSMT]Axiomatisations=false
43-
[StrategyProperty]SPLITTING_OPTIONS_KEY=SPLITTING_DELAYED
44-
[SMTSettings]integersMinimum=-2147483645
45-
[StrategyProperty]VBT_PHASE=VBT_SYM_EX
46-
[SMTSettings]integersMaximum=2147483645
47-
"
48-
}
4+
"Choice" : {
5+
"JavaCard" : "JavaCard:on",
6+
"Strings" : "Strings:on",
7+
"assertions" : "assertions:safe",
8+
"bigint" : "bigint:on",
9+
"finalFields" : "finalFields:immutable",
10+
"floatRules" : "floatRules:strictfpOnly",
11+
"initialisation" : "initialisation:disableStaticInitialisation",
12+
"intRules" : "intRules:arithmeticSemanticsIgnoringOF",
13+
"integerSimplificationRules" : "integerSimplificationRules:full",
14+
"javaLoopTreatment" : "javaLoopTreatment:efficient",
15+
"mergeGenerateIsWeakeningGoal" : "mergeGenerateIsWeakeningGoal:off",
16+
"methodExpansion" : "methodExpansion:modularOnly",
17+
"modelFields" : "modelFields:treatAsAxiom",
18+
"moreSeqRules" : "moreSeqRules:on",
19+
"permissions" : "permissions:off",
20+
"programRules" : "programRules:Java",
21+
"reach" : "reach:on",
22+
"runtimeExceptions" : "runtimeExceptions:ban",
23+
"sequences" : "sequences:on",
24+
"soundDefaultContracts" : "soundDefaultContracts:on",
25+
"wdChecks" : "wdChecks:off",
26+
"wdOperator" : "wdOperator:L"
27+
},
28+
"Labels" : {
29+
"UseOriginLabels" : true
30+
},
31+
"NewSMT" : {
32+
"Axiomatisations" : "false",
33+
"NoTypeHierarchy" : "false",
34+
"Presburger" : "false",
35+
"identifier" : "OPEN",
36+
"sqrtSMTTranslation" : "SMT"
37+
},
38+
"SMTSettings" : {
39+
"SelectedTaclets" : [
40+
41+
],
42+
"UseBuiltUniqueness" : false,
43+
"explicitTypeHierarchy" : false,
44+
"instantiateHierarchyAssumptions" : true,
45+
"integersMaximum" : 2147483645,
46+
"integersMinimum" : -2147483645,
47+
"invariantForall" : false,
48+
"maxGenericSorts" : 2,
49+
"useConstantsForBigOrSmallIntegers" : true,
50+
"useUninterpretedMultiplication" : true
51+
},
52+
"Strategy" : {
53+
"ActiveStrategy" : "Modular JavaDL Strategy",
54+
"MaximumNumberOfAutomaticApplications" : 10000,
55+
"Timeout" : -1,
56+
"options" : {
57+
"AUTO_INDUCTION_OPTIONS_KEY" : "AUTO_INDUCTION_OFF",
58+
"BLOCK_OPTIONS_KEY" : "BLOCK_CONTRACT_INTERNAL",
59+
"CLASS_AXIOM_OPTIONS_KEY" : "CLASS_AXIOM_DELAYED",
60+
"DEP_OPTIONS_KEY" : "DEP_ON",
61+
"LOOP_OPTIONS_KEY" : "LOOP_SCOPE_INV_TACLET",
62+
"METHOD_OPTIONS_KEY" : "METHOD_CONTRACT",
63+
"MPS_OPTIONS_KEY" : "MPS_MERGE",
64+
"NON_LIN_ARITH_OPTIONS_KEY" : "NON_LIN_ARITH_DEF_OPS",
65+
"OSS_OPTIONS_KEY" : "OSS_ON",
66+
"QUANTIFIERS_OPTIONS_KEY" : "QUANTIFIERS_NON_SPLITTING_WITH_PROGS",
67+
"QUERYAXIOM_OPTIONS_KEY" : "QUERYAXIOM_ON",
68+
"QUERY_NEW_OPTIONS_KEY" : "QUERY_OFF",
69+
"SPLITTING_OPTIONS_KEY" : "SPLITTING_DELAYED",
70+
"STOPMODE_OPTIONS_KEY" : "STOPMODE_DEFAULT",
71+
"SYMBOLIC_EXECUTION_ALIAS_CHECK_OPTIONS_KEY" : "SYMBOLIC_EXECUTION_ALIAS_CHECK_NEVER",
72+
"SYMBOLIC_EXECUTION_NON_EXECUTION_BRANCH_HIDING_OPTIONS_KEY" : "SYMBOLIC_EXECUTION_NON_EXECUTION_BRANCH_HIDING_OFF",
73+
"USER_TACLETS_OPTIONS_KEY1" : "USER_TACLETS_OFF",
74+
"USER_TACLETS_OPTIONS_KEY2" : "USER_TACLETS_OFF",
75+
"USER_TACLETS_OPTIONS_KEY3" : "USER_TACLETS_OFF",
76+
"VBT_PHASE" : "VBT_SYM_EX"
77+
}
78+
}
79+
}
80+
4981

50-
\proofObligation {
51-
"name": "disjointArrayRangeAllFields1",
52-
"class": "de.uka.ilkd.key.taclettranslation.lemma.TacletProofObligationInput",
53-
}
82+
83+
\proofObligation
84+
//
85+
{
86+
"class" : "de.uka.ilkd.key.taclettranslation.lemma.TacletProofObligationInput",
87+
"name" : "disjointArrayRangeAllFields1"
88+
}
5489

5590
\proof {
5691
(keyLog "0" (keyUser "Julian" ) (keyVersion "80a871ca3bac8bb405ecc216fcb6fa9ef6f8a395"))
92+
(keyLog "1" (keyUser "weigl" ) (keyVersion "1df32008ebda9fe2684e1a5eb5e44bdd4c398d8f"))
93+
(keyLog "2" (keyUser "weigl" ) (keyVersion "1df32008ebda9fe2684e1a5eb5e44bdd4c398d8f"))
5794

58-
(autoModeTime "0")
95+
(autoModeTime "15")
5996

6097
(branch "dummy ID"
6198
(rule "equiv_right" (formula "1") (newnames "f_o1,f_o2,f_lower2,f_upper2") (userinteraction))
6299
(branch "Case '->'"
63100
(rule "notRight" (formula "2"))
64101
(rule "andLeft" (formula "1"))
65-
(rule "equalityToElementOf" (formula "3") (inst "ov=ov") (inst "fv=fv") (userinteraction))
102+
(rule "equalityToElementOf" (formula "3") (inst "fv=fv") (inst "ov=ov") (userinteraction))
66103
(builtin "One Step Simplification" (formula "3"))
67104
(rule "eqSymm" (formula "1"))
68105
(rule "inEqSimp_commuteLeq" (formula "2"))
@@ -108,6 +145,8 @@
108145
(rule "commute_or_2" (formula "3") (term "0,0,0,0"))
109146
(rule "commute_or_2" (formula "3") (term "0,0,0"))
110147
(builtin "One Step Simplification" (formula "3"))
148+
(rule "castDel" (formula "3") (term "0,0,0,0,0"))
149+
(builtin "One Step Simplification" (formula "3"))
111150
(rule "polySimp_addComm1" (formula "3") (term "1"))
112151
(rule "add_literals" (formula "3") (term "0,1"))
113152
(rule "add_zero_left" (formula "3") (term "1"))
@@ -131,16 +170,16 @@
131170
(rule "polySimp_pullOutFactor1b" (formula "3") (term "0"))
132171
(rule "add_literals" (formula "3") (term "1,1,0"))
133172
(rule "times_zero_1" (formula "3") (term "1,0"))
134-
(rule "add_zero_right" (formula "3") (term "0"))
173+
(rule "add_literals" (formula "3") (term "0"))
135174
(rule "leq_literals" (formula "3"))
136175
(rule "closeFalse" (formula "3"))
137176
)
138177
(branch "Case '<-'"
139-
(rule "equalityToElementOfRight" (formula "2") (inst "ov=ov") (inst "fv=fv") (userinteraction))
178+
(rule "equalityToElementOfRight" (formula "2") (inst "fv=fv") (inst "ov=ov") (userinteraction))
140179
(builtin "One Step Simplification" (formula "2"))
141180
(rule "notLeft" (formula "1"))
142-
(rule "allRight" (formula "2") (inst "sk=ov_0"))
143-
(rule "allRight" (formula "2") (inst "sk=fv_0"))
181+
(rule "allRight" (formula "2") (inst "sk=ov_0:java.lang.Object"))
182+
(rule "allRight" (formula "2") (inst "sk=fv_0:Field"))
144183
(rule "notRight" (formula "2"))
145184
(rule "eqSymm" (formula "2") (term "0"))
146185
(rule "inEqSimp_commuteLeq" (formula "2") (term "1"))
@@ -150,7 +189,7 @@
150189
(rule "applyEq" (formula "2") (term "0") (ifseqformula "1"))
151190
(rule "elementOfArrayRange" (formula "2") (inst "iv=iv"))
152191
(rule "andLeft" (formula "2"))
153-
(rule "exLeft" (formula "3") (inst "sk=iv_0"))
192+
(rule "exLeft" (formula "3") (inst "sk=iv_0:int"))
154193
(rule "andLeft" (formula "3"))
155194
(rule "andLeft" (formula "3"))
156195
(rule "eqSymm" (formula "2"))

0 commit comments

Comments
 (0)