1818import de .uka .ilkd .key .pp .LogicPrinter ;
1919import de .uka .ilkd .key .pp .NotationInfo ;
2020import de .uka .ilkd .key .pp .PrettyPrinter ;
21+ import de .uka .ilkd .key .proof .JavaModel ;
2122import de .uka .ilkd .key .proof .NameRecorder ;
2223import de .uka .ilkd .key .proof .Node ;
2324import de .uka .ilkd .key .proof .Proof ;
4041import de .uka .ilkd .key .smt .SMTRuleApp ;
4142import de .uka .ilkd .key .strategy .StrategyProperties ;
4243import de .uka .ilkd .key .util .KeYConstants ;
43- import de .uka .ilkd .key .util .MiscTools ;
4444
45+ import org .jspecify .annotations .NonNull ;
4546import org .key_project .logic .Name ;
4647import org .key_project .logic .PosInTerm ;
4748import org .key_project .logic .op .Modality ;
5657import org .key_project .prover .sequent .Sequent ;
5758import org .key_project .prover .sequent .SequentFormula ;
5859import org .key_project .util .collection .ImmutableList ;
59- import org .key_project .util .java . IOUtil ;
60+ import org .key_project .util .collection . ImmutableMapEntry ;
6061
6162import org .jspecify .annotations .Nullable ;
6263import org .slf4j .Logger ;
@@ -144,7 +145,7 @@ public String writeSettings(ProofSettings ps) {
144145
145146 public void save (Path basePath , OutputStream out ) throws IOException {
146147 CopyReferenceResolver .copyCachedGoals (proof , null , null , null );
147- try (var ps = new PrintWriter (out , true , StandardCharsets .UTF_8 )) {
148+ try (PrintWriter ps = new PrintWriter (out , true , StandardCharsets .UTF_8 )) {
148149 final ProofOblInput po =
149150 proof .getServices ().getSpecificationRepository ().getProofOblInput (proof );
150151 LogicPrinter printer = createLogicPrinter (proof .getServices (), false );
@@ -167,14 +168,14 @@ public void save(Path basePath, OutputStream out) throws IOException {
167168 ps .println (writeSettings (proof .getSettings ()));
168169
169170
170- var header = proof .header ();
171+ KeyAst . Declarations header = proof .header ();
171172 String headerStr = makePathsRelative (basePath , header );
172173 ps .print (headerStr );
173174
174175 proof .printSymbols (ps );
175176
176177 // \problem or \proofObligation
177- var hasProofObligation =
178+ boolean hasProofObligation =
178179 po instanceof IPersistablePO ppo && ppo .printProofObligation (ps , proof );
179180
180181
@@ -218,10 +219,9 @@ public void save(Path basePath, OutputStream out) throws IOException {
218219 /// Better would be to get rid of the header, and using an AST.
219220 ///
220221 ///
221- /// @see KeYUserProblemFile#getProblemHeader()
222+ /// @see de.uka.ilkd.key.proof.init. KeYUserProblemFile#getProblemHeader()
222223 /// @see de.uka.ilkd.key.proof.init.InitConfig#getProblemHeader()
223- private String makePathsRelative (Path basePath , KeyAst .@ Nullable Declarations header )
224- throws IOException {
224+ private String makePathsRelative (Path basePath , KeyAst .@ Nullable Declarations header ) {
225225 if (header == null ) {
226226 return "" ;
227227 }
@@ -230,28 +230,28 @@ private String makePathsRelative(Path basePath, KeyAst.@Nullable Declarations he
230230
231231 header .printDefinitions (out );
232232
233- var jm = proof .getServices ().getJavaModel ();
233+ JavaModel jm = proof .getServices ().getJavaModel ();
234234
235- var bootClassPath = jm .getBootClassPath ();
235+ Path bootClassPath = jm .getBootClassPath ();
236236 if (bootClassPath != null ) {
237- out .printf ("\\ bootclasspath \" %s\" ;\n " , IOUtil . safePath (bootClassPath ));
237+ out .printf ("\\ bootclasspath \" %s\" ;\n " , safePathRelativeTo (bootClassPath , basePath ));
238238 }
239239
240- var classPath = jm .getClassPath ();
240+ List < Path > classPath = jm .getClassPath ();
241241 if (classPath != null && !classPath .isEmpty ()) {
242242 for (Path path : classPath ) {
243243 out .printf ("\\ classpath \" %s\" ;\n " , safePathRelativeTo (path , basePath ));
244244 }
245245 }
246246
247- var javaSource = jm .getModelDir ();
247+ Path javaSource = jm .getModelDir ();
248248 if (javaSource != null ) {
249249 out .printf ("\\ javaSource \" %s\" ;\n " , safePathRelativeTo (javaSource , basePath ));
250250 }
251251
252- var includedFiles = jm .getIncludedFiles ();
252+ List < Path > includedFiles = jm .getIncludedFiles ();
253253 if (includedFiles != null && !includedFiles .isEmpty ()) {
254- for (var includedFile : includedFiles ) {
254+ for (Path includedFile : includedFiles ) {
255255 out .printf ("\\ include \" %s\" ;\n " ,
256256 safePathRelativeTo (includedFile , basePath ));
257257 }
@@ -260,18 +260,6 @@ private String makePathsRelative(Path basePath, KeyAst.@Nullable Declarations he
260260 return sw .toString ();
261261 }
262262
263- /**
264- * Try to create a relative path, but return the absolute path if a relative path cannot be
265- * found. This may happen on Windows systems (bug #1480).
266- */
267- private static String tryToMakeFilenameRelative (String absPath , String basePath ) {
268- try {
269- return MiscTools .makeFilenameRelative (absPath , basePath );
270- } catch (final RuntimeException e ) {
271- return absPath ;
272- }
273- }
274-
275263 private String newNames2Proof (Node n ) {
276264 StringBuilder s = new StringBuilder ();
277265 final NameRecorder rec = n .getNameRecorder ();
@@ -369,9 +357,9 @@ private void printLatticeAbstractionForSingleMergeRuleApp(
369357 output .append (" (" ).append (ProofElementID .MERGE_USER_CHOICES .getRawName ())
370358 .append (" \" " );
371359 boolean first = true ;
372- for (var pair : userChoices .entrySet ()) {
373- final var key = pair .getKey ();
374- final var value = pair .getValue ();
360+ for (Map . Entry < ProgramVariable , AbstractDomainElement > pair : userChoices .entrySet ()) {
361+ final ProgramVariable key = pair .getKey ();
362+ final AbstractDomainElement value = pair .getValue ();
375363 if (first ) {
376364 first = false ;
377365 } else {
@@ -690,7 +678,7 @@ public static String posInTerm2Proof(PosInTerm pos) {
690678 public Collection <String > getInterestingInstantiations (SVInstantiations inst ) {
691679 Collection <String > s = new ArrayList <>();
692680
693- for (final var pair : inst .interesting ()) {
681+ for (final ImmutableMapEntry < @ NonNull SchemaVariable , @ NonNull InstantiationEntry <?>> pair : inst .interesting ()) {
694682 final SchemaVariable var = pair .key ();
695683
696684 final Object value = pair .value ().getInstantiation ();
0 commit comments