Skip to content

Commit 5b1bd4d

Browse files
committed
change in the listener delivers settings now
1 parent 4c9b423 commit 5b1bd4d

12 files changed

Lines changed: 133 additions & 110 deletions

File tree

key.core/src/main/java/de/uka/ilkd/key/control/AbstractUserInterfaceControl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ public void loadingStarted(AbstractProblemLoader loader) {
257257

258258
@Override
259259
public void loadingFinished(AbstractProblemLoader loader, LoadedPOContainer poContainer,
260-
ProofAggregate proofList, ReplayResult result) throws ProblemLoaderException {
260+
ProofAggregate proofList, ReplayResult result, Configuration settings)
261+
throws ProblemLoaderException {
261262
if (proofList != null) {
262263
// avoid double registration at spec repos as that is done already earlier in
263264
// createProof

key.core/src/main/java/de/uka/ilkd/key/control/KeYEnvironment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import de.uka.ilkd.key.java.JavaInfo;
1414
import de.uka.ilkd.key.java.Services;
15+
import de.uka.ilkd.key.nparser.KeyAst;
1516
import de.uka.ilkd.key.java.abstraction.KeYJavaType;
1617
import de.uka.ilkd.key.logic.op.IObserverFunction;
1718
import de.uka.ilkd.key.nparser.KeyAst.ProofScript;

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

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: GPL-2.0-only */
44
package de.uka.ilkd.key.proof;
55

6+
import java.util.*;
7+
68
import de.uka.ilkd.key.logic.RenamingTable;
79
import de.uka.ilkd.key.logic.op.IProgramVariable;
810
import de.uka.ilkd.key.proof.calculus.JavaDLSequentKit;
@@ -15,16 +17,16 @@
1517
import org.key_project.prover.sequent.Sequent;
1618
import org.key_project.prover.sequent.SequentChangeInfo;
1719
import de.uka.ilkd.key.util.Pair;
18-
import org.jspecify.annotations.NonNull;
19-
import org.jspecify.annotations.Nullable;
20+
2021
import org.key_project.util.collection.DefaultImmutableSet;
2122
import org.key_project.util.collection.ImmutableList;
2223
import org.key_project.util.collection.ImmutableSLList;
2324
import org.key_project.util.collection.ImmutableSet;
2425
import org.key_project.util.collection.Pair;
2526
import org.key_project.util.lookup.Lookup;
2627

27-
import java.util.*;
28+
import org.jspecify.annotations.NonNull;
29+
import org.jspecify.annotations.Nullable;
2830

2931
public class Node implements Iterable<Node> {
3032
private static final String RULE_WITHOUT_NAME = "rule without name";
@@ -116,7 +118,7 @@ public class Node implements Iterable<Node> {
116118
* taclet with an addrule section on this node, then these taclets are stored in this list
117119
*/
118120
private ImmutableSet<NoPosTacletApp> localIntroducedRules =
119-
DefaultImmutableSet.nil();
121+
DefaultImmutableSet.nil();
120122

121123
/**
122124
* Holds the undo methods for the information added by rules to the {@code Goal.strategyInfos}.
@@ -448,7 +450,7 @@ List<Node> getLeaves() {
448450

449451
/**
450452
* @return an iterator for the leaves of the subtree below this node. The computation is called
451-
* at every call!
453+
* at every call!
452454
*/
453455
public Iterator<Node> leavesIterator() {
454456
return new NodeIterator(getLeaves().iterator());
@@ -493,7 +495,7 @@ public Node child(int i) {
493495
/**
494496
* @param child a child of this node.
495497
* @return the number of the node <code>child</code>, if it is a child of this node (starting
496-
* with <code>0</code>), <code>-1</code> otherwise
498+
* with <code>0</code>), <code>-1</code> otherwise
497499
*/
498500
public int getChildNr(Node child) {
499501
int res = 0;
@@ -533,16 +535,16 @@ public StringBuffer getUniqueTacletId() {
533535
* Helper for {@link #toString()}
534536
*
535537
* @param prefix needed to keep track if a line has to be printed
536-
* @param tree the tree representation we want to add this subtree " @param preEnumeration the
537-
* enumeration of the parent without the last number
538+
* @param tree the tree representation we want to add this subtree " @param preEnumeration the
539+
* enumeration of the parent without the last number
538540
* @param postNr the last number of the parents enumeration
539-
* @param maxNr the number of nodes at this level
540-
* @param ownNr the place of this node at this level
541+
* @param maxNr the number of nodes at this level
542+
* @param ownNr the place of this node at this level
541543
* @return the string representation of this node.
542544
*/
543545

544546
private StringBuffer toString(String prefix, StringBuffer tree, String preEnumeration,
545-
int postNr, int maxNr, int ownNr) {
547+
int postNr, int maxNr, int ownNr) {
546548
Iterator<Node> childrenIt = childrenIterator();
547549
// Some constants
548550
String frontIndent = (maxNr > 1 ? " " : "");
@@ -593,7 +595,7 @@ private StringBuffer toString(String prefix, StringBuffer tree, String preEnumer
593595
while (childrenIt.hasNext()) {
594596
childId++;
595597
childrenIt.next().toString(prefix, tree, newEnumeration, newPostNr, children.size(),
596-
childId);
598+
childId);
597599
}
598600

599601
return tree;
@@ -650,7 +652,7 @@ public String name() {
650652
* this node.
651653
*
652654
* @return true iff the parent of this node has this node as child and this condition holds also
653-
* for the own children.
655+
* for the own children.
654656
*/
655657
public boolean sanityCheckDoubleLinks() {
656658
if (!root()) {
@@ -777,7 +779,7 @@ public void addStrategyInfoUndoMethod(StrategyInfoUndoMethod undoMethod) {
777779
/**
778780
* Register a user-defined data in this node info.
779781
*
780-
* @param obj an object to be registered
782+
* @param obj an object to be registered
781783
* @param service the key under it should be registered
782784
* @param <T> the type of the object to be registered
783785
*/
@@ -788,9 +790,9 @@ public <T> void register(T obj, Class<T> service) {
788790
/**
789791
* Remove a previous registered user-defined data.
790792
*
791-
* @param obj registered object
793+
* @param obj registered object
792794
* @param service the key under which the data was registered
793-
* @param <T> arbitray object
795+
* @param <T> arbitray object
794796
*/
795797
public <T> void deregister(T obj, Class<T> service) {
796798
if (userData != null) {
@@ -849,7 +851,8 @@ void setStepIndex(int stepIndex) {
849851
}
850852

851853
/**
852-
* Calculates an array is the path from root node to this node. Each entry defines the child to be selected.
854+
* Calculates an array is the path from root node to this node. Each entry defines the child to
855+
* be selected.
853856
*
854857
* @see #traversePath(Iterator)
855858
*/

key.core/src/main/java/de/uka/ilkd/key/proof/init/KeYUserProblemFile.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import de.uka.ilkd.key.java.abstraction.KeYJavaType;
1111
import de.uka.ilkd.key.nparser.*;
12-
import de.uka.ilkd.key.nparser.builder.ProblemFinder;
1312
import de.uka.ilkd.key.proof.Proof;
1413
import de.uka.ilkd.key.proof.ProofAggregate;
1514
import de.uka.ilkd.key.proof.io.IProofFileParser;
@@ -124,8 +123,8 @@ public ImmutableSet<PositionedString> read() throws ProofInputException {
124123
return warnings;
125124
}
126125

127-
public Configuration readSettings() {
128-
if(settings==null){
126+
public Configuration readSettings() {
127+
if (settings == null) {
129128
settings = getParseContext().findSettings();
130129
}
131130
return settings;
@@ -282,4 +281,5 @@ private Profile getDefaultProfile() {
282281
public KeYJavaType getContainerType() {
283282
return null;
284283
}
284+
285285
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ public final void load(Consumer<Proof> callbackProofLoaded)
279279
loadSelectedProof(poContainer, proofList, callbackProofLoaded);
280280
}
281281
} finally {
282-
control.loadingFinished(this, poContainer, proofList, result);
282+
var settings = (envInput instanceof KeYUserProblemFile kupf) ? kupf.readSettings()
283+
: new Configuration();
284+
control.loadingFinished(this, poContainer, proofList, result, settings);
283285
}
284286
}
285287

@@ -646,9 +648,6 @@ private ReplayResult replayProof(Proof proof) {
646648
problemInitializer.tryReadProof(parser, (KeYUserProblemFile) envInput);
647649
parserResult = parser.getResult();
648650

649-
// Parser is no longer needed, set it to null to free memory.
650-
parser = null;
651-
652651
// For loading, we generally turn on one step simplification to be
653652
// able to load proofs that used it even if the user has currently
654653
// turned OSS off.

0 commit comments

Comments
 (0)