33 * SPDX-License-Identifier: GPL-2.0-only */
44package de .uka .ilkd .key .control ;
55
6+ import java .io .File ;
7+ import java .util .*;
8+ import java .util .function .Consumer ;
9+
610import de .uka .ilkd .key .java .JavaInfo ;
711import de .uka .ilkd .key .java .Services ;
812import de .uka .ilkd .key .java .abstraction .KeYJavaType ;
2125import de .uka .ilkd .key .speclang .Contract ;
2226import de .uka .ilkd .key .util .KeYTypeUtil ;
2327import de .uka .ilkd .key .util .Pair ;
24- import org .key_project .util .collection .ImmutableSet ;
2528
26- import java .io .File ;
27- import java .util .*;
28- import java .util .function .Consumer ;
29+ import org .key_project .util .collection .ImmutableSet ;
2930
3031/**
3132 * Instances of this class are used to collect and access all relevant information for verification
@@ -67,7 +68,7 @@ public class KeYEnvironment<U extends UserInterfaceControl> {
6768 /**
6869 * Constructor
6970 *
70- * @param ui The {@link UserInterfaceControl} in which the {@link Proof} is loaded.
71+ * @param ui The {@link UserInterfaceControl} in which the {@link Proof} is loaded.
7172 * @param initConfig The loaded project.
7273 */
7374 public KeYEnvironment (U ui , InitConfig initConfig ) {
@@ -77,11 +78,11 @@ public KeYEnvironment(U ui, InitConfig initConfig) {
7778 /**
7879 * Constructor
7980 *
80- * @param ui The {@link UserInterfaceControl} in which the {@link Proof} is loaded.
81+ * @param ui The {@link UserInterfaceControl} in which the {@link Proof} is loaded.
8182 * @param initConfig The loaded project.
8283 */
8384 public KeYEnvironment (U ui , InitConfig initConfig , Proof loadedProof ,
84- Pair <String , Location > proofScript , ReplayResult replayResult ) {
85+ Pair <String , Location > proofScript , ReplayResult replayResult ) {
8586 this .ui = ui ;
8687 this .initConfig = initConfig ;
8788 this .loadedProof = loadedProof ;
@@ -180,15 +181,15 @@ public Proof createProof(ProofOblInput input) throws ProofInputException {
180181 * Loads the given location and returns all required references as {@link KeYEnvironment}. The
181182 * {@code MainWindow} is not involved in the whole process.
182183 *
183- * @param location The location to load.
184- * @param classPaths The class path entries to use.
184+ * @param location The location to load.
185+ * @param classPaths The class path entries to use.
185186 * @param bootClassPath The boot class path to use.
186- * @param includes Optional includes to consider.
187+ * @param includes Optional includes to consider.
187188 * @return The {@link KeYEnvironment} which contains all references to the loaded location.
188189 * @throws ProblemLoaderException Occurred Exception
189190 */
190191 public static KeYEnvironment <DefaultUserInterfaceControl > load (File location ,
191- List <File > classPaths , File bootClassPath , List <File > includes )
192+ List <File > classPaths , File bootClassPath , List <File > includes )
192193 throws ProblemLoaderException {
193194 return load (null , location , classPaths , bootClassPath , includes , false );
194195 }
@@ -197,103 +198,103 @@ public static KeYEnvironment<DefaultUserInterfaceControl> load(File location,
197198 * Loads the given location and returns all required references as {@link KeYEnvironment}. The
198199 * {@code MainWindow} is not involved in the whole process.
199200 *
200- * @param location The location to load.
201- * @param classPaths The class path entries to use.
202- * @param bootClassPath The boot class path to use.
203- * @param includes Optional includes to consider.
201+ * @param location The location to load.
202+ * @param classPaths The class path entries to use.
203+ * @param bootClassPath The boot class path to use.
204+ * @param includes Optional includes to consider.
204205 * @param ruleCompletionHandler An optional {@link RuleCompletionHandler}.
205206 * @return The {@link KeYEnvironment} which contains all references to the loaded location.
206207 * @throws ProblemLoaderException Occurred Exception
207208 */
208209 public static KeYEnvironment <DefaultUserInterfaceControl > load (File location ,
209- List <File > classPaths , File bootClassPath , List <File > includes ,
210- RuleCompletionHandler ruleCompletionHandler ) throws ProblemLoaderException {
210+ List <File > classPaths , File bootClassPath , List <File > includes ,
211+ RuleCompletionHandler ruleCompletionHandler ) throws ProblemLoaderException {
211212 return load (null , location , classPaths , bootClassPath , includes , null ,
212- ruleCompletionHandler , false );
213+ ruleCompletionHandler , false );
213214 }
214215
215216 /**
216217 * Loads the given location and returns all required references as {@link KeYEnvironment}. The
217218 * {@code MainWindow} is not involved in the whole process.
218219 *
219- * @param profile The {@link Profile} to use.
220- * @param location The location to load.
221- * @param classPaths The class path entries to use.
222- * @param bootClassPath The boot class path to use.
223- * @param includes Optional includes to consider.
220+ * @param profile The {@link Profile} to use.
221+ * @param location The location to load.
222+ * @param classPaths The class path entries to use.
223+ * @param bootClassPath The boot class path to use.
224+ * @param includes Optional includes to consider.
224225 * @param forceNewProfileOfNewProofs {@code} true
225226 * {@code AbstractProblemLoader.profileOfNewProofs} will be used as
226- * {@link Profile} of new proofs, {@code false} {@link Profile} specified by problem file
227- * will be used for new proofs.
227+ * {@link Profile} of new proofs, {@code false} {@link Profile} specified by problem file
228+ * will be used for new proofs.
228229 * @return The {@link KeYEnvironment} which contains all references to the loaded location.
229230 * @throws ProblemLoaderException Occurred Exception
230231 */
231232 public static KeYEnvironment <DefaultUserInterfaceControl > load (Profile profile , File location ,
232- List <File > classPaths , File bootClassPath , List <File > includes ,
233- boolean forceNewProfileOfNewProofs ) throws ProblemLoaderException {
233+ List <File > classPaths , File bootClassPath , List <File > includes ,
234+ boolean forceNewProfileOfNewProofs ) throws ProblemLoaderException {
234235 return load (profile , location , classPaths , bootClassPath , includes , null , null ,
235- forceNewProfileOfNewProofs );
236+ forceNewProfileOfNewProofs );
236237 }
237238
238239 /**
239240 * Loads the given location and returns all required references as {@link KeYEnvironment}. The
240241 * {@code MainWindow} is not involved in the whole process.
241242 *
242- * @param profile The {@link Profile} to use.
243- * @param location The location to load.
244- * @param classPaths The class path entries to use.
245- * @param bootClassPath The boot class path to use.
246- * @param includes Optional includes to consider.
247- * @param poPropertiesToForce Some optional PO {@link Properties} to force.
248- * @param ruleCompletionHandler An optional {@link RuleCompletionHandler}.
243+ * @param profile The {@link Profile} to use.
244+ * @param location The location to load.
245+ * @param classPaths The class path entries to use.
246+ * @param bootClassPath The boot class path to use.
247+ * @param includes Optional includes to consider.
248+ * @param poPropertiesToForce Some optional PO {@link Properties} to force.
249+ * @param ruleCompletionHandler An optional {@link RuleCompletionHandler}.
249250 * @param forceNewProfileOfNewProofs {@code} true
250251 * {@code AbstractProblemLoader.profileOfNewProofs} will be used as {@link Profile} of
251- * new proofs, {@code false} {@link Profile} specified by problem file will be used for
252- * new proofs.
252+ * new proofs, {@code false} {@link Profile} specified by problem file will be used for
253+ * new proofs.
253254 * @return The {@link KeYEnvironment} which contains all references to the loaded location.
254255 * @throws ProblemLoaderException Occurred Exception
255256 */
256257 public static KeYEnvironment <DefaultUserInterfaceControl > load (Profile profile , File location ,
257- List <File > classPaths , File bootClassPath , List <File > includes ,
258- Properties poPropertiesToForce , RuleCompletionHandler ruleCompletionHandler ,
259- boolean forceNewProfileOfNewProofs ) throws ProblemLoaderException {
258+ List <File > classPaths , File bootClassPath , List <File > includes ,
259+ Properties poPropertiesToForce , RuleCompletionHandler ruleCompletionHandler ,
260+ boolean forceNewProfileOfNewProofs ) throws ProblemLoaderException {
260261 return load (profile , location , classPaths , bootClassPath , includes , poPropertiesToForce ,
261- ruleCompletionHandler ,
262- null , forceNewProfileOfNewProofs );
262+ ruleCompletionHandler ,
263+ null , forceNewProfileOfNewProofs );
263264 }
264265
265266 /**
266267 * Loads the given location and returns all required references as {@link KeYEnvironment}. The
267268 * {@code MainWindow} is not involved in the whole process.
268269 *
269- * @param profile The {@link Profile} to use.
270- * @param location The location to load.
271- * @param classPaths The class path entries to use.
272- * @param bootClassPath The boot class path to use.
273- * @param includes Optional includes to consider.
274- * @param poPropertiesToForce Some optional PO {@link Properties} to force.
275- * @param ruleCompletionHandler An optional {@link RuleCompletionHandler}.
276- * @param callbackProofLoaded An optional callback (called when the proof is loaded, before
277- * replay)
270+ * @param profile The {@link Profile} to use.
271+ * @param location The location to load.
272+ * @param classPaths The class path entries to use.
273+ * @param bootClassPath The boot class path to use.
274+ * @param includes Optional includes to consider.
275+ * @param poPropertiesToForce Some optional PO {@link Properties} to force.
276+ * @param ruleCompletionHandler An optional {@link RuleCompletionHandler}.
277+ * @param callbackProofLoaded An optional callback (called when the proof is loaded, before
278+ * replay)
278279 * @param forceNewProfileOfNewProofs {@code} true
279280 * {@code AbstractProblemLoader.profileOfNewProofs} will be used as {@link Profile} of
280- * new proofs, {@code false} {@link Profile} specified by problem file will be used for
281- * new proofs.
281+ * new proofs, {@code false} {@link Profile} specified by problem file will be used for
282+ * new proofs.
282283 * @return The {@link KeYEnvironment} which contains all references to the loaded location.
283284 * @throws ProblemLoaderException Occurred Exception
284285 */
285286 public static KeYEnvironment <DefaultUserInterfaceControl > load (Profile profile , File location ,
286- List <File > classPaths , File bootClassPath , List <File > includes ,
287- Properties poPropertiesToForce , RuleCompletionHandler ruleCompletionHandler ,
288- Consumer <Proof > callbackProofLoaded ,
289- boolean forceNewProfileOfNewProofs ) throws ProblemLoaderException {
287+ List <File > classPaths , File bootClassPath , List <File > includes ,
288+ Properties poPropertiesToForce , RuleCompletionHandler ruleCompletionHandler ,
289+ Consumer <Proof > callbackProofLoaded ,
290+ boolean forceNewProfileOfNewProofs ) throws ProblemLoaderException {
290291 DefaultUserInterfaceControl ui = new DefaultUserInterfaceControl (ruleCompletionHandler );
291292 AbstractProblemLoader loader = ui .load (profile , location , classPaths , bootClassPath ,
292- includes , poPropertiesToForce , forceNewProfileOfNewProofs , callbackProofLoaded );
293+ includes , poPropertiesToForce , forceNewProfileOfNewProofs , callbackProofLoaded );
293294 InitConfig initConfig = loader .getInitConfig ();
294295
295296 return new KeYEnvironment <>(ui , initConfig , loader .getProof (),
296- loader .getProofScript (), loader .getResult ());
297+ loader .getProofScript (), loader .getResult ());
297298 }
298299
299300 public static KeYEnvironment <DefaultUserInterfaceControl > load (File keyFile )
@@ -335,9 +336,11 @@ public List<Contract> getAvailableContracts() {
335336 Set <KeYJavaType > kjts = getJavaInfo ().getAllKeYJavaTypes ();
336337 for (KeYJavaType type : kjts ) {
337338 if (!KeYTypeUtil .isLibraryClass (type )) {
338- ImmutableSet <IObserverFunction > targets = getSpecificationRepository ().getContractTargets (type );
339+ ImmutableSet <IObserverFunction > targets =
340+ getSpecificationRepository ().getContractTargets (type );
339341 for (IObserverFunction target : targets ) {
340- ImmutableSet <Contract > contracts = getSpecificationRepository ().getContracts (type , target );
342+ ImmutableSet <Contract > contracts =
343+ getSpecificationRepository ().getContracts (type , target );
341344 for (Contract contract : contracts ) {
342345 proofContracts .add (contract );
343346 }
0 commit comments