@@ -116,12 +116,15 @@ public class IntermediateProofReplayer {
116116 /** The current open goal */
117117 private Goal currGoal = null ;
118118
119+ /** the node selected at time of saving, or null if information is not available */
120+ private Node savedSelectedNode = null ;
121+
119122 /**
120123 * Constructs a new {@link IntermediateProofReplayer}.
121124 *
122- * @param loader The problem loader, for reporting errors.
123- * @param proof The proof object into which to load the replayed proof.
124- * @param parserResult the result of the proof file parser to be replayed
125+ * @param loader the problem loader, for reporting errors.
126+ * @param proof the proof object into which to load the replayed proof.
127+ * @param parserResult the result of the intermediate parser to be replayed
125128 */
126129 public IntermediateProofReplayer (AbstractProblemLoader loader , Proof proof ,
127130 IntermediatePresentationProofFileParser .Result parserResult ) {
@@ -223,6 +226,7 @@ public Result replay(ProblemInitializer.ProblemInitializerListener listener,
223226 proof .getServices ().getNameRecorder ()
224227 .setProposals (currInterm .getIntermediateRuleApp ().getNewNames ());
225228
229+
226230 if (currInterm .getIntermediateRuleApp () instanceof TacletAppIntermediate ) {
227231 TacletAppIntermediate appInterm =
228232 (TacletAppIntermediate ) currInterm .getIntermediateRuleApp ();
@@ -358,6 +362,21 @@ public Result replay(ProblemInitializer.ProblemInitializerListener listener,
358362 }
359363 }
360364 }
365+ // set information if this node was the last selected node at the time of saving
366+ // the
367+ // proof
368+ if (currInterm .getSelectedNode ()) {
369+ // check whether the node itself was selected or a child that is an open
370+ // goal
371+ int openChildSelected = currInterm .getOpenChildSelected ();
372+ if (openChildSelected < 0
373+ || openChildSelected >= currNode .childrenCount ()) {
374+ savedSelectedNode = currNode ;
375+ } else {
376+ savedSelectedNode = currNode .child (openChildSelected );
377+ }
378+ }
379+
361380 }
362381 } catch (Throwable throwable ) {
363382 // Default exception catcher -- proof should not stop loading
@@ -374,7 +393,7 @@ public Result replay(ProblemInitializer.ProblemInitializerListener listener,
374393 progressMonitor .setProgress (max );
375394 }
376395 LOGGER .debug ("Proof replay took " + PerfScope .formatTime (System .nanoTime () - time ));
377- return new Result (status , errors , currGoal );
396+ return new Result (status , errors , currGoal , savedSelectedNode );
378397 }
379398
380399 /**
@@ -1057,27 +1076,6 @@ static class SkipSMTRuleException extends Exception {
10571076 *
10581077 * @author Dominic Scheurer
10591078 */
1060- public static class Result {
1061- private final String status ;
1062- private final List <Throwable > errors ;
1063- private Goal lastSelectedGoal = null ;
1064-
1065- public Result (String status , List <Throwable > errors , Goal lastSelectedGoal ) {
1066- this .status = status ;
1067- this .errors = errors ;
1068- this .lastSelectedGoal = lastSelectedGoal ;
1069- }
1070-
1071- public String getStatus () {
1072- return status ;
1073- }
1074-
1075- public List <Throwable > getErrors () {
1076- return errors ;
1077- }
1078-
1079- public Goal getLastSelectedGoal () {
1080- return lastSelectedGoal ;
1081- }
1082- }
1079+ public record Result (String status , List <Throwable > errors , Goal lastSelectedGoal ,
1080+ Node savedSelectedNode ) {}
10831081}
0 commit comments