@@ -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 *
122125 * @param loader The problem loader, for reporting errors.
123126 * @param proof The proof object into which to load the replayed proof.
124- * @param intermediate
127+ * @param parserResult 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 ();
@@ -255,8 +259,7 @@ public Result replay(ProblemInitializer.ProblemInitializerListener listener,
255259 + appInterm .getRuleName () + NOT_APPLICABLE , e );
256260 }
257261
258- } else if (currInterm
259- .getIntermediateRuleApp () instanceof BuiltInAppIntermediate ) {
262+ } else if (currInterm .getIntermediateRuleApp () instanceof BuiltInAppIntermediate ) {
260263 BuiltInAppIntermediate appInterm =
261264 (BuiltInAppIntermediate ) currInterm .getIntermediateRuleApp ();
262265
@@ -358,6 +361,18 @@ public Result replay(ProblemInitializer.ProblemInitializerListener listener,
358361 }
359362 }
360363 }
364+ // set information if this node was the last selected node at the time of saving the
365+ // proof
366+ if (currInterm .getSelectedNode ()) {
367+ // check whether the node itself was selected or a child that is an open goal
368+ int openChildSelected = currInterm .getOpenChildSelected ();
369+ if (openChildSelected < 0 || openChildSelected >= currNode .childrenCount ()) {
370+ savedSelectedNode = currNode ;
371+ } else {
372+ savedSelectedNode = currNode .child (openChildSelected );
373+ }
374+ }
375+
361376 }
362377 } catch (Throwable throwable ) {
363378 // Default exception catcher -- proof should not stop loading
@@ -374,7 +389,7 @@ public Result replay(ProblemInitializer.ProblemInitializerListener listener,
374389 progressMonitor .setProgress (max );
375390 }
376391 LOGGER .debug ("Proof replay took " + PerfScope .formatTime (System .nanoTime () - time ));
377- return new Result (status , errors , currGoal );
392+ return new Result (status , errors , currGoal , savedSelectedNode );
378393 }
379394
380395 /**
@@ -1057,27 +1072,5 @@ static class SkipSMTRuleException extends Exception {
10571072 *
10581073 * @author Dominic Scheurer
10591074 */
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- }
1075+ public record Result (String status , List <Throwable > errors , Goal lastSelectedGoal , Node savedSelectedNode ) {}
10831076}
0 commit comments