@@ -74,6 +74,10 @@ public class OutputStreamProofSaver {
7474 */
7575 protected final boolean saveProofSteps ;
7676
77+ /**
78+ * The currently selected node if available, otherwise null
79+ */
80+ protected final Node selectedNodeNr ;
7781
7882 /**
7983 * Extracts java source directory from {@link Proof#header()}, if it exists.
@@ -95,27 +99,28 @@ public static File getJavaSourceLocation(Proof proof) {
9599 return null ;
96100 }
97101
98- public OutputStreamProofSaver (Proof proof ) {
99- this (proof , KeYConstants .INTERNAL_VERSION );
102+ public OutputStreamProofSaver (Proof proof , Node selectedNode ) {
103+ this (proof , selectedNode , KeYConstants .INTERNAL_VERSION );
100104 }
101105
102- public OutputStreamProofSaver (Proof proof , String internalVersion ) {
103- this .proof = proof ;
104- this .internalVersion = internalVersion ;
105- this .saveProofSteps = true ;
106+ public OutputStreamProofSaver (Proof proof , Node selectedNode , String internalVersion ) {
107+ this (proof , selectedNode , internalVersion , true );
106108 }
107109
108110 /**
109111 * Create a new OutputStreamProofSaver.
110112 *
111113 * @param proof the proof to save
114+ * @param selectedNode the Node selected at time of saving or null if no information available
112115 * @param internalVersion currently running KeY version
113116 * @param saveProofSteps whether to save the performed proof steps
114117 */
115- public OutputStreamProofSaver (Proof proof , String internalVersion , boolean saveProofSteps ) {
118+ public OutputStreamProofSaver (Proof proof , Node selectedNode , String internalVersion ,
119+ boolean saveProofSteps ) {
116120 this .proof = proof ;
117121 this .internalVersion = internalVersion ;
118122 this .saveProofSteps = saveProofSteps ;
123+ this .selectedNodeNr = selectedNode ;
119124 }
120125
121126 /**
@@ -589,7 +594,11 @@ private void printSingleNode(Node node, String prefix, Appendable output) throws
589594
590595 printer .printSequent (node .sequent ());
591596 output .append (escapeCharacters (printer .result ().replace ('\n' , ' ' )));
592- output .append ("\" )\n " );
597+ output .append ("\" " );
598+ if (node == selectedNodeNr ) {
599+ output .append (" (" + ProofElementID .SELECTED_NODE .getRawName () + ")" );
600+ }
601+ output .append (")\n " );
593602 return ;
594603 }
595604
@@ -653,10 +662,13 @@ private void collectProof(Node node, String prefix, Appendable output) throws IO
653662 */
654663 private void userInteraction2Proof (Node node , Appendable output ) throws IOException {
655664 if (node .getNodeInfo ().getInteractiveRuleApplication ()) {
656- output .append (" (userinteraction)" );
665+ output .append (" (" + ProofElementID .USER_INTERACTION .getRawName () + ")" );
666+ }
667+ if (node == selectedNodeNr ) {
668+ output .append (" (" + ProofElementID .SELECTED_NODE .getRawName () + ")" );
657669 }
658670 if (node .getNodeInfo ().getScriptRuleApplication ()) {
659- output .append (" (proofscript )" );
671+ output .append (" (" + ProofElementID . PROOF_SCRIPT . getRawName () + " )" );
660672 }
661673 }
662674
@@ -716,7 +728,7 @@ public static String posInTerm2Proof(PosInTerm pos) {
716728 /**
717729 * Get the "interesting" instantiations of the provided object.
718730 *
719- * @see SVInstantiations#interesting
731+ * @see SVInstantiations#interesting()
720732 * @param inst instantiations
721733 * @return the "interesting" instantiations (serialized)
722734 */
0 commit comments