Skip to content

Commit 6ef3301

Browse files
committed
change in the listener delivers settings now
1 parent c3114c5 commit 6ef3301

12 files changed

Lines changed: 130 additions & 124 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/nparser/KeyAst.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,10 @@ public static class File extends KeyAst<KeYParser.FileContext> {
123123
} else {
124124
return new KeyAst.ProofScript(pctx.proofScript());
125125
}
126-
/**
127-
* Returns the raw settings within a {@link de.uka.ilkd.key.proof.io.KeYFile}.
128-
*/
129-
public Configuration findSettings() {
130-
final var cfg = new ConfigurationBuilder();
131-
if (ctx.preferences() == null || ctx.preferences().cvalue() == null) {
132-
return new Configuration();
133126
}
134-
135-
var c = ctx.preferences().cvalue();
136-
return (Configuration) c.accept(cfg);
127+
return null;
137128
}
138129

139-
140130
/// Returns the includes (possible empty but not null) computed from the underlying parse
141131
/// tree.
142132
public Includes getIncludes(URL base) {

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,29 @@
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;
911
import de.uka.ilkd.key.proof.reference.ClosedBy;
1012
import de.uka.ilkd.key.rule.NoPosTacletApp;
1113
import de.uka.ilkd.key.rule.merge.MergeRule;
14+
import de.uka.ilkd.key.util.Pair;
1215

1316
import org.key_project.logic.op.Function;
1417
import org.key_project.prover.rules.RuleApp;
1518
import org.key_project.prover.sequent.Sequent;
1619
import org.key_project.prover.sequent.SequentChangeInfo;
17-
import de.uka.ilkd.key.util.Pair;
18-
import org.jspecify.annotations.NonNull;
19-
import org.jspecify.annotations.Nullable;
2020
import org.key_project.util.collection.DefaultImmutableSet;
2121
import org.key_project.util.collection.ImmutableList;
2222
import org.key_project.util.collection.ImmutableSLList;
2323
import org.key_project.util.collection.ImmutableSet;
2424
import org.key_project.util.collection.Pair;
2525
import org.key_project.util.lookup.Lookup;
2626

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

2930
public class Node implements Iterable<Node> {
3031
private static final String RULE_WITHOUT_NAME = "rule without name";
@@ -116,7 +117,7 @@ public class Node implements Iterable<Node> {
116117
* taclet with an addrule section on this node, then these taclets are stored in this list
117118
*/
118119
private ImmutableSet<NoPosTacletApp> localIntroducedRules =
119-
DefaultImmutableSet.nil();
120+
DefaultImmutableSet.nil();
120121

121122
/**
122123
* Holds the undo methods for the information added by rules to the {@code Goal.strategyInfos}.
@@ -448,7 +449,7 @@ List<Node> getLeaves() {
448449

449450
/**
450451
* @return an iterator for the leaves of the subtree below this node. The computation is called
451-
* at every call!
452+
* at every call!
452453
*/
453454
public Iterator<Node> leavesIterator() {
454455
return new NodeIterator(getLeaves().iterator());
@@ -493,7 +494,7 @@ public Node child(int i) {
493494
/**
494495
* @param child a child of this node.
495496
* @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
497+
* with <code>0</code>), <code>-1</code> otherwise
497498
*/
498499
public int getChildNr(Node child) {
499500
int res = 0;
@@ -533,16 +534,16 @@ public StringBuffer getUniqueTacletId() {
533534
* Helper for {@link #toString()}
534535
*
535536
* @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
537+
* @param tree the tree representation we want to add this subtree " @param preEnumeration the
538+
* enumeration of the parent without the last number
538539
* @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
540+
* @param maxNr the number of nodes at this level
541+
* @param ownNr the place of this node at this level
541542
* @return the string representation of this node.
542543
*/
543544

544545
private StringBuffer toString(String prefix, StringBuffer tree, String preEnumeration,
545-
int postNr, int maxNr, int ownNr) {
546+
int postNr, int maxNr, int ownNr) {
546547
Iterator<Node> childrenIt = childrenIterator();
547548
// Some constants
548549
String frontIndent = (maxNr > 1 ? " " : "");
@@ -593,7 +594,7 @@ private StringBuffer toString(String prefix, StringBuffer tree, String preEnumer
593594
while (childrenIt.hasNext()) {
594595
childId++;
595596
childrenIt.next().toString(prefix, tree, newEnumeration, newPostNr, children.size(),
596-
childId);
597+
childId);
597598
}
598599

599600
return tree;
@@ -650,7 +651,7 @@ public String name() {
650651
* this node.
651652
*
652653
* @return true iff the parent of this node has this node as child and this condition holds also
653-
* for the own children.
654+
* for the own children.
654655
*/
655656
public boolean sanityCheckDoubleLinks() {
656657
if (!root()) {
@@ -777,7 +778,7 @@ public void addStrategyInfoUndoMethod(StrategyInfoUndoMethod undoMethod) {
777778
/**
778779
* Register a user-defined data in this node info.
779780
*
780-
* @param obj an object to be registered
781+
* @param obj an object to be registered
781782
* @param service the key under it should be registered
782783
* @param <T> the type of the object to be registered
783784
*/
@@ -788,9 +789,9 @@ public <T> void register(T obj, Class<T> service) {
788789
/**
789790
* Remove a previous registered user-defined data.
790791
*
791-
* @param obj registered object
792+
* @param obj registered object
792793
* @param service the key under which the data was registered
793-
* @param <T> arbitray object
794+
* @param <T> arbitray object
794795
*/
795796
public <T> void deregister(T obj, Class<T> service) {
796797
if (userData != null) {
@@ -849,7 +850,8 @@ void setStepIndex(int stepIndex) {
849850
}
850851

851852
/**
852-
* Calculates an array is the path from root node to this node. Each entry defines the child to be selected.
853+
* Calculates an array is the path from root node to this node. Each entry defines the child to
854+
* be selected.
853855
*
854856
* @see #traversePath(Iterator)
855857
*/

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)