diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/ProofObligationVars.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/ProofObligationVars.java index abc2cc23e97..58e1766f0c7 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/ProofObligationVars.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/ProofObligationVars.java @@ -18,7 +18,6 @@ import org.key_project.logic.op.Function; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; @@ -135,7 +134,7 @@ private JTerm buildExceptionParameter(Services services) { */ private ImmutableList buildFormalParamVars(Services services) throws IllegalArgumentException { - ImmutableList formalParamVars = ImmutableSLList.nil(); + ImmutableList formalParamVars = ImmutableList.nil(); for (JTerm param : pre.localVars) { ProgramVariable paramVar = param.op(ProgramVariable.class); ProgramElementName pen = new ProgramElementName("_" + paramVar.name()); diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/macros/ExhaustiveProofMacro.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/macros/ExhaustiveProofMacro.java index 0b027371bab..201971800bf 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/macros/ExhaustiveProofMacro.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/macros/ExhaustiveProofMacro.java @@ -23,7 +23,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * The abstract class ExhaustiveProofMacro can be used to create compound macros which either apply @@ -40,7 +39,7 @@ private PosInOccurrence getApplicablePosInOcc(Proof proof, ProofMacro macro) { if (posInOcc == null || posInOcc.subTerm() == null) { return null; - } else if (macro.canApplyTo(proof, ImmutableSLList.nil().prepend(goal), posInOcc)) { + } else if (macro.canApplyTo(proof, ImmutableList.nil().prepend(goal), posInOcc)) { return posInOcc; } else { final var subTerm = posInOcc.subTerm(); @@ -124,7 +123,7 @@ public ProofMacroFinishedInfo applyTo(UserInterfaceControl uic, Proof proof, if (!isCached) { // node has not been checked before, so do it boolean canBeApplied = - canApplyTo(proof, ImmutableSLList.nil().prepend(goal), posInOcc); + canApplyTo(proof, ImmutableList.nil().prepend(goal), posInOcc); if (!canBeApplied) { // canApplyTo checks all open goals. thus, if it returns // false, then this macro is not applicable at all and @@ -143,7 +142,7 @@ public ProofMacroFinishedInfo applyTo(UserInterfaceControl uic, Proof proof, pml.taskStarted(new DefaultTaskStartedInfo(TaskKind.Macro, getName(), 0)); synchronized (macro) { // wait for macro to terminate - info = macro.applyTo(uic, proof, ImmutableSLList.nil().prepend(goal), + info = macro.applyTo(uic, proof, ImmutableList.nil().prepend(goal), applicableAt, pml); } pml.taskFinished(info); diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicBlockExecutionSnippet.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicBlockExecutionSnippet.java index 02fac4f8e0f..1aba173add3 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicBlockExecutionSnippet.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicBlockExecutionSnippet.java @@ -21,7 +21,6 @@ import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -33,7 +32,7 @@ class BasicBlockExecutionSnippet extends ReplaceAndRegisterMethod implements Fac @Override public JTerm produce(BasicSnippetData d, ProofObligationVars poVars) throws UnsupportedOperationException { - ImmutableList posts = ImmutableSLList.nil(); + ImmutableList posts = ImmutableList.nil(); if (poVars.post.self != null) { posts = posts.append(d.tb.equals(poVars.post.self, poVars.pre.self)); } diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicLoopExecutionSnippet.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicLoopExecutionSnippet.java index b097139fcee..f4ee417e2f1 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicLoopExecutionSnippet.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicLoopExecutionSnippet.java @@ -20,7 +20,6 @@ import de.uka.ilkd.key.speclang.LoopSpecification; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; public class BasicLoopExecutionSnippet extends ReplaceAndRegisterMethod implements FactoryMethod { @@ -28,7 +27,7 @@ public class BasicLoopExecutionSnippet extends ReplaceAndRegisterMethod implemen @Override public JTerm produce(BasicSnippetData d, ProofObligationVars poVars) throws UnsupportedOperationException { - ImmutableList posts = ImmutableSLList.nil(); + ImmutableList posts = ImmutableList.nil(); if (poVars.post.self != null) { posts = posts.append(d.tb.equals(poVars.post.self, poVars.pre.self)); } diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicSnippetData.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicSnippetData.java index 1d9e7ca014c..a1d9e1cada5 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicSnippetData.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicSnippetData.java @@ -24,7 +24,6 @@ import de.uka.ilkd.key.util.MiscTools; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; @@ -150,7 +149,7 @@ public Class getType() { // add guard term to information flow specs (necessary for soundness) // and add the modified specs to the table ImmutableList infFlowSpecs = invariant.getInfFlowSpecs(services); - ImmutableList modifiedSpecs = ImmutableSLList.nil(); + ImmutableList modifiedSpecs = ImmutableList.nil(); for (InfFlowSpec infFlowSpec : infFlowSpecs) { ImmutableList modifiedPreExps = infFlowSpec.preExpressions.append(guardTerm); ImmutableList modifiedPostExps = infFlowSpec.postExpressions.append(guardTerm); @@ -234,7 +233,7 @@ public Class getType() { private ImmutableList toTermList(ImmutableSet vars) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (ProgramVariable v : vars) { result = result.append(tb.var(v)); } diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicSymbolicExecutionSnippet.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicSymbolicExecutionSnippet.java index 927b891d39f..8b65179cbc9 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicSymbolicExecutionSnippet.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/BasicSymbolicExecutionSnippet.java @@ -33,7 +33,6 @@ import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * @@ -47,7 +46,7 @@ public JTerm produce(BasicSnippetData d, ProofObligationVars poVars) assert poVars.exceptionParameter.op() instanceof LocationVariable : "Something is wrong with the catch variable"; - ImmutableList posts = ImmutableSLList.nil(); + ImmutableList posts = ImmutableList.nil(); if (poVars.post.self != null) { posts = posts.append(d.tb.equals(poVars.post.self, poVars.pre.self)); } diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/InfFlowContractAppInOutRelationSnippet.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/InfFlowContractAppInOutRelationSnippet.java index f6ec014d1d0..199ad8c8617 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/InfFlowContractAppInOutRelationSnippet.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/InfFlowContractAppInOutRelationSnippet.java @@ -11,7 +11,6 @@ import de.uka.ilkd.key.util.InfFlowSpec; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * @@ -27,7 +26,7 @@ protected JTerm buildObjectSensitivePostRelation(InfFlowSpec infFlowSpec1, InfFlowSpec infFlowSpec2, BasicSnippetData d, ProofObligationVars vs1, ProofObligationVars vs2, JTerm eqAtLocsTerm) { // build equalities for newObjects terms - ImmutableList newObjEqs = ImmutableSLList.nil(); + ImmutableList newObjEqs = ImmutableList.nil(); Iterator newObjects1It = infFlowSpec1.newObjects.iterator(); Iterator newObjects2It = infFlowSpec2.newObjects.iterator(); for (int i = 0; i < infFlowSpec1.newObjects.size(); i++) { diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/InfFlowInputOutputRelationSnippet.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/InfFlowInputOutputRelationSnippet.java index a8d66d57e07..b111e205e50 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/InfFlowInputOutputRelationSnippet.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/InfFlowInputOutputRelationSnippet.java @@ -15,7 +15,6 @@ import org.key_project.logic.Term; import org.key_project.logic.op.Function; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Generate term "self != null". @@ -97,7 +96,7 @@ private JTerm buildInputRelation(BasicSnippetData d, ProofObligationVars vs1, private JTerm buildOutputRelation(BasicSnippetData d, ProofObligationVars vs1, ProofObligationVars vs2, InfFlowSpec infFlowSpec1, InfFlowSpec infFlowSpec2) { // build equalities for post expressions - ImmutableList eqAtLocs = ImmutableSLList.nil(); + ImmutableList eqAtLocs = ImmutableList.nil(); Iterator postExp1It = infFlowSpec1.postExpressions.iterator(); Iterator postExp2It = infFlowSpec2.postExpressions.iterator(); @@ -123,7 +122,7 @@ protected JTerm buildObjectSensitivePostRelation(InfFlowSpec infFlowSpec1, InfFlowSpec infFlowSpec2, BasicSnippetData d, ProofObligationVars vs1, ProofObligationVars vs2, JTerm eqAtLocsTerm) { // build equalities for newObjects terms - ImmutableList newObjEqs = ImmutableSLList.nil(); + ImmutableList newObjEqs = ImmutableList.nil(); Iterator newObjects1It = infFlowSpec1.newObjects.iterator(); Iterator newObjects2It = infFlowSpec2.newObjects.iterator(); for (int i = 0; i < infFlowSpec1.newObjects.size(); i++) { diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/ReplaceAndRegisterMethod.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/ReplaceAndRegisterMethod.java index ce4e0bd5948..c2b04094d5b 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/ReplaceAndRegisterMethod.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/ReplaceAndRegisterMethod.java @@ -22,7 +22,6 @@ import org.key_project.logic.op.Function; import org.key_project.logic.op.QuantifiableVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -78,15 +77,15 @@ final JTerm[] replace(JTerm[] terms, StateVars origVars, StateVars poVars, TermB final InfFlowSpec replace(InfFlowSpec terms, StateVars origVars, StateVars poVars, TermBuilder tb) { - ImmutableList resultPreExps = ImmutableSLList.nil(); + ImmutableList resultPreExps = ImmutableList.nil(); for (JTerm t : terms.preExpressions) { resultPreExps = resultPreExps.append(replace(t, origVars, poVars, tb)); } - ImmutableList resultPostExps = ImmutableSLList.nil(); + ImmutableList resultPostExps = ImmutableList.nil(); for (JTerm t : terms.postExpressions) { resultPostExps = resultPostExps.append(replace(t, origVars, poVars, tb)); } - ImmutableList resultNewObjecs = ImmutableSLList.nil(); + ImmutableList resultNewObjecs = ImmutableList.nil(); for (JTerm t : terms.newObjects) { resultNewObjecs = resultNewObjecs.append(replace(t, origVars, poVars, tb)); } diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/TwoStateMethodPredicateSnippet.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/TwoStateMethodPredicateSnippet.java index c3c08038170..f84ddcd7cf1 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/TwoStateMethodPredicateSnippet.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/po/snippet/TwoStateMethodPredicateSnippet.java @@ -21,7 +21,6 @@ import org.key_project.logic.op.Function; import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -118,8 +117,8 @@ abstract String generatePredicateName(IProgramMethod pm, StatementBlock block, */ private ImmutableList extractTermListForPredicate(IProgramMethod pm, ProofObligationVars poVars, boolean hasMby) { - ImmutableList relevantPreVars = ImmutableSLList.nil(); - ImmutableList relevantPostVars = ImmutableSLList.nil(); + ImmutableList relevantPreVars = ImmutableList.nil(); + ImmutableList relevantPostVars = ImmutableList.nil(); if (!pm.isStatic()) { // self is relevant in the pre and post state for constructors diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/proof/init/StateVars.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/proof/init/StateVars.java index 2312879ffae..c3a3f454046 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/proof/init/StateVars.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/proof/init/StateVars.java @@ -22,7 +22,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; @@ -65,7 +64,7 @@ public StateVars(JTerm self, JTerm guard, ImmutableList localVars, JTerm this.heap = heap; this.mbyAtPre = mbyAtPre; - ImmutableList terms = ImmutableSLList.nil(); + ImmutableList terms = ImmutableList.nil(); terms = appendIfNotNull(terms, heap); terms = appendIfNotNull(terms, self); terms = appendIfNotNull(terms, guard); @@ -75,7 +74,7 @@ public StateVars(JTerm self, JTerm guard, ImmutableList localVars, JTerm terms = appendIfNotNull(terms, mbyAtPre); termList = terms; - ImmutableList allTerms = ImmutableSLList.nil(); + ImmutableList allTerms = ImmutableList.nil(); allTerms = allTerms.append(heap); allTerms = allTerms.append(self); allTerms = allTerms.append(guard); @@ -148,7 +147,7 @@ public StateVars(StateVars orig, String postfix, Services services) { private static ImmutableList copyVariables(ImmutableList ts, String postfix, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JTerm t : ts) { result = result.append(copyVariable(t, postfix, services)); } @@ -284,7 +283,7 @@ public static StateVars buildInfFlowPostVars(StateVars origPreVars, StateVars or JTerm mbyAtPre = (origPreVars.mbyAtPre == origPostVars.mbyAtPre) ? preVars.mbyAtPre : copyVariable(origPostVars.mbyAtPre, postfix, services); - ImmutableList localPostVars = ImmutableSLList.nil(); + ImmutableList localPostVars = ImmutableList.nil(); Iterator origPreVarsIt = origPreVars.localVars.iterator(); Iterator localPreVarsIt = preVars.localVars.iterator(); for (JTerm origPostVar : origPostVars.localVars) { @@ -390,7 +389,7 @@ static void register(Function f, Services services) { static ImmutableList ops(ImmutableList terms, Class opClass) throws IllegalArgumentException { - ImmutableList ops = ImmutableSLList.nil(); + ImmutableList ops = ImmutableList.nil(); for (JTerm t : terms) { ops = ops.append(t.op(opClass)); } diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/InfFlowBlockContractInternalRule.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/InfFlowBlockContractInternalRule.java index dfbaf9d7d12..6abb3738f7a 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/InfFlowBlockContractInternalRule.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/InfFlowBlockContractInternalRule.java @@ -49,7 +49,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.Nullable; @@ -422,7 +421,7 @@ protected static ImmutableList buildLocalOutsAtPre(ImmutableList v return varTerms; } final TermBuilder tb = services.getTermBuilder(); - ImmutableList renamedLocalOuts = ImmutableSLList.nil(); + ImmutableList renamedLocalOuts = ImmutableList.nil(); for (JTerm varTerm : varTerms) { assert varTerm.op() instanceof LocationVariable; @@ -444,7 +443,7 @@ protected static ImmutableList buildLocalOutsAtPost(ImmutableList return varTerms; } final TermBuilder tb = services.getTermBuilder(); - ImmutableList renamedLocalOuts = ImmutableSLList.nil(); + ImmutableList renamedLocalOuts = ImmutableList.nil(); for (JTerm varTerm : varTerms) { assert varTerm.op() instanceof LocationVariable; diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/InfFlowWhileInvariantRule.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/InfFlowWhileInvariantRule.java index 63d9096654f..6eecc350626 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/InfFlowWhileInvariantRule.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/InfFlowWhileInvariantRule.java @@ -40,7 +40,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -298,7 +297,7 @@ private static ImmutableList buildLocalOutsAtPre(ImmutableList var return varTerms; } final TermBuilder tb = services.getTermBuilder(); - ImmutableList localOuts = ImmutableSLList.nil(); + ImmutableList localOuts = ImmutableList.nil(); for (final JTerm varTerm : varTerms) { assert varTerm.op() instanceof LocationVariable; @@ -320,7 +319,7 @@ private static ImmutableList buildLocalOutsAtPost(ImmutableList va return varTerms; } final TermBuilder tb = services.getTermBuilder(); - ImmutableList localOuts = ImmutableSLList.nil(); + ImmutableList localOuts = ImmutableList.nil(); for (final JTerm varTerm : varTerms) { assert varTerm.op() instanceof LocationVariable; diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/executor/InfFlowContractAppTacletExecutor.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/executor/InfFlowContractAppTacletExecutor.java index 114964bfa48..45c7015825c 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/executor/InfFlowContractAppTacletExecutor.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/executor/InfFlowContractAppTacletExecutor.java @@ -20,7 +20,6 @@ import org.key_project.prover.sequent.SequentChangeInfo; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -92,7 +91,7 @@ protected void addToAntec(Semisequent semi, SequentChangeInfo currentSequent, private void updateStrategyInfo(Goal goal, final JTerm applFormula) { ImmutableList applFormulas = goal.getStrategyInfo(INF_FLOW_CONTRACT_APPL_PROPERTY); if (applFormulas == null) { - applFormulas = ImmutableSLList.nil(); + applFormulas = ImmutableList.nil(); } applFormulas = applFormulas.append(applFormula); StrategyInfoUndoMethod undo = strategyInfos -> { diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowContractAppTacletBuilder.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowContractAppTacletBuilder.java index 0b61603b3eb..bfeb22e432b 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowContractAppTacletBuilder.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowContractAppTacletBuilder.java @@ -32,7 +32,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Builds the rule which inserts information flow contract applications. @@ -198,7 +197,7 @@ ProofObligationVars generateApplicationDataSVs(String schemaPrefix, ProofObligat JTerm selfAtPostSV = (appData.pre.self == appData.post.self ? selfAtPreSV : createTermSV(appData.post.self, schemaPrefix, services)); - ImmutableList localVarsAtPostSVs = ImmutableSLList.nil(); + ImmutableList localVarsAtPostSVs = ImmutableList.nil(); Iterator appDataPreLocalVarsIt = appData.pre.localVars.iterator(); Iterator schemaLocalVarsAtPreIt = localVarsAtPreSVs.iterator(); for (JTerm appDataPostLocalVar : appData.post.localVars) { @@ -262,10 +261,10 @@ private Taclet genInfFlowContractApplTaclet(Goal goal, ProofObligationVars appDa // create sequents Sequent assumesSeq = JavaDLSequentKit.createAnteSequent( - ImmutableSLList.singleton(new SequentFormula(schemaAssumes))); + ImmutableList.singleton(new SequentFormula(schemaAssumes))); Sequent replaceWithSeq = JavaDLSequentKit.createAnteSequent( - ImmutableSLList.singleton(new SequentFormula(replaceWithTerm))); + ImmutableList.singleton(new SequentFormula(replaceWithTerm))); // create taclet InfFlowContractAppRewriteTacletBuilder tacletBuilder = @@ -276,7 +275,7 @@ private Taclet genInfFlowContractApplTaclet(Goal goal, ProofObligationVars appDa new ApplicationRestriction(ApplicationRestriction.ANTECEDENT_POLARITY)); tacletBuilder.setIfSequent(assumesSeq); RewriteTacletGoalTemplate goalTemplate = new RewriteTacletGoalTemplate(replaceWithSeq, - ImmutableSLList.nil(), schemaFind); + ImmutableList.nil(), schemaFind); tacletBuilder.addTacletGoalTemplate(goalTemplate); tacletBuilder.addRuleSet(new RuleSet(new Name(IF_CONTRACT_APPLICATION))); tacletBuilder.setSurviveSmbExec(true); diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowTacletBuilder.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowTacletBuilder.java index 26d24215e33..5a88b55eb8e 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowTacletBuilder.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowTacletBuilder.java @@ -23,7 +23,6 @@ import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -53,7 +52,7 @@ protected AbstractInfFlowTacletBuilder(final Services services) { ImmutableList createTermSV(ImmutableList ts, String schemaPrefix, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JTerm t : ts) { result = result.append(createTermSV(t, schemaPrefix, services)); } diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowUnfoldTacletBuilder.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowUnfoldTacletBuilder.java index 2407deff6c5..9e81d457fea 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowUnfoldTacletBuilder.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowUnfoldTacletBuilder.java @@ -26,7 +26,6 @@ import org.key_project.prover.rules.ApplicationRestriction; import org.key_project.prover.rules.RuleSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; @@ -136,7 +135,7 @@ private ProofObligationVars generateApplicationDataSVs(String schemaPrefix, JTerm selfAtPostSV = (poVars.pre.self == poVars.post.self ? selfAtPreSV : createTermSV(poVars.post.self, schemaPrefix, services)); - ImmutableList localVarsAtPostSVs = ImmutableSLList.nil(); + ImmutableList localVarsAtPostSVs = ImmutableList.nil(); Iterator appDataPreLocalVarsIt = poVars.pre.localVars.iterator(); Iterator schemaLocalVarsAtPreIt = localVarsAtPreSVs.iterator(); for (JTerm appDataPostLocalVar : poVars.post.localVars) { @@ -245,7 +244,7 @@ private static StateVars filterSchemaVars(StateVars origVars, StateVars schemaVa if (origVars.localVars == null) { localVars = null; } else if (origVars.localVars.isEmpty()) { - localVars = ImmutableSLList.nil(); + localVars = ImmutableList.nil(); } if (origVars.result == null) { result = null; diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/InfFlowBlockContractTacletBuilder.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/InfFlowBlockContractTacletBuilder.java index 403ce6ee3e5..0dae3060518 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/InfFlowBlockContractTacletBuilder.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/InfFlowBlockContractTacletBuilder.java @@ -16,7 +16,6 @@ import org.key_project.logic.Name; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; @@ -80,7 +79,7 @@ JTerm buildContractApplications(ProofObligationVars contAppData, ImmutableSet ifContracts = services.getSpecificationRepository().getBlockContracts(blockContract.getBlock()); ifContracts = filterContracts(ifContracts); - ImmutableList contractsApplications = ImmutableSLList.nil(); + ImmutableList contractsApplications = ImmutableList.nil(); for (BlockContract cont : ifContracts) { InfFlowPOSnippetFactory f = POSnippetFactory.getInfFlowFactory(cont, contAppData, contAppData2, executionContext, services); diff --git a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/InfFlowMethodContractTacletBuilder.java b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/InfFlowMethodContractTacletBuilder.java index 8066f6c1d59..decd352f8a2 100644 --- a/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/InfFlowMethodContractTacletBuilder.java +++ b/key.core.infflow/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/InfFlowMethodContractTacletBuilder.java @@ -18,7 +18,6 @@ import org.key_project.logic.Name; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; @@ -76,7 +75,7 @@ JTerm buildContractApplications(ProofObligationVars contAppData, ProofObligationVars contAppData2, Services services) { ImmutableSet ifContracts = getInformFlowContracts(methodContract.getTarget(), services); - ImmutableList contractsApplications = ImmutableSLList.nil(); + ImmutableList contractsApplications = ImmutableList.nil(); for (InformationFlowContract cont : ifContracts) { InfFlowPOSnippetFactory f = POSnippetFactory.getInfFlowFactory(cont, contAppData, contAppData2, services); diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/ProofReferenceUtil.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/ProofReferenceUtil.java index fd29dcf4ad0..f6f98d9d91a 100644 --- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/ProofReferenceUtil.java +++ b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/ProofReferenceUtil.java @@ -13,7 +13,6 @@ import de.uka.ilkd.key.proof_references.reference.IProofReference; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.CollectionUtil; /** @@ -42,7 +41,7 @@ public final class ProofReferenceUtil { * The default {@link IProofReferencesAnalyst}s. */ public static final ImmutableList DEFAULT_ANALYSTS = - ImmutableSLList.nil().append( + ImmutableList.nil().append( new MethodBodyExpandProofReferencesAnalyst(), new MethodCallProofReferencesAnalyst(), new ContractProofReferencesAnalyst(), new ProgramVariableReferencesAnalyst(), new ClassAxiomAndInvariantProofReferencesAnalyst()); diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java index 570ec08ea64..f2eca312174 100644 --- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java +++ b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java @@ -31,7 +31,7 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableArray; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; /** * Extracts called methods. @@ -136,7 +136,7 @@ protected IProofReference createReference(Node node, Services se throw new IllegalArgumentException("Empty argument list expected."); } IProgramMethod pm = services.getJavaInfo().getProgramMethod(type.getKeYJavaType(), - method.toString(), ImmutableSLList.nil(), type.getKeYJavaType()); + method.toString(), ImmutableList.nil(), type.getKeYJavaType()); return new DefaultProofReference<>(IProofReference.CALL_METHOD, node, pm); } } diff --git a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/AbstractProofReferenceTestCase.java b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/AbstractProofReferenceTestCase.java index beff08ab45b..1ecfb7533d7 100644 --- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/AbstractProofReferenceTestCase.java +++ b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/AbstractProofReferenceTestCase.java @@ -31,7 +31,6 @@ import org.key_project.logic.Choice; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.helper.FindResources; import org.key_project.util.java.CollectionUtil; @@ -154,7 +153,7 @@ protected IProofTester createReferenceMethodTester(final IProofReferencesAnalyst final ExpectedProofReferences... expectedReferences) { return (environment, proof) -> { // Compute proof references - ImmutableList analysts = ImmutableSLList.nil(); + ImmutableList analysts = ImmutableList.nil(); if (analyst != null) { analysts = analysts.append(analyst); } diff --git a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/TestProofReferenceUtil.java b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/TestProofReferenceUtil.java index d39d24b4825..a18c903bd53 100644 --- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/TestProofReferenceUtil.java +++ b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/TestProofReferenceUtil.java @@ -15,7 +15,6 @@ import de.uka.ilkd.key.proof_references.reference.IProofReference; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; @@ -34,7 +33,7 @@ public void testReferenceComputation_ExpandAndContract() throws Exception { doAPITest(TESTCASE_DIRECTORY, "/proofReferences/UseOperationContractTest/UseOperationContractTest.java", "UseOperationContractTest", "main", true, - ImmutableSLList.nil().append( + ImmutableList.nil().append( new MethodBodyExpandProofReferencesAnalyst(), new ContractProofReferencesAnalyst()), new ExpectedProofReferences(IProofReference.INLINE_METHOD, "UseOperationContractTest::main"), @@ -48,7 +47,7 @@ public void testReferenceComputation_ExpandAndContract() throws Exception { @Test public void testReferenceComputation_NoAnalysts() throws Exception { doAPITest(TESTCASE_DIRECTORY, "/proofReferences/MethodBodyExpand/MethodBodyExpand.java", - "MethodBodyExpand", "main", false, ImmutableSLList.nil()); + "MethodBodyExpand", "main", false, ImmutableList.nil()); } /** @@ -57,7 +56,7 @@ public void testReferenceComputation_NoAnalysts() throws Exception { @Test public void testReferenceComputation_ContractOnly() throws Exception { doAPITest(TESTCASE_DIRECTORY, "/proofReferences/MethodBodyExpand/MethodBodyExpand.java", - "MethodBodyExpand", "main", false, ImmutableSLList.nil() + "MethodBodyExpand", "main", false, ImmutableList.nil() .append(new ContractProofReferencesAnalyst())); } @@ -68,7 +67,7 @@ public void testReferenceComputation_ContractOnly() throws Exception { public void testReferenceComputation_ExpandOnly() throws Exception { doAPITest(TESTCASE_DIRECTORY, "/proofReferences/MethodBodyExpand/MethodBodyExpand.java", "MethodBodyExpand", "main", false, - ImmutableSLList.nil() + ImmutableList.nil() .append(new MethodBodyExpandProofReferencesAnalyst()), new ExpectedProofReferences(IProofReference.INLINE_METHOD, "MethodBodyExpand::main"), new ExpectedProofReferences(IProofReference.INLINE_METHOD, diff --git a/key.core.symbolic_execution.example/src/main/java/org/key_project/example/Main.java b/key.core.symbolic_execution.example/src/main/java/org/key_project/example/Main.java index fac44445ede..6d34b614fdd 100644 --- a/key.core.symbolic_execution.example/src/main/java/org/key_project/example/Main.java +++ b/key.core.symbolic_execution.example/src/main/java/org/key_project/example/Main.java @@ -31,7 +31,7 @@ import de.uka.ilkd.key.symbolic_execution.util.SymbolicExecutionUtil; import de.uka.ilkd.key.util.MiscTools; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.key_project.util.java.StringUtil; import org.slf4j.Logger; @@ -81,7 +81,7 @@ public static void main(String[] args) { // Find method to symbolically execute KeYJavaType classType = env.getJavaInfo().getKeYJavaType("Number"); IProgramMethod pm = env.getJavaInfo().getProgramMethod(classType, "equals", - ImmutableSLList.nil().append(classType), classType); + ImmutableList.nil().append(classType), classType); // Instantiate proof for symbolic execution of the program method (Java semantics) AbstractOperationPO po = new ProgramMethodPO(env.getInitConfig(), "Symbolic Execution of: " + pm, pm, null, // An optional precondition diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/BlockContractValidityTermLabelUpdate.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/BlockContractValidityTermLabelUpdate.java index fed1258a105..88408fc4a4f 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/BlockContractValidityTermLabelUpdate.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/BlockContractValidityTermLabelUpdate.java @@ -19,7 +19,6 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.CollectionUtil; /** @@ -34,7 +33,7 @@ public class BlockContractValidityTermLabelUpdate implements TermLabelUpdate { */ @Override public ImmutableList getSupportedRuleNames() { - return ImmutableSLList.singleton(BlockContractInternalRule.INSTANCE.name()); + return ImmutableList.singleton(BlockContractInternalRule.INSTANCE.name()); } /** diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/LoopBodyTermLabelUpdate.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/LoopBodyTermLabelUpdate.java index 4e3bb78f1c1..70faae66f69 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/LoopBodyTermLabelUpdate.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/LoopBodyTermLabelUpdate.java @@ -17,7 +17,6 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Makes sure that {@link SymbolicExecutionUtil#LOOP_BODY_LABEL} is introduced when a @@ -31,7 +30,7 @@ public class LoopBodyTermLabelUpdate implements TermLabelUpdate { */ @Override public ImmutableList getSupportedRuleNames() { - return ImmutableSLList.singleton(WhileInvariantRule.INSTANCE.name()); + return ImmutableList.singleton(WhileInvariantRule.INSTANCE.name()); } /** diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/LoopInvariantNormalBehaviorTermLabelUpdate.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/LoopInvariantNormalBehaviorTermLabelUpdate.java index 151298779af..d5022ed9661 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/LoopInvariantNormalBehaviorTermLabelUpdate.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/LoopInvariantNormalBehaviorTermLabelUpdate.java @@ -17,7 +17,6 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Makes sure that {@link SymbolicExecutionUtil#LOOP_INVARIANT_NORMAL_BEHAVIOR_LABEL} is introduced @@ -31,7 +30,7 @@ public class LoopInvariantNormalBehaviorTermLabelUpdate implements TermLabelUpda */ @Override public ImmutableList getSupportedRuleNames() { - return ImmutableSLList.singleton(WhileInvariantRule.INSTANCE.name()); + return ImmutableList.singleton(WhileInvariantRule.INSTANCE.name()); } /** diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/RemoveInCheckBranchesTermLabelRefactoring.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/RemoveInCheckBranchesTermLabelRefactoring.java index 937931502ee..17064ef97bc 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/RemoveInCheckBranchesTermLabelRefactoring.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/RemoveInCheckBranchesTermLabelRefactoring.java @@ -21,7 +21,6 @@ import org.key_project.prover.rules.Rule; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * This {@link TermLabelRefactoring} removes the supported {@link TermLabel} in check branches. @@ -56,7 +55,7 @@ public RemoveInCheckBranchesTermLabelRefactoring(Name termLabelNameToRemove) { */ @Override public ImmutableList getSupportedRuleNames() { - return ImmutableSLList.singleton(UseOperationContractRule.INSTANCE.name()) + return ImmutableList.singleton(UseOperationContractRule.INSTANCE.name()) .prepend(WhileInvariantRule.INSTANCE.name()) .prepend(BlockContractInternalRule.INSTANCE.name()) .prepend(BlockContractExternalRule.INSTANCE.name()) diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/SymbolicExecutionTermLabelUpdate.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/SymbolicExecutionTermLabelUpdate.java index 2646ea307d6..381dada7ebe 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/SymbolicExecutionTermLabelUpdate.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/SymbolicExecutionTermLabelUpdate.java @@ -17,7 +17,6 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.CollectionUtil; /** @@ -32,7 +31,7 @@ public class SymbolicExecutionTermLabelUpdate implements TermLabelUpdate { */ @Override public ImmutableList getSupportedRuleNames() { - return ImmutableSLList.nil().prepend(WhileInvariantRule.INSTANCE.name()) + return ImmutableList.nil().prepend(WhileInvariantRule.INSTANCE.name()) .prepend(BlockContractInternalRule.INSTANCE.name()) .prepend(BlockContractExternalRule.INSTANCE.name()) .prepend(LoopContractInternalRule.INSTANCE.name()) diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/AbstractUpdateExtractor.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/AbstractUpdateExtractor.java index 8e31ce672ff..945fb4d7f2d 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/AbstractUpdateExtractor.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/AbstractUpdateExtractor.java @@ -33,7 +33,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.Strings; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.CollectionUtil; /** @@ -1109,7 +1108,7 @@ protected Set computeVariableValuePairs(JTerm layout ImmutableList originalUpdates = computeOriginalUpdates(modalityPio, currentLayout); // Combine memory layout with original updates Map preUpdateMap = new HashMap<>(); - ImmutableList additionalUpdates = ImmutableSLList.nil(); + ImmutableList additionalUpdates = ImmutableList.nil(); for (ExtractLocationParameter evp : locations) { additionalUpdates = additionalUpdates.append(evp.createPreUpdate()); preUpdateMap.put(evp.getPreVariable(), evp.getPreUpdateTarget()); @@ -1270,7 +1269,7 @@ protected ImmutableList computeOriginalUpdates( boolean currentLayout) { ImmutableList originalUpdates; if (!currentLayout) { - originalUpdates = ImmutableSLList.nil(); + originalUpdates = ImmutableList.nil(); } else { if (node.proof().root() == node) { originalUpdates = SymbolicExecutionUtil.computeRootElementaryUpdates(node); @@ -1460,7 +1459,7 @@ protected static class NodeGoal { * @param goal The current {@link Goal} to start backward iteration at. */ public NodeGoal(Goal goal) { - this(goal.node(), ImmutableSLList.nil().prepend(goal)); + this(goal.node(), ImmutableList.nil().prepend(goal)); } /** diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/ExecutionNodeReader.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/ExecutionNodeReader.java index 6b8eb963278..1d1f21eda66 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/ExecutionNodeReader.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/ExecutionNodeReader.java @@ -38,7 +38,6 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.key_project.util.java.CollectionUtil; @@ -1278,7 +1277,7 @@ public static abstract class AbstractKeYlessExecutionNode> completedBlocks = ImmutableSLList.nil(); + private ImmutableList> completedBlocks = ImmutableList.nil(); /** * The formated conditions under which a block is completed. @@ -1289,12 +1288,12 @@ public static abstract class AbstractKeYlessExecutionNode outgoingLinks = ImmutableSLList.nil(); + private ImmutableList outgoingLinks = ImmutableList.nil(); /** * The contained incoming links. */ - private ImmutableList incomingLinks = ImmutableSLList.nil(); + private ImmutableList incomingLinks = ImmutableList.nil(); /** * Constructor. @@ -1580,7 +1579,7 @@ public static abstract class AbstractKeYlessExecutionBlockStartNode> blockCompletions = ImmutableSLList.nil(); + private ImmutableList> blockCompletions = ImmutableList.nil(); /** * Is a block opened? @@ -1758,7 +1757,7 @@ public static class KeYlessStart extends AbstractKeYlessExecutionNode terminations = ImmutableSLList.nil(); + private ImmutableList terminations = ImmutableList.nil(); /** * Constructor. @@ -2014,7 +2013,7 @@ public static class KeYlessMethodCall extends AbstractKeYlessExecutionNode}s. */ - private ImmutableList> methodReturns = ImmutableSLList.nil(); + private ImmutableList> methodReturns = ImmutableList.nil(); /** * Constructor. diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/ExecutionVariableExtractor.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/ExecutionVariableExtractor.java index b211f6c36c3..85cf48cf125 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/ExecutionVariableExtractor.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/ExecutionVariableExtractor.java @@ -21,7 +21,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; /** @@ -444,7 +443,7 @@ public synchronized IExecutionValue[] getValues() throws ProofInputException { firstPair.getProgramVariable(), firstPair.getArrayIndex())); assert variable != null; createValues(variable, pairsList, firstPair, childrenInfo, values, - ImmutableSLList.nil()); + ImmutableList.nil()); variable.values = values.toArray(new IExecutionValue[0]); } return values; diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicExecutionTreeBuilder.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicExecutionTreeBuilder.java index 2743aed6af2..81b29632d6b 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicExecutionTreeBuilder.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicExecutionTreeBuilder.java @@ -44,7 +44,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.key_project.util.java.ArrayUtil; @@ -306,7 +305,7 @@ public void run() { } }.run(); Map> methodCallStack = getMethodCallStack(label); - methodCallStack.put(root, ImmutableSLList.nil().append(initialStack)); + methodCallStack.put(root, ImmutableList.nil().append(initialStack)); } } @@ -693,7 +692,7 @@ private class AnalyzerProofVisitor implements ProofVisitor { /** * Contains all {@link Node}s which are closed after a join. */ - private ImmutableList joinNodes = ImmutableSLList.nil(); + private ImmutableList joinNodes = ImmutableList.nil(); /** * Constructor. @@ -1083,10 +1082,10 @@ protected void updateCallStack(Node node, SourceElement statement) { ImmutableList stack = findMethodCallStack(methodCallStack, node); if (stack != null) { while (stack.size() > currentLevel) { - stack = stack.take(1); + stack = stack.tail(); } } else { - stack = ImmutableSLList.nil(); + stack = ImmutableList.nil(); } // Add new node to call stack. stack = stack.prepend(node); @@ -1229,10 +1228,10 @@ protected void addToBlockMap(Node node, AbstractExecutionBlockStartNode block } afterBlockMaps.put(node, afterBlockMap); JavaPair secondPair = new JavaPair(stackSize, - ImmutableSLList.nil().append(sourceElements)); + ImmutableList.nil().append(sourceElements)); ImmutableList> blockStartList = afterBlockMap.get(secondPair); if (blockStartList == null) { - blockStartList = ImmutableSLList.nil(); + blockStartList = ImmutableList.nil(); } blockStartList = blockStartList.append(blockStartNode); afterBlockMap.put(secondPair, blockStartList); @@ -1302,7 +1301,7 @@ private boolean checkBlockPossibility(Node node, int expectedStackSize, JavaTools.getInnermostMethodFrame(currentJavaBlock, proof.getServices()); return !isAfterBlockReached(currentStackSize, currentInnerMostMethodFrame, currentActiveStatement, expectedStackSize, - ImmutableSLList.nil().append(expectedSourceElements).iterator()); + ImmutableList.nil().append(expectedSourceElements).iterator()); } else { return true; // No single SE node reached, so allow blocks } @@ -1602,7 +1601,7 @@ protected void initNewMethodCallStack(Node currentNode, Map> newMethodCallStackMap = getMethodCallStack(label.id()); ImmutableList currentMethodCallStack = findMethodCallStack(currentMethodCallStackMap, currentNode); - ImmutableList newMethodCallStack = ImmutableSLList.nil(); + ImmutableList newMethodCallStack = ImmutableList.nil(); Set currentIgnoreSet = getMethodReturnsToIgnore(label.id()); assert newMethodCallStack.isEmpty() : "Method call stack is not empty."; Iterator currentIter = currentMethodCallStack.iterator(); @@ -1689,7 +1688,7 @@ protected IExecutionNode[] createCallStack(Node node) { Map> methodCallStack = getMethodCallStack(node.getAppliedRuleApp()); ImmutableList stack = findMethodCallStack(methodCallStack, node); - stack = stack.take(stack.size() - size); + stack = stack.skip(stack.size() - size); Iterator stackIter = stack.iterator(); for (int i = 0; i < size; i++) { Node stackEntry = stackIter.next(); @@ -1722,7 +1721,7 @@ protected Node findMethodCallNode(Node currentNode, if (returnStackSize >= 0) { Map> methodCallStack = getMethodCallStack(ruleApp); ImmutableList stack = findMethodCallStack(methodCallStack, currentNode); - return stack.take(stack.size() - returnStackSize).head(); + return stack.skip(stack.size() - returnStackSize).head(); } else { return null; } diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicLayoutExtractor.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicLayoutExtractor.java index 4776378cd53..2aa29385296 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicLayoutExtractor.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicLayoutExtractor.java @@ -31,7 +31,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.java.CollectionUtil; @@ -761,7 +760,7 @@ public ImmutableList getEquivalenceClasses(int layout */ protected ImmutableList lazyComputeEquivalenceClasses( ImmutableSet appliedCuts) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JTerm term : appliedCuts) { if (Junctor.NOT != term.op()) { assert term.op() == Equality.EQUALS; diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicLayoutReader.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicLayoutReader.java index 9188e24850e..448a152f6ab 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicLayoutReader.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/SymbolicLayoutReader.java @@ -30,7 +30,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.xml.sax.Attributes; import org.xml.sax.SAXException; @@ -451,12 +450,12 @@ public static class KeYlessLayout extends AbstractKeYlessElement implements ISym /** * The objects. */ - private ImmutableList objects = ImmutableSLList.nil(); + private ImmutableList objects = ImmutableList.nil(); /** * The symbolic equivalence classes. */ - private ImmutableList equivalenceClasses = ImmutableSLList.nil(); + private ImmutableList equivalenceClasses = ImmutableList.nil(); /** * {@inheritDoc} @@ -522,12 +521,12 @@ public static abstract class AbstractKeYlessAssociationValueContainer /** * The associations. */ - private ImmutableList associations = ImmutableSLList.nil(); + private ImmutableList associations = ImmutableList.nil(); /** * The values. */ - private ImmutableList values = ImmutableSLList.nil(); + private ImmutableList values = ImmutableList.nil(); /** * {@inheritDoc} @@ -1062,7 +1061,7 @@ public static class KeYlessEquivalenceClass extends AbstractKeYlessElement * @param representativeString The representative term. */ public KeYlessEquivalenceClass(String representativeString) { - this(ImmutableSLList.nil(), representativeString); + this(ImmutableList.nil(), representativeString); } /** diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/TruthValueTracingUtil.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/TruthValueTracingUtil.java index bcf25617392..ca3d4c3362d 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/TruthValueTracingUtil.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/TruthValueTracingUtil.java @@ -246,7 +246,7 @@ private static void evaluateNode( if (!isClosingRule(taclet)) { // Not a closing taclet checkPerformed = true; TacletGoalTemplate tacletGoal = - taclet.goalTemplates().reverse().take(childIndexOnParent).head(); + taclet.goalTemplates().reverse().get(childIndexOnParent); // Check for new minor ids created by parent rule application updatePredicateResultBasedOnNewMinorIds(child, termLabelName, services.getTermBuilder(), nodeResult); diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/AbstractExecutionBlockStartNode.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/AbstractExecutionBlockStartNode.java index 8e19457e173..1c67bf47f23 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/AbstractExecutionBlockStartNode.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/AbstractExecutionBlockStartNode.java @@ -10,7 +10,6 @@ import de.uka.ilkd.key.symbolic_execution.model.ITreeSettings; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Provides a basic implementation of {@link IExecutionBlockStartNode}. @@ -22,7 +21,7 @@ public abstract class AbstractExecutionBlockStartNode /** * The up to know discovered completing {@link IExecutionNode}s. */ - private ImmutableList> blockCompletions = ImmutableSLList.nil(); + private ImmutableList> blockCompletions = ImmutableList.nil(); /** * Defines if a block is or might be opened. diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/AbstractExecutionNode.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/AbstractExecutionNode.java index 420ffb28fc3..63fc0bf0fd8 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/AbstractExecutionNode.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/AbstractExecutionNode.java @@ -24,7 +24,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.CollectionUtil; /** @@ -78,7 +77,7 @@ public abstract class AbstractExecutionNode /** * The up to know discovered completed {@link IExecutionBlockStartNode}s. */ - private ImmutableList> completedBlocks = ImmutableSLList.nil(); + private ImmutableList> completedBlocks = ImmutableList.nil(); /** * The already computed block completion conditions. @@ -95,12 +94,12 @@ public abstract class AbstractExecutionNode /** * The up to know discovered outgoing links. */ - private ImmutableList outgoingLinks = ImmutableSLList.nil(); + private ImmutableList outgoingLinks = ImmutableList.nil(); /** * The up to know discovered incoming links. */ - private ImmutableList incomingLinks = ImmutableSLList.nil(); + private ImmutableList incomingLinks = ImmutableList.nil(); /** * Constructor. diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/ExecutionMethodCall.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/ExecutionMethodCall.java index cc4d55ba4e8..4d87cb12684 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/ExecutionMethodCall.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/ExecutionMethodCall.java @@ -16,7 +16,6 @@ import de.uka.ilkd.key.util.KeYTypeUtil; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * The default implementation of {@link IExecutionMethodCall}. @@ -28,7 +27,7 @@ public class ExecutionMethodCall extends AbstractExecutionNode> methodReturns = ImmutableSLList.nil(); + private ImmutableList> methodReturns = ImmutableList.nil(); /** * Constructor. diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/ExecutionStart.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/ExecutionStart.java index 2ed6644d8a0..66833249987 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/ExecutionStart.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/model/impl/ExecutionStart.java @@ -16,7 +16,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * The default implementation of {@link IExecutionStart}. @@ -28,7 +27,7 @@ public class ExecutionStart extends AbstractExecutionNode /** * The up to know discovered {@link IExecutionTermination}s. */ - private ImmutableList terminations = ImmutableSLList.nil(); + private ImmutableList terminations = ImmutableList.nil(); /** * Constructor. diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/AbstractSymbolicAssociationValueContainer.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/AbstractSymbolicAssociationValueContainer.java index 9c436c403e7..d400e974a46 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/AbstractSymbolicAssociationValueContainer.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/AbstractSymbolicAssociationValueContainer.java @@ -13,7 +13,6 @@ import de.uka.ilkd.key.symbolic_execution.object_model.ISymbolicValue; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.CollectionUtil; /** @@ -26,12 +25,12 @@ public abstract class AbstractSymbolicAssociationValueContainer extends Abstract /** * The contained {@link ISymbolicAssociation}s. */ - private ImmutableList associations = ImmutableSLList.nil(); + private ImmutableList associations = ImmutableList.nil(); /** * The contained {@link ISymbolicValue}s. */ - private ImmutableList values = ImmutableSLList.nil(); + private ImmutableList values = ImmutableList.nil(); /** * Constructor. diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/SymbolicEquivalenceClass.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/SymbolicEquivalenceClass.java index f038e5937e9..fa8ac71369e 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/SymbolicEquivalenceClass.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/SymbolicEquivalenceClass.java @@ -13,7 +13,6 @@ import de.uka.ilkd.key.symbolic_execution.object_model.ISymbolicObject; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.CollectionUtil; /** @@ -39,7 +38,7 @@ public class SymbolicEquivalenceClass extends AbstractElement implements ISymbol * @param settings The {@link IModelSettings} to use. */ public SymbolicEquivalenceClass(Services services, IModelSettings settings) { - this(services, ImmutableSLList.nil(), settings); + this(services, ImmutableList.nil(), settings); } /** @@ -86,7 +85,7 @@ public boolean containsTerm(JTerm term) { */ @Override public ImmutableList getTermStrings() { - ImmutableList strings = ImmutableSLList.nil(); + ImmutableList strings = ImmutableList.nil(); for (JTerm term : terms) { strings = strings.append(formatTerm(term, services)); } diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/SymbolicLayout.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/SymbolicLayout.java index fb2181fb47d..c87100deb5e 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/SymbolicLayout.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/object_model/impl/SymbolicLayout.java @@ -10,7 +10,6 @@ import de.uka.ilkd.key.symbolic_execution.object_model.ISymbolicState; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Default implementation of {@link ISymbolicLayout}. @@ -31,7 +30,7 @@ public class SymbolicLayout extends AbstractElement implements ISymbolicLayout { /** * The contained {@link ISymbolicObject}s. */ - private ImmutableList objects = ImmutableSLList.nil(); + private ImmutableList objects = ImmutableList.nil(); /** * Constructor. diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/po/ProgramMethodPO.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/po/ProgramMethodPO.java index c9ed1fa4ff5..703d565510e 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/po/ProgramMethodPO.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/po/ProgramMethodPO.java @@ -33,7 +33,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** *

@@ -150,7 +149,7 @@ protected ImmutableList buildOperationBlocks( formalParVars.toArray(new ProgramVariable[formalParVars.size()])); MethodBodyStatement mbs = new MethodBodyStatement(pm, selfVar, resultVar, args); StatementBlock result = new StatementBlock(mbs); - return ImmutableSLList.nil().prepend(null, result, null, null); + return ImmutableList.nil().prepend(null, result, null, null); } /** @@ -346,7 +345,7 @@ public static IProgramMethod getProgramMethod(InitConfig initConfig, Configurati if (type == null) { throw new IOException("Can't find type \"" + className + "\"."); } - ImmutableList parameterTypes = ImmutableSLList.nil(); + ImmutableList parameterTypes = ImmutableList.nil(); for (String s : types) { KeYJavaType paramType = javaInfo.getKeYJavaType(s.trim()); if (paramType == null) { diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/po/ProgramMethodSubsetPO.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/po/ProgramMethodSubsetPO.java index 764c1be1716..1c33dafd77c 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/po/ProgramMethodSubsetPO.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/po/ProgramMethodSubsetPO.java @@ -28,7 +28,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; // need to switch spotless off for this comment as it replaces @code with @code // spotless:off @@ -176,7 +175,7 @@ protected ImmutableList buildOperationBlocks( for (LocationVariable x : undeclaredVariables) { register(x, services); } - return ImmutableSLList.nil().prepend(null, result, null, null); + return ImmutableList.nil().prepend(null, result, null, null); } /** @@ -267,7 +266,7 @@ protected JTerm ensureUninterpretedPredicateExists(ImmutableList convert(Collection c) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (LocationVariable var : c) { result = result.append(var); } diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/profile/SimplifyTermProfile.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/profile/SimplifyTermProfile.java index 29ba6cf2c68..00f9e5f051f 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/profile/SimplifyTermProfile.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/profile/SimplifyTermProfile.java @@ -17,7 +17,6 @@ import org.key_project.logic.Name; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -61,7 +60,7 @@ public SimplifyTermProfile() { protected ImmutableList computeTermLabelConfiguration() { ImmutableList result = super.computeTermLabelConfiguration(); ImmutableList symExcPolicies = - ImmutableSLList.nil() + ImmutableList.nil() .prepend((state, services, applicationPosInOccurrence, applicationTerm, rule, goal, hint, tacletTerm, newTerm, label) -> label); diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/profile/SymbolicExecutionJavaProfile.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/profile/SymbolicExecutionJavaProfile.java index 52faa9af592..ca9d24ba7ca 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/profile/SymbolicExecutionJavaProfile.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/profile/SymbolicExecutionJavaProfile.java @@ -41,7 +41,6 @@ import org.key_project.logic.Name; import org.key_project.prover.engine.GoalChooserFactory; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -143,31 +142,31 @@ protected ImmutableList computeTermLabelConfiguration() public static ImmutableList getSymbolicExecutionTermLabelConfigurations( boolean predicateEvaluationEnabled) { ImmutableList symExcPolicies = - ImmutableSLList.nil().prepend(new StayOnOperatorTermLabelPolicy()); + ImmutableList.nil().prepend(new StayOnOperatorTermLabelPolicy()); - ImmutableList bcUps = ImmutableSLList.nil() + ImmutableList bcUps = ImmutableList.nil() .prepend(new BlockContractValidityTermLabelUpdate()); ImmutableList lbUps = - ImmutableSLList.nil().prepend(new LoopBodyTermLabelUpdate()); - ImmutableList nbUps = ImmutableSLList.nil() + ImmutableList.nil().prepend(new LoopBodyTermLabelUpdate()); + ImmutableList nbUps = ImmutableList.nil() .prepend(new LoopInvariantNormalBehaviorTermLabelUpdate()); ImmutableList seUps = - ImmutableSLList.nil().prepend(new SymbolicExecutionTermLabelUpdate()); + ImmutableList.nil().prepend(new SymbolicExecutionTermLabelUpdate()); ImmutableList bcRefs = - ImmutableSLList.nil().prepend( + ImmutableList.nil().prepend( new RemoveInCheckBranchesTermLabelRefactoring(BlockContractValidityTermLabel.NAME)); - ImmutableList lbRefs = ImmutableSLList.nil() + ImmutableList lbRefs = ImmutableList.nil() .prepend(new RemoveInCheckBranchesTermLabelRefactoring( SymbolicExecutionUtil.LOOP_BODY_LABEL_NAME)); - ImmutableList nbRefs = ImmutableSLList.nil() + ImmutableList nbRefs = ImmutableList.nil() .prepend(new RemoveInCheckBranchesTermLabelRefactoring( SymbolicExecutionUtil.LOOP_INVARIANT_NORMAL_BEHAVIOR_LABEL_NAME)); ImmutableList seRefs = - ImmutableSLList.nil().prepend( + ImmutableList.nil().prepend( new RemoveInCheckBranchesTermLabelRefactoring(SymbolicExecutionTermLabel.NAME)); - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); result = result.prepend(new TermLabelConfiguration(BlockContractValidityTermLabel.NAME, new BlockContractValidityTermLabelFactory(), null, symExcPolicies, null, null, bcUps, bcRefs, null)); @@ -185,10 +184,10 @@ public static ImmutableList getSymbolicExecutionTermLabe seRefs, null)); if (predicateEvaluationEnabled) { ImmutableList predPolicies = - ImmutableSLList.nil().prepend(new StayOnFormulaTermLabelPolicy()); + ImmutableList.nil().prepend(new StayOnFormulaTermLabelPolicy()); ImmutableList predUpdates = - ImmutableSLList.nil().prepend(new FormulaTermLabelUpdate()); - ImmutableList predRefs = ImmutableSLList + ImmutableList.nil().prepend(new FormulaTermLabelUpdate()); + ImmutableList predRefs = ImmutableList .nil().prepend(new FormulaTermLabelRefactoring()); result = result.prepend(new TermLabelConfiguration(FormulaTermLabel.NAME, new FormulaTermLabelFactory(), null, predPolicies, null, null, predUpdates, diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractBackwardSlicer.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractBackwardSlicer.java index d65a1330953..50ecca997ca 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractBackwardSlicer.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractBackwardSlicer.java @@ -25,7 +25,6 @@ import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Provides a basic implementation of backward slicing algorithms. @@ -165,7 +164,7 @@ protected Set updateOutdatedLocations(Services services, if (!newAlternatives.equals(oldAlternatives)) { // Compute old variables ImmutableList> newAlternativeVariables = - ImmutableSLList.nil(); + ImmutableList.nil(); for (Location newALternative : newAlternatives) { newAlternativeVariables = newAlternativeVariables.prepend(newALternative.getAccesses()); @@ -185,7 +184,7 @@ protected Set updateOutdatedLocations(Services services, newLocations.add(newAlternative); } else { ImmutableList oldRemainignVariables = - oldVariables.take(commonPrefixLength); + oldVariables.skip(commonPrefixLength); ImmutableList newAccesses = newAlternative.getAccesses().append(oldRemainignVariables); newLocations.add(new Location(newAccesses)); diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java index 4591ca657fa..2ed640332d2 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java @@ -39,7 +39,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.key_project.util.java.CollectionUtil; @@ -736,7 +735,7 @@ protected Location normalizeAlias(Services services, ReferencePrefix referencePr * @return The representative alias. */ protected Location normalizeAlias(Services services, Location location, SequentInfo info) { - ImmutableList normalizedAccesses = ImmutableSLList.nil(); + ImmutableList normalizedAccesses = ImmutableList.nil(); for (Access access : location.getAccesses()) { if (access.isArrayIndex()) { access = normalizeArrayIndex(access, info); @@ -890,7 +889,7 @@ protected boolean performRemoveRelevant(Services services, Location normalized, protected Location toLocation(Services services, ReferencePrefix prefix, ExecutionContext ec, ReferencePrefix thisReference) { ImmutableList accesses = - toLocationRecursive(services, prefix, ec, thisReference, ImmutableSLList.nil()); + toLocationRecursive(services, prefix, ec, thisReference, ImmutableList.nil()); return new Location(accesses); } diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/Location.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/Location.java index c7aae40bc9d..47af4e7f22e 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/Location.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/Location.java @@ -12,7 +12,6 @@ import org.key_project.logic.op.Function; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Represents a location like a local variable, method parameter, static field or an instance field @@ -43,7 +42,7 @@ public Location(ImmutableList accesses) { */ public Location(Access... accesses) { assert accesses != null; - this.accesses = ImmutableSLList.nil().append(accesses); + this.accesses = ImmutableList.nil().append(accesses); } /** diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/SymbolicExecutionGoalChooser.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/SymbolicExecutionGoalChooser.java index 51a94ffd2e5..a6106ebaf7d 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/SymbolicExecutionGoalChooser.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/SymbolicExecutionGoalChooser.java @@ -110,7 +110,7 @@ public class SymbolicExecutionGoalChooser extends DepthFirstGoalChooser { if (goalsWhereStopConditionDoNotAllowNextRule.add(next)) { // Update selected list to get a new goal in next loop iteration Goal head = selectedList.head(); - selectedList = selectedList.take(1); + selectedList = selectedList.tail(); selectedList = selectedList.append(head); } else { // Next rule not allowed, but all other goals also don't allow it, @@ -124,7 +124,7 @@ public class SymbolicExecutionGoalChooser extends DepthFirstGoalChooser { if (goal == null) { // Update selected list to get a new goal in next loop iteration Goal head = selectedList.head(); - selectedList = selectedList.take(1); + selectedList = selectedList.tail(); selectedList = selectedList.append(head); } } diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/AbstractConditionalBreakpoint.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/AbstractConditionalBreakpoint.java index 90b169143b8..40cd53d2541 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/AbstractConditionalBreakpoint.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/AbstractConditionalBreakpoint.java @@ -36,7 +36,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -298,7 +297,7 @@ private JTerm computeTermForCondition(String condition) { setSelfVar(new LocationVariable( new ProgramElementName(getProof().getServices().getTermBuilder().newName("self")), containerType, null, false, false)); - ImmutableList varsForCondition = ImmutableSLList.nil(); + ImmutableList varsForCondition = ImmutableList.nil(); if (getPm() != null) { // collect parameter variables for (ParameterDeclaration pd : getPm().getParameters()) { @@ -320,7 +319,7 @@ private JTerm computeTermForCondition(String condition) { } JavaInfo info = getProof().getServices().getJavaInfo(); List kjts = info.getAllSupertypes(containerType); - ImmutableList globalVars = ImmutableSLList.nil(); + ImmutableList globalVars = ImmutableList.nil(); for (KeYJavaType kjtloc : kjts) { if (kjtloc.getJavaType() instanceof TypeDeclaration) { ImmutableList fields = diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java index f5e94b961aa..0b6845f2234 100644 --- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java +++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java @@ -77,7 +77,6 @@ import org.key_project.prover.sequent.*; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.key_project.util.java.CollectionUtil; @@ -212,7 +211,7 @@ public static JTerm simplify(InitConfig initConfig, Proof parentProof, JTerm ter if (openGoals.isEmpty()) { return tb.tt(); } else { - ImmutableList goalImplications = ImmutableSLList.nil(); + ImmutableList goalImplications = ImmutableList.nil(); for (Goal goal : openGoals) { JTerm goalImplication = sequentToImplication(goal.sequent(), goal.proof().getServices()); @@ -255,7 +254,7 @@ public static JTerm sequentToImplication(Sequent sequent, Services services) { * @return The list with all contained {@link JTerm}s. */ public static ImmutableList listSemisequentTerms(Semisequent semisequent) { - ImmutableList terms = ImmutableSLList.nil(); + ImmutableList terms = ImmutableList.nil(); if (semisequent != null) { for (SequentFormula sf : semisequent) { terms = terms.append((JTerm) sf.formula()); @@ -1735,7 +1734,7 @@ public static ImmutableList collectGoalsInSubtree(IExecutionElement execut if (executionElement != null) { return collectGoalsInSubtree(executionElement.getProofNode()); } else { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } } @@ -2581,11 +2580,11 @@ private static JTerm computeTacletAppBranchCondition(Node parent, Node node, boo goalTemplate = null; } else { goalTemplate = app.taclet().goalTemplates() - .take(app.taclet().goalTemplates().size() - childIndex).head(); + .get(app.taclet().goalTemplates().size() - childIndex); } } else { goalTemplate = app.taclet().goalTemplates() - .take(app.taclet().goalTemplates().size() - 1 - childIndex).head(); + .get(app.taclet().goalTemplates().size() - 1 - childIndex); } // Instantiate replace object if required if (goalTemplate != null) { @@ -2631,8 +2630,8 @@ private static JTerm computeTacletAppBranchCondition(Node parent, Node node, boo + " term in branch computation but rule \"" + app + "\" was found."); } // Create new lists - ImmutableList tempAntecedents = ImmutableSLList.nil(); - ImmutableList tempSuccedents = ImmutableSLList.nil(); + ImmutableList tempAntecedents = ImmutableList.nil(); + ImmutableList tempSuccedents = ImmutableList.nil(); // Apply updates on antecedents and add result to new antecedents list for (JTerm a : newAntecedents) { tempAntecedents = tempAntecedents @@ -2706,7 +2705,7 @@ private static ImmutableList listNewSemisequentTerms(Semisequent parent, for (final SequentFormula sf : parent) { parentSFs.add(sf); } - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (final SequentFormula sf : child) { if (!parentSFs.contains(sf)) { result = result.append((JTerm) sf.formula()); @@ -2833,7 +2832,7 @@ private static JTerm evaluateInSideProof(Services services, Proof proof, // scenarios in which a precondition or null pointer // check can't be shown splittingOption, false); - ImmutableList goalCondtions = ImmutableSLList.nil(); + ImmutableList goalCondtions = ImmutableList.nil(); for (Pair pair : resultValuesAndConditions) { JTerm goalCondition = pair.first; goalCondition = replaceSkolemConstants(pair.second.sequent(), @@ -3015,7 +3014,7 @@ public static Sequent createSequentToProveWithNewSuccedent(Node node, * @return The found initial {@link ElementaryUpdate}s. */ public static ImmutableList computeRootElementaryUpdates(Node root) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); Sequent sequent = root.sequent(); for (SequentFormula sf : sequent.succedent()) { JTerm term = (JTerm) sf.formula(); @@ -3037,15 +3036,15 @@ public static ImmutableList collectElementaryUpdates(JTerm term) { JTerm updateTerm = UpdateApplication.getUpdate(term); return collectElementaryUpdates(updateTerm); } else if (term.op() == UpdateJunctor.PARALLEL_UPDATE) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (int i = 0; i < term.arity(); i++) { result = result.prepend(collectElementaryUpdates(term.sub(i))); } return result; } else if (term.op() instanceof ElementaryUpdate) { - return ImmutableSLList.nil().prepend(term); + return ImmutableList.nil().prepend(term); } else { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } } diff --git a/key.core.symbolic_execution/src/test/java/de/uka/ilkd/key/symbolic_execution/testcase/TestSymbolicLayoutWriterAndReader.java b/key.core.symbolic_execution/src/test/java/de/uka/ilkd/key/symbolic_execution/testcase/TestSymbolicLayoutWriterAndReader.java index a499a16f153..ba4015e0702 100644 --- a/key.core.symbolic_execution/src/test/java/de/uka/ilkd/key/symbolic_execution/testcase/TestSymbolicLayoutWriterAndReader.java +++ b/key.core.symbolic_execution/src/test/java/de/uka/ilkd/key/symbolic_execution/testcase/TestSymbolicLayoutWriterAndReader.java @@ -16,7 +16,7 @@ import de.uka.ilkd.key.symbolic_execution.SymbolicLayoutWriter; import de.uka.ilkd.key.symbolic_execution.object_model.ISymbolicLayout; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -73,9 +73,9 @@ public void testWritingAndReading() protected ISymbolicLayout createModel() { KeYlessLayout model = new KeYlessLayout(); model.addEquivalenceClass( - new KeYlessEquivalenceClass(ImmutableSLList.nil().append("A", "B", "C"), "A")); + new KeYlessEquivalenceClass(ImmutableList.nil().append("A", "B", "C"), "A")); model.addEquivalenceClass( - new KeYlessEquivalenceClass(ImmutableSLList.nil().append("1", "2", "3"), "63")); + new KeYlessEquivalenceClass(ImmutableList.nil().append("1", "2", "3"), "63")); // state KeYlessState state = new KeYlessState("exampleState"); state.addValue(new KeYlessValue("v1", "v1", false, "-1", "v1Value", "t1", null)); diff --git a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/MethodWellDefinedness.java b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/MethodWellDefinedness.java index 430e51112e6..f9d73d09580 100644 --- a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/MethodWellDefinedness.java +++ b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/MethodWellDefinedness.java @@ -22,7 +22,6 @@ import org.key_project.logic.Name; import org.key_project.logic.op.Function; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * A contract for checking the well-definedness of a specification for a method or model field. @@ -185,7 +184,7 @@ private boolean findExcNull(JTerm t, ProgramVariable exc) { * @return a list of schema variables */ private ImmutableList paramsSV() { - ImmutableList paramsSV = ImmutableSLList.nil(); + ImmutableList paramsSV = ImmutableList.nil(); for (var pv : getOrigVars().params) { paramsSV = paramsSV.append( SchemaVariableFactory.createTermSV(pv.name(), pv.getKeYJavaType().getSort())); @@ -216,7 +215,7 @@ JTerm generateMbyAtPreDef(LocationVariable self, ImmutableList if (hasMby()) { final JTerm mbyAtPre = TB.func(mbyAtPreFunc); assert params != null; - ImmutableList paramVars = ImmutableSLList.nil(); + ImmutableList paramVars = ImmutableList.nil(); for (var pv : params) { paramVars = paramVars.append(pv); } diff --git a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/SpecificationRepositoryWD.java b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/SpecificationRepositoryWD.java index 7d2fd5f31e1..4ca9e908fd2 100644 --- a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/SpecificationRepositoryWD.java +++ b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/SpecificationRepositoryWD.java @@ -114,7 +114,7 @@ protected Contract registerContract(Contract contract, * @return contracts without well-definedness checks */ private static ImmutableSet removeWdChecks(ImmutableSet contracts) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (contracts == null) { return contracts; } diff --git a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/StatementWellDefinedness.java b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/StatementWellDefinedness.java index 590e3bbcabc..140dccdfbc5 100644 --- a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/StatementWellDefinedness.java +++ b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/StatementWellDefinedness.java @@ -19,7 +19,6 @@ import org.key_project.logic.op.Function; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -69,7 +68,7 @@ abstract SequentFormula generateSequent(SequentTerms seqTerms, * @return a list of the parameter variables */ final static ImmutableList convertParams(ImmutableSet set) { - ImmutableList list = ImmutableSLList.nil(); + ImmutableList list = ImmutableList.nil(); for (LocationVariable pv : set) { list = list.append(pv); } diff --git a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/WellDefinednessCheck.java b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/WellDefinednessCheck.java index ccb77e9c809..b9e8283ce56 100644 --- a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/WellDefinednessCheck.java +++ b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/WellDefinednessCheck.java @@ -35,7 +35,6 @@ import org.key_project.logic.op.Operator; import org.key_project.prover.rules.RuleSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import static de.uka.ilkd.key.logic.equality.IrrelevantTermLabelsProperty.IRRELEVANT_TERM_LABELS_PROPERTY; @@ -117,8 +116,8 @@ enum Type { */ private Pair, ImmutableList> sort(JTerm spec) { assert spec != null; - ImmutableList implicit = ImmutableSLList.nil(); - ImmutableList explicit = ImmutableSLList.nil(); + ImmutableList implicit = ImmutableList.nil(); + ImmutableList explicit = ImmutableList.nil(); if (spec.arity() > 0 && spec.op().equals(Junctor.AND)) { // Conjunctions assert spec.arity() == 2; if (spec.hasLabels() @@ -328,7 +327,7 @@ private Condition replace(Condition pre, Variables vars) { } private ImmutableList replace(Iterable l, Variables vars) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); for (JTerm t : l) { res = res.append(replace(t, vars)); } @@ -336,7 +335,7 @@ private ImmutableList replace(Iterable l, Variables vars) { } private ImmutableList getHeaps() { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); return result.append(getHeap()); } @@ -571,7 +570,7 @@ private JTerm generateParamsOK(ImmutableList private TermListAndFunc buildFreePre(JTerm implicitPre, LocationVariable self, LocationVariable heap, ImmutableList params, Services services) { - ImmutableList resList = ImmutableSLList.nil(); + ImmutableList resList = ImmutableList.nil(); // "self != null" final JTerm selfNotNull = generateSelfNotNull(self); @@ -626,7 +625,7 @@ private TermListAndFunc buildFreePre(JTerm implicitPre, LocationVariable self, private TermListAndFunc buildFreePreForTaclet(JTerm implicitPre, TermSV self, TermSV heap, ImmutableList params, Services services) { - ImmutableList resList = ImmutableSLList.nil(); + ImmutableList resList = ImmutableList.nil(); // "self != null" final JTerm selfNotNull = generateSelfNotNull(self); @@ -846,7 +845,7 @@ final Type type() { * @return a list of all remaining clauses */ ImmutableList getRest() { - ImmutableList rest = ImmutableSLList.nil(); + ImmutableList rest = ImmutableList.nil(); final JTerm accessible = this.accessible; if (accessible != null) { rest = rest.append(accessible); diff --git a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/po/WellDefinednessPO.java b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/po/WellDefinednessPO.java index 597cf841da4..2170e060659 100644 --- a/key.core.wd/src/main/java/de/uka/ilkd/key/wd/po/WellDefinednessPO.java +++ b/key.core.wd/src/main/java/de/uka/ilkd/key/wd/po/WellDefinednessPO.java @@ -28,7 +28,6 @@ import org.key_project.logic.op.Function; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -120,7 +119,7 @@ private static Map createAtPres(LocationVari private static ImmutableList addGhostParams( ImmutableList paramVars, ImmutableList origParams) { // make sure ghost parameters are present - ImmutableList ghostParams = ImmutableSLList.nil(); + ImmutableList ghostParams = ImmutableList.nil(); for (LocationVariable param : origParams) { if (param.isGhost()) { ghostParams = ghostParams.append(param); @@ -180,7 +179,7 @@ private static Variables buildVariables(WellDefinednessCheck check, Services ser if (vars.params != null && !vars.params.isEmpty()) { params = createParams(target, vars.params, services); } else { - params = ImmutableSLList.nil(); + params = ImmutableList.nil(); } return new Variables(self, result, exception, atPres, params, heap, anonHeap, services); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/control/AbstractProofControl.java b/key.core/src/main/java/de/uka/ilkd/key/control/AbstractProofControl.java index 2d959aaf586..3b7453d10d1 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/control/AbstractProofControl.java +++ b/key.core/src/main/java/de/uka/ilkd/key/control/AbstractProofControl.java @@ -29,7 +29,6 @@ import org.key_project.prover.strategy.RuleApplicationManager; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -110,7 +109,7 @@ public void setMinimizeInteraction(boolean minimizeInteraction) { @Override public ImmutableList getBuiltInRule(Goal focusedGoal, PosInOccurrence pos) { - ImmutableList rules = ImmutableSLList.nil(); + ImmutableList rules = ImmutableList.nil(); for (RuleApp ruleApp : focusedGoal.ruleAppIndex() .getBuiltInRules(focusedGoal, pos)) { @@ -140,7 +139,7 @@ public ImmutableList getFindTaclet(Goal focusedGoal, return filterTaclet(focusedGoal, focusedGoal.ruleAppIndex().getFindTaclet(TacletFilter.TRUE, pos), pos); } - return ImmutableSLList.nil(); + return ImmutableList.nil(); } @Override @@ -151,7 +150,7 @@ public ImmutableList getRewriteTaclet(Goal focusedGoal, focusedGoal.ruleAppIndex().getRewriteTaclet(TacletFilter.TRUE, pos), pos); } - return ImmutableSLList.nil(); + return ImmutableList.nil(); } /** @@ -162,7 +161,7 @@ private ImmutableList filterTaclet(Goal focusedGoal, ImmutableList tacletInstances, PosInOccurrence pos) { HashSet applicableRules = new HashSet<>(); - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (NoPosTacletApp app : tacletInstances) { if (isMinimizeInteraction()) { ImmutableList ifCandidates = app.findIfFormulaInstantiations( @@ -330,7 +329,7 @@ protected ImmutableSet getAppsForName(Goal goal, String name, TacletFilter filter) { Services services = goal.proof().getServices(); ImmutableSet result = DefaultImmutableSet.nil(); - ImmutableList fittingApps = ImmutableSLList.nil(); + ImmutableList fittingApps = ImmutableList.nil(); final RuleAppIndex index = goal.ruleAppIndex(); if (pos == null) { @@ -460,7 +459,7 @@ public ImmutableSet getBuiltInRuleApp(Goal focusedGoal, BuiltIn protected ImmutableSet getBuiltInRuleAppsForName(Goal focusedGoal, String name, PosInOccurrence pos) { ImmutableSet result = DefaultImmutableSet.nil(); - ImmutableList match = ImmutableSLList.nil(); + ImmutableList match = ImmutableList.nil(); // get all possible rules for current position in sequent ImmutableList list = getBuiltInRule(focusedGoal, pos); @@ -636,7 +635,7 @@ public synchronized void startFocussedAutoMode( goal.setRuleAppManager(focusManager); } - startAutoMode(goal.proof(), ImmutableSLList.singleton(goal), + startAutoMode(goal.proof(), ImmutableList.singleton(goal), new FocussedAutoModeTaskListener(goal.proof())); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletFindModel.java b/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletFindModel.java index 9b286c49198..ea7d7ab05bb 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletFindModel.java +++ b/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletFindModel.java @@ -36,7 +36,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.rules.instantiation.IllegalInstantiationException; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.antlr.v4.runtime.CharStreams; @@ -117,7 +116,7 @@ private ArrayList> createEntryArray( noEditRow = count - 1; - ImmutableList proposals = ImmutableSLList.nil(); + ImmutableList proposals = ImmutableList.nil(); for (SchemaVariable var : tacletApp.uninstantiatedVars()) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletInstantiationModel.java b/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletInstantiationModel.java index 429641df1a6..62ceb886d46 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletInstantiationModel.java +++ b/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletInstantiationModel.java @@ -23,7 +23,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; public class TacletInstantiationModel { @@ -155,7 +154,7 @@ private TacletApp createTacletAppFromIfs(TacletApp tacletApp) throws IfMismatchE SVInstantiationParserException, MissingInstantiationException, SortMismatchException { ImmutableList instList = - ImmutableSLList.nil(); + ImmutableList.nil(); for (int i = ifChoiceModel.length - 1; i >= 0; --i) { instList = instList.prepend(ifChoiceModel[i].getSelection(i)); diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/JavaInfo.java b/key.core/src/main/java/de/uka/ilkd/key/java/JavaInfo.java index 4e780b7ca34..dfc1b7812d6 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/JavaInfo.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/JavaInfo.java @@ -28,7 +28,6 @@ import org.key_project.util.LRUCache; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.jspecify.annotations.Nullable; @@ -518,7 +517,7 @@ private IProgramMethod getProgramMethodFromPartialSignature(KeYJavaType classTyp @Nullable public IProgramMethod getProgramMethod(KeYJavaType classType, String methodName, List> signature, KeYJavaType context) { - ImmutableList partialSignature = ImmutableSLList.nil(); + ImmutableList partialSignature = ImmutableList.nil(); return getProgramMethodFromPartialSignature(classType, methodName, signature, partialSignature, context); } @@ -563,7 +562,7 @@ private IProgramMethod findToplevelPM(KeYJavaType kjt, String methodName, public IProgramMethod getToplevelPM(KeYJavaType kjt, IProgramMethod pm) { final String methodName = pm.getName(); - final ImmutableList sig = ImmutableSLList.nil() + final ImmutableList sig = ImmutableList.nil() .append(pm.getParamTypes().toArray(new KeYJavaType[pm.getNumParams()])); return getToplevelPM(kjt, methodName, sig); } @@ -702,7 +701,7 @@ public KeYJavaType getSuperclass(KeYJavaType type) { * gets an array of expression and returns a list of types */ private ImmutableList getKeYJavaTypes(ImmutableArray args) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (args != null) { for (int i = args.size() - 1; i >= 0; i--) { final Expression argument = args.get(i); @@ -745,7 +744,7 @@ public ImmutableList getAllFields(TypeDeclaration classDecl) { */ private ImmutableList filterLocalDeclaredFields(TypeDeclaration classDecl, Filter filter) { - ImmutableList fields = ImmutableSLList.nil(); + ImmutableList fields = ImmutableList.nil(); final ImmutableArray members = classDecl.getMembers(); for (int i = members.size() - 1; i >= 0; i--) { final MemberDeclaration member = members.get(i); @@ -796,7 +795,7 @@ private ProgramVariable find(String programName, Iterable fields) { * of the given list */ private ImmutableList getFields(FieldDeclaration field) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); final ImmutableArray spec = field.getFieldSpecifications(); for (int i = spec.size() - 1; i >= 0; i--) { result = result.prepend(spec.get(i)); @@ -813,7 +812,7 @@ private ImmutableList getFields(FieldDeclaration field) { * of the given list */ private ImmutableList getFields(ImmutableArray list) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (int i = list.size() - 1; i >= 0; i--) { final MemberDeclaration pe = list.get(i); if (pe instanceof FieldDeclaration) { @@ -943,7 +942,7 @@ public ImmutableList getAllAttributes(String programName, KeYJa */ public ImmutableList getAllAttributes(String programName, KeYJavaType type, boolean traverseSubtypes) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (!(type.getSort().extendsTrans(objectSort()))) { return result; @@ -1078,7 +1077,7 @@ public ExecutionContext getDefaultExecutionContext() { DEFAULT_EXECUTION_CONTEXT_METHOD)); final KeYJavaType kjt = getTypeByClassName(DEFAULT_EXECUTION_CONTEXT_CLASS); defaultExecutionContext = new ExecutionContext(new TypeRef(kjt), getToplevelPM(kjt, - DEFAULT_EXECUTION_CONTEXT_METHOD, ImmutableSLList.nil()), null); + DEFAULT_EXECUTION_CONTEXT_METHOD, ImmutableList.nil()), null); } return defaultExecutionContext; } @@ -1154,7 +1153,7 @@ public ImmutableList getCommonSubtypes(KeYJavaType k1, KeYJavaType return result; } - result = ImmutableSLList.nil(); + result = ImmutableList.nil(); if (k1.getSort().extendsTrans(k2.getSort())) { result = getAllSubtypes(k1).prepend(k1); diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/JavaService.java b/key.core/src/main/java/de/uka/ilkd/key/java/JavaService.java index e3924471823..aa156659dcb 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/JavaService.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/JavaService.java @@ -36,7 +36,6 @@ import org.key_project.logic.Namespace; import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import com.github.javaparser.*; @@ -840,7 +839,7 @@ public JavaBlock readBlockWithEmptyContext(String block, */ public JavaBlock readBlockWithProgramVariables(Namespace variables, String s, Namespace allowSchemaJava) { - ImmutableList pvs = ImmutableSLList.nil(); + ImmutableList pvs = ImmutableList.nil(); for (IProgramVariable n : variables.allElements()) { if (n instanceof ProgramVariable) { pvs = pvs.append(n); // preserve the order (nested namespaces!) diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/KeYProgModelInfo.java b/key.core/src/main/java/de/uka/ilkd/key/java/KeYProgModelInfo.java index a0342b15026..713b62828a3 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/KeYProgModelInfo.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/KeYProgModelInfo.java @@ -20,14 +20,12 @@ import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import com.github.javaparser.ast.AccessSpecifier; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.Modifier; import com.github.javaparser.ast.Node; import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.expr.*; import com.github.javaparser.ast.nodeTypes.NodeWithModifiers; import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.ast.type.PrimitiveType; @@ -625,7 +623,7 @@ public ImmutableList findImplementations(KeYJavaType ct, String nam rct = rct.getAncestors().get(1).getTypeDeclaration().orElseThrow(); } - ImmutableList classList = ImmutableSLList.nil(); + ImmutableList classList = ImmutableList.nil(); classList = recFindImplementations(rct, name, jpSignature, classList); if (!declaresApplicableMethods(rct, name, jpSignature, rct)) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/ContextStatementBlock.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/ContextStatementBlock.java index 304e085d9f5..72ab2cbb953 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/ContextStatementBlock.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/ContextStatementBlock.java @@ -18,7 +18,7 @@ import org.key_project.logic.IntIterator; import org.key_project.util.collection.ImmutableArray; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; /** * In the DL-formulae description of Taclets the program part can have the following form @@ -52,7 +52,7 @@ public ContextStatementBlock( PositionInfo pi, List c, ImmutableArray body, IExecutionContext execContext) { - super(pi, c, body, ImmutableSLList.nil()); + super(pi, c, body, ImmutableList.nil()); this.executionContext = execContext; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/ProgramElement.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/ProgramElement.java index fa6d0ef6242..d2dafe3e086 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/ProgramElement.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/ProgramElement.java @@ -8,7 +8,6 @@ import de.uka.ilkd.key.speclang.jml.pretranslation.TextualJMLConstruct; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; @@ -28,7 +27,7 @@ public interface ProgramElement extends SourceElement, ModelElement { /// default ImmutableList getAttachedJml() { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/StatementBlock.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/StatementBlock.java index bf47856cf72..5b2456d3e2e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/StatementBlock.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/StatementBlock.java @@ -22,7 +22,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -89,7 +88,7 @@ public StatementBlock(@NonNull ImmutableArray as) { ProgramPrefixUtil.ProgramPrefixInfo info = ProgramPrefixUtil.computeEssentials(this); prefixLength = info.getLength(); innerMostMethodFrame = info.getInnerMostMethodFrame(); - attachedJML = ImmutableSLList.nil(); + attachedJML = ImmutableList.nil(); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/ArrayDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/ArrayDeclaration.java index cee7f4a0b62..1558d5e4c08 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/ArrayDeclaration.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/ArrayDeclaration.java @@ -12,7 +12,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * KeY used to model arrays using only the {@link ArrayType}. As @@ -239,7 +238,7 @@ public String getAlternativeNameRepresentation() { * returns the local declared supertypes */ public ImmutableList getSupertypes() { - return ImmutableSLList.nil().append(superType); + return ImmutableList.nil().append(superType); } /** diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/ClassDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/ClassDeclaration.java index 90124b65d2e..f7a6fe67fc9 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/ClassDeclaration.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/ClassDeclaration.java @@ -17,7 +17,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * There are several types of class declarations: @@ -251,7 +250,7 @@ public boolean isInterface() { * returns the local declared supertypes */ public ImmutableList getSupertypes() { - ImmutableList types = ImmutableSLList.nil(); + ImmutableList types = ImmutableList.nil(); if (implementing != null) { for (int i = implementing.getTypeReferenceCount() - 1; i >= 0; i--) { types = types.prepend(implementing.getTypeReferenceAt(i).getKeYJavaType()); diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/InterfaceDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/InterfaceDeclaration.java index 55e5c8e44b0..f25f56d278f 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/InterfaceDeclaration.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/InterfaceDeclaration.java @@ -29,7 +29,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -235,7 +234,7 @@ public boolean isInterface() { * returns the local declared supertypes */ public ImmutableList getSupertypes() { - ImmutableList types = ImmutableSLList.nil(); + ImmutableList types = ImmutableList.nil(); if (extending != null) { for (int i = extending.getTypeReferenceCount() - 1; i >= 0; i--) { types = types.prepend(extending.getTypeReferenceAt(i).getKeYJavaType()); diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/JavaDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/JavaDeclaration.java index e779e9c26e6..1b6f6d9f949 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/JavaDeclaration.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/JavaDeclaration.java @@ -28,7 +28,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -63,17 +62,17 @@ public JavaDeclaration(PositionInfo pi, List comments, * Java declaration. */ public JavaDeclaration() { - this(null, null, new ImmutableArray<>(), ImmutableSLList.nil()); + this(null, null, new ImmutableArray<>(), ImmutableList.nil()); } public JavaDeclaration(Modifier[] mods) { - this(null, null, new ImmutableArray<>(mods), ImmutableSLList.nil()); + this(null, null, new ImmutableArray<>(mods), ImmutableList.nil()); } public JavaDeclaration(ImmutableArray mods) { - this(null, null, mods, ImmutableSLList.nil()); + this(null, null, mods, ImmutableList.nil()); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/SuperArrayDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/SuperArrayDeclaration.java index 0e038802587..c9872f853f5 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/SuperArrayDeclaration.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/SuperArrayDeclaration.java @@ -9,7 +9,6 @@ import de.uka.ilkd.key.logic.ProgramElementName; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * At the moment the mere purpose of this Class is to provide an encapsulation for the length @@ -44,7 +43,7 @@ public FieldDeclaration length() { * returns the local declared supertypes */ public ImmutableList getSupertypes() { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/TypeDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/TypeDeclaration.java index 56b7eb8c87b..db4cbe55210 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/TypeDeclaration.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/TypeDeclaration.java @@ -18,7 +18,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.slf4j.Logger; @@ -225,10 +224,10 @@ public ImmutableList getFields(Services services) { */ public ImmutableList getAllFields(Services services) { if (members == null) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (MemberDeclaration member : members) { if (member instanceof FieldDeclaration) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/VariableDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/VariableDeclaration.java index c51580e7788..6a930c899c4 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/VariableDeclaration.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/declaration/VariableDeclaration.java @@ -14,7 +14,7 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.jspecify.annotations.NonNull; @@ -102,7 +102,7 @@ protected VariableDeclaration(ExtList children, boolean parentIsInterfaceDeclara public VariableDeclaration(PositionInfo pi, List c, ImmutableArray modArray, TypeReference type, boolean parentIsInferface) { - super(pi, c, modArray, ImmutableSLList.nil()); + super(pi, c, modArray, ImmutableList.nil()); this.typeReference = type; this.parentIsInterfaceDeclaration = parentIsInferface; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/reference/MethodReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/reference/MethodReference.java index 6d33fda6e8b..abf8ef97ad9 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/reference/MethodReference.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/reference/MethodReference.java @@ -22,7 +22,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Method reference. @@ -287,7 +286,7 @@ public Expression getArgumentAt(int index) { * determines the arguments types and constructs a signature of the current method */ public ImmutableList getMethodSignature(Services services, ExecutionContext ec) { - ImmutableList signature = ImmutableSLList.nil(); + ImmutableList signature = ImmutableList.nil(); if (arguments != null) { final TypeConverter typeConverter = services.getTypeConverter(); for (int i = arguments.size() - 1; i >= 0; i--) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/Do.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/Do.java index dccf026f5a7..076bafafbf0 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/Do.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/Do.java @@ -12,7 +12,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Do. @@ -44,7 +43,7 @@ public Do(Expression guard, Statement body, PositionInfo pos) { } public Do(PositionInfo pi, List comments, Guard guard, Statement body) { - super(pi, comments, null, null, guard, body, ImmutableSLList.nil()); + super(pi, comments, null, null, guard, body, ImmutableList.nil()); } public Do(PositionInfo pi, List comments, Guard guard, Statement body, diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/EnhancedFor.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/EnhancedFor.java index f5235a72f21..28a624b36e4 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/EnhancedFor.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/EnhancedFor.java @@ -13,7 +13,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -30,12 +29,12 @@ public class EnhancedFor extends LoopStatement implements VariableScope { private EnhancedFor(PositionInfo pi, List comments, ILoopInit inits, IForUpdates updates, IGuard guard, Statement body) { - super(pi, comments, inits, updates, guard, body, ImmutableSLList.nil()); + super(pi, comments, inits, updates, guard, body, ImmutableList.nil()); } public EnhancedFor(PositionInfo pi, List comments, ILoopInit inits, IGuard guard, Statement body) { - super(pi, comments, inits, null, guard, body, ImmutableSLList.nil()); + super(pi, comments, inits, null, guard, body, ImmutableList.nil()); } public EnhancedFor(PositionInfo pi, List comments, ILoopInit inits, diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/For.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/For.java index bda9f070b2c..ed6fa60174e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/For.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/For.java @@ -15,7 +15,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * For. @@ -54,7 +53,7 @@ public For(ExtList children) { public For(PositionInfo pi, List comments, ILoopInit inits, IForUpdates updates, IGuard guard, Statement body) { - super(pi, comments, inits, updates, guard, body, ImmutableSLList.nil()); + super(pi, comments, inits, updates, guard, body, ImmutableList.nil()); } public For(PositionInfo pi, List comments, ILoopInit inits, IForUpdates updates, diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/LoopStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/LoopStatement.java index be33875ad4d..6332672e477 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/LoopStatement.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/LoopStatement.java @@ -13,7 +13,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -65,7 +64,7 @@ public LoopStatement(@NonNull Expression guard, @NonNull Statement body, ExtList this.updates = null; this.inits = null; this.guard = new Guard(guard); - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } public LoopStatement(Expression guard, @NonNull Statement body, ExtList comments, @@ -75,7 +74,7 @@ public LoopStatement(Expression guard, @NonNull Statement body, ExtList comments this.updates = null; this.inits = null; this.guard = new Guard(guard); - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } public LoopStatement(Expression guard, @NonNull Statement body) { @@ -83,7 +82,7 @@ public LoopStatement(Expression guard, @NonNull Statement body) { this.updates = null; this.inits = null; this.guard = new Guard(guard); - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } public LoopStatement(Expression guard, @NonNull Statement body, PositionInfo pos) { @@ -92,7 +91,7 @@ public LoopStatement(Expression guard, @NonNull Statement body, PositionInfo pos this.updates = null; this.inits = null; this.guard = new Guard(guard); - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } @@ -118,7 +117,7 @@ public LoopStatement(LoopInitializer[] inits, Expression guard, Expression[] upd } this.inits = new LoopInit(inits); this.guard = new Guard(guard); - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } /** @@ -143,7 +142,7 @@ public LoopStatement(ILoopInit inits, @NonNull IGuard guard, IForUpdates updates this.updates = updates; this.inits = inits; this.guard = guard; - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } @@ -155,7 +154,7 @@ public LoopStatement(ILoopInit inits, @NonNull IGuard guard, IForUpdates updates this.updates = updates; this.inits = inits; this.guard = guard; - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } @@ -181,7 +180,7 @@ public LoopStatement(ILoopInit inits, @NonNull IGuard guard, IForUpdates updates this.updates = updates; this.inits = inits; this.guard = guard; - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } @@ -203,7 +202,7 @@ public LoopStatement(ILoopInit inits, @NonNull IGuard guard, IForUpdates updates this.updates = updates; this.inits = inits; this.guard = guard; - this.attachedJml = ImmutableSLList.nil(); + this.attachedJml = ImmutableList.nil(); } public LoopStatement(PositionInfo pi, List comments, ILoopInit inits, diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/MergePointStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/MergePointStatement.java index f0b3a8ce6a0..838df916608 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/MergePointStatement.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/MergePointStatement.java @@ -28,7 +28,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * A statement indicating a merge point. @@ -45,7 +44,7 @@ public class MergePointStatement extends JavaStatement @Override public ImmutableList getAttachedJml() { - return context == null ? ImmutableSLList.nil() : ImmutableList.of(context); + return context == null ? ImmutableList.nil() : ImmutableList.of(context); } public MergePointStatement( diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/While.java b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/While.java index 0262e9d3943..f6a4bb9e8b2 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/While.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/ast/statement/While.java @@ -12,7 +12,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * While. @@ -63,7 +62,7 @@ public While(Expression guard, Statement body, PositionInfo pos) { } public While(PositionInfo pi, List c, Guard guard, Statement body) { - super(pi, c, null, null, guard, body, ImmutableSLList.nil()); + super(pi, c, null, null, guard, body, ImmutableList.nil()); } public While(PositionInfo pi, List c, Guard guard, Statement body, diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/loader/CreateArrayMethodBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/java/loader/CreateArrayMethodBuilder.java index 7275fe5f2b0..704f7036a78 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/loader/CreateArrayMethodBuilder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/loader/CreateArrayMethodBuilder.java @@ -50,7 +50,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * This class creates the <createArray> method for array creation and in @@ -123,7 +122,7 @@ private List createArray(ImmutableList fields) { * of the given list */ private ImmutableList filterField(ImmutableArray list) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (int i = list.size() - 1; i >= 0; i--) { MemberDeclaration pe = list.get(i); if (pe instanceof FieldDeclaration) { @@ -142,7 +141,7 @@ private ImmutableList filterField(ImmutableArray list) * of the given list */ private ImmutableList filterField(FieldDeclaration field) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); ImmutableArray spec = field.getFieldSpecifications(); for (int i = spec.size() - 1; i >= 0; i--) { result = result.prepend(spec.get(i)); @@ -158,7 +157,7 @@ private ImmutableList filterField(FieldDeclaration field) { * @return a list with all implicit fields found in 'list' */ private ImmutableList filterImplicitFields(ImmutableList list) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (Field field : list) { if (field.isImplicit()) { result = result.append(field); diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/loader/JP2KeYTypeConverter.java b/key.core/src/main/java/de/uka/ilkd/key/java/loader/JP2KeYTypeConverter.java index 278ced1684e..45a492db86e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/loader/JP2KeYTypeConverter.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/loader/JP2KeYTypeConverter.java @@ -474,7 +474,7 @@ private void addImplicitArrayMembers(ExtList members, KeYJavaType parent, KeYJav * of the given list */ private ImmutableList filterField(FieldDeclaration field) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); ImmutableArray spec = field.getFieldSpecifications(); for (int i = spec.size() - 1; i >= 0; i--) { result = result.prepend(spec.get(i)); @@ -491,7 +491,7 @@ private ImmutableList filterField(FieldDeclaration field) { * of the given list */ private ImmutableList filterField(ExtList list) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (Object aList : list) { Object pe = aList; if (pe instanceof FieldDeclaration) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/JavaASTCollector.java b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/JavaASTCollector.java index 98a2b3264f4..c2da7f7a08e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/JavaASTCollector.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/JavaASTCollector.java @@ -6,7 +6,6 @@ import de.uka.ilkd.key.java.ast.ProgramElement; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Walks through a java AST in depth-left-fist-order. You can set the type of nodes you want to @@ -18,7 +17,7 @@ public class JavaASTCollector extends JavaASTWalker { /** the type of nodes to be collected */ private final Class type; /** the list of found elements */ - private ImmutableList resultList = ImmutableSLList.nil(); + private ImmutableList resultList = ImmutableList.nil(); /** * create the JavaASTWalker diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/ProgVarReplaceVisitor.java b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/ProgVarReplaceVisitor.java index 3eb1c9e468d..d2400acc40c 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/ProgVarReplaceVisitor.java +++ b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/ProgVarReplaceVisitor.java @@ -34,7 +34,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -191,7 +190,7 @@ private JTerm replaceVariablesInTerm(JTerm t) { } private ImmutableList replaceVariablesInTerms(ImmutableList terms) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); boolean changed = false; for (final JTerm term : terms) { final JTerm newTerm = replaceVariablesInTerm(term); @@ -203,7 +202,7 @@ private ImmutableList replaceVariablesInTerms(ImmutableList terms) private ImmutableList replaceVariablesInTermListTriples( ImmutableList terms) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); boolean changed = false; for (final InfFlowSpec innerTerms : terms) { final ImmutableList renamedPreExpressions = diff --git a/key.core/src/main/java/de/uka/ilkd/key/ldt/HeapLDT.java b/key.core/src/main/java/de/uka/ilkd/key/ldt/HeapLDT.java index 8c9a339c4f4..6bd80bac960 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/ldt/HeapLDT.java +++ b/key.core/src/main/java/de/uka/ilkd/key/ldt/HeapLDT.java @@ -32,7 +32,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -125,7 +124,7 @@ public HeapLDT(TermServices services) { acc = addFunction(services, "acc"); reach = addFunction(services, "reach"); prec = addFunction(services, "prec"); - heaps = ImmutableSLList.nil() + heaps = ImmutableList.nil() .append((LocationVariable) progVars.lookup(BASE_HEAP_NAME)) .append((LocationVariable) progVars.lookup(SAVED_HEAP_NAME)); if (services instanceof Services s) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/GenericArgument.java b/key.core/src/main/java/de/uka/ilkd/key/logic/GenericArgument.java index e366e043ff4..4cf0b0f340d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/logic/GenericArgument.java +++ b/key.core/src/main/java/de/uka/ilkd/key/logic/GenericArgument.java @@ -11,7 +11,6 @@ import org.key_project.logic.TerminalSyntaxElement; import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -27,7 +26,7 @@ public GenericArgument instantiate(SVInstantiations svInst, Services services) { return new GenericArgument( svInst.getGenericSortInstantiations().getRealSort(gs, services)); } else if (sort instanceof ParametricSortInstance psi) { - ImmutableList args = ImmutableSLList.nil(); + ImmutableList args = ImmutableList.nil(); for (int i = psi.getArgs().size() - 1; i >= 0; i--) { args = args.prepend(psi.getArgs().get(i).instantiate(svInst, services)); diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/MethodStackInfo.java b/key.core/src/main/java/de/uka/ilkd/key/logic/MethodStackInfo.java index 65a00e3eeaf..e20876e3838 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/logic/MethodStackInfo.java +++ b/key.core/src/main/java/de/uka/ilkd/key/logic/MethodStackInfo.java @@ -9,7 +9,6 @@ import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; public class MethodStackInfo implements NameCreationInfo { @@ -28,7 +27,7 @@ public MethodStackInfo(ProgramElement element) { * returns the method call stack */ public ImmutableList getMethodStack() { - ImmutableList list = ImmutableSLList.nil(); + ImmutableList list = ImmutableList.nil(); if (element instanceof ProgramPrefix) { final ImmutableArray prefix = ((ProgramPrefix) element).getPrefixElements(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/TermBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/logic/TermBuilder.java index f9b363ee86a..9467c837bdf 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/logic/TermBuilder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/logic/TermBuilder.java @@ -223,7 +223,7 @@ public LocationVariable selfVar(IProgramMethod pm, KeYJavaType kjt, boolean make */ public ImmutableList paramVars(IObserverFunction obs, boolean makeNamesUnique) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (int i = 0, n = obs.getNumParams(); i < n; i++) { final KeYJavaType paramType = obs.getParamType(i); String name; @@ -245,7 +245,7 @@ public ImmutableList paramVars(IObserverFunction obs, public ImmutableList paramVars(String postfix, IObserverFunction obs, boolean makeNamesUnique) { final ImmutableList paramVars = paramVars(obs, makeNamesUnique); - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (LocationVariable paramVar : paramVars) { ProgramElementName pen = new ProgramElementName(paramVar.name() + postfix); LocationVariable formalParamVar = new LocationVariable(pen, paramVar.getKeYJavaType()); @@ -382,7 +382,7 @@ public JTerm var(ProgramVariable v) { } public ImmutableList var(ProgramVariable... vs) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (ProgramVariable v : vs) { result = result.append(var(v)); } @@ -390,7 +390,7 @@ public ImmutableList var(ProgramVariable... vs) { } public ImmutableList var(Iterable vs) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (ProgramVariable v : vs) { result = result.append(var(v)); } @@ -1022,7 +1022,7 @@ public JTerm parallel(JTerm[] lhss, JTerm[] values) { } public JTerm parallel(Iterable lhss, Iterable values) { - ImmutableList updates = ImmutableSLList.nil(); + ImmutableList updates = ImmutableList.nil(); Iterator lhssIt = lhss.iterator(); Iterator rhssIt = values.iterator(); while (lhssIt.hasNext()) { @@ -1063,7 +1063,7 @@ public JTerm apply(JTerm update, JTerm target) { } public ImmutableList apply(JTerm update, ImmutableList targets) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JTerm target : targets) { result = result.append(apply(update, target)); } @@ -1091,7 +1091,7 @@ public JTerm applyElementary(JTerm heap, JTerm target) { } public ImmutableList applyElementary(JTerm heap, Iterable targets) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JTerm target : targets) { result = result.append(apply(elementary(heap), target, null)); } @@ -1119,7 +1119,7 @@ public JTerm applySequential(JTerm[] updates, JTerm target) { if (updates.length == 0) { return target; } else { - ImmutableList updateList = ImmutableSLList.nil().append(updates).tail(); + ImmutableList updateList = ImmutableList.nil().append(updates).tail(); return apply(updates[0], applySequential(updateList, target), null); } } @@ -1511,7 +1511,7 @@ public JTerm wd(JTerm t) { } public ImmutableList wd(Iterable l) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); for (JTerm t : l) { res = res.append(wd(t)); } @@ -1992,7 +1992,7 @@ public JTerm frame(JTerm heapTerm, Map normalToAtPre, JTerm modifi final JTerm modifiableAtPre = or.replace(modifiable); final JTerm createdAtPre = or.replace(created(heapTerm, objVarTerm)); - ImmutableList quantVars = ImmutableSLList.nil(); + ImmutableList quantVars = ImmutableList.nil(); quantVars = quantVars.append(objVar); quantVars = quantVars.append(fieldVar); // selects on permission heaps have to be explicitly typed as field type @@ -2030,7 +2030,7 @@ public JTerm frameStrictlyEmpty(JTerm heapTerm, Map normalToAtPre) final OpReplacer or = new OpReplacer(normalToAtPre, tf); - ImmutableList quantVars = ImmutableSLList.nil(); + ImmutableList quantVars = ImmutableList.nil(); quantVars = quantVars.append(objVar); quantVars = quantVars.append(fieldVar); @@ -2181,7 +2181,7 @@ public ImmutableSet unionToSet(JTerm s) { assert s.sort().equals(setLDT.targetSort()); final Function union = setLDT.getUnion(); ImmutableSet result = DefaultImmutableSet.nil(); - ImmutableList workingList = ImmutableSLList.nil().prepend(s); + ImmutableList workingList = ImmutableList.nil().prepend(s); while (!workingList.isEmpty()) { JTerm f = workingList.head(); workingList = workingList.tail(); @@ -2208,7 +2208,7 @@ public static JTerm goBelowUpdates(JTerm term) { * Removes leading updates from the passed term. */ public static Pair, JTerm> goBelowUpdates2(JTerm term) { - ImmutableList updates = ImmutableSLList.nil(); + ImmutableList updates = ImmutableList.nil(); while (term.op() instanceof UpdateApplication) { updates = updates.append(UpdateApplication.getUpdate(term)); term = UpdateApplication.getTarget(term); @@ -2232,7 +2232,7 @@ public JTerm values() { * @return The {@link JTerm} {@link Sort}s. */ public ImmutableList getSorts(Iterable terms) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JTerm t : terms) { result = result.append(t.sort()); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/equality/RenamingTermProperty.java b/key.core/src/main/java/de/uka/ilkd/key/logic/equality/RenamingTermProperty.java index e1f60efa7f3..edcefa3e38d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/logic/equality/RenamingTermProperty.java +++ b/key.core/src/main/java/de/uka/ilkd/key/logic/equality/RenamingTermProperty.java @@ -15,7 +15,6 @@ import org.key_project.logic.op.QuantifiableVariable; import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import static de.uka.ilkd.key.logic.equality.RenamingSourceElementProperty.RENAMING_SOURCE_ELEMENT_PROPERTY; @@ -59,8 +58,8 @@ public boolean equalsModThisProperty(Term term1, Term term2, V... v) { if (term2 == term1) { return true; } - return unifyHelp(term1, term2, ImmutableSLList.nil(), - ImmutableSLList.nil(), null); + return unifyHelp(term1, term2, ImmutableList.nil(), + ImmutableList.nil(), null); } /** @@ -72,7 +71,7 @@ public boolean equalsModThisProperty(Term term1, Term term2, V... v) { @Override public int hashCodeModThisProperty(Term term) { // Labels can be completely ignored - return hashTermHelper(term, ImmutableSLList.nil(), 1); + return hashTermHelper(term, ImmutableList.nil(), 1); } // equals modulo renaming logic diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/label/TermLabelManager.java b/key.core/src/main/java/de/uka/ilkd/key/logic/label/TermLabelManager.java index f08bb194f98..4831f780a39 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/logic/label/TermLabelManager.java +++ b/key.core/src/main/java/de/uka/ilkd/key/logic/label/TermLabelManager.java @@ -27,7 +27,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.key_project.util.java.CollectionUtil; @@ -121,7 +120,7 @@ public class TermLabelManager { /** * All rule independent {@link TermLabelUpdate}s. */ - private ImmutableList allRulesUpdates = ImmutableSLList.nil(); + private ImmutableList allRulesUpdates = ImmutableList.nil(); /** * All rule specific {@link TermLabelRefactoring}s. @@ -133,12 +132,12 @@ public class TermLabelManager { * All rule independent {@link TermLabelRefactoring}s. */ private ImmutableList allRulesRefactorings = - ImmutableSLList.nil(); + ImmutableList.nil(); /** * The {@link Name}s of all supported {@link TermLabel}s. */ - private ImmutableList supportedTermLabelnames = ImmutableSLList.nil(); + private ImmutableList supportedTermLabelnames = ImmutableList.nil(); /** * {@link Map}s the {@link Name} of a {@link TermLabel} to its {@link TermLabelMerger}. @@ -264,7 +263,7 @@ private void analyzeUpdates(ImmutableList updates) { for (Name rule : supportedRules) { ImmutableList ruleUpdates = ruleSpecificUpdates.get(rule); if (ruleUpdates == null) { - ruleUpdates = ImmutableSLList.nil(); + ruleUpdates = ImmutableList.nil(); } ruleUpdates = ruleUpdates.prepend(update); ruleSpecificUpdates.put(rule, ruleUpdates); @@ -295,7 +294,7 @@ private void analyzeRefactorings(ImmutableList refactoring ImmutableList ruleRefactorings = ruleSpecificRefactorings.get(rule); if (ruleRefactorings == null) { - ruleRefactorings = ImmutableSLList.nil(); + ruleRefactorings = ImmutableList.nil(); } ruleRefactorings = ruleRefactorings.prepend(refactoring); ruleSpecificRefactorings.put(rule, ruleRefactorings); @@ -335,7 +334,7 @@ public static ImmutableList getSupportedTermLabelNames(Services services) if (manager != null) { return manager.getSupportedTermLabelNames(); } else { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java index 18cb3896e2c..95dd442c056 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java +++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java @@ -24,7 +24,6 @@ import org.key_project.util.ExtList; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -451,7 +450,7 @@ public MatchConditions match(SourceData source, MatchConditions matchCond) { @Override public ImmutableList collectParameters() { - ImmutableList paramVars = ImmutableSLList.nil(); + ImmutableList paramVars = ImmutableList.nil(); int numParams = getParameterDeclarationCount(); for (int i = numParams - 1; i >= 0; i--) { ParameterDeclaration pd = getParameterDeclarationAt(i); diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/sort/ParametricSortInstance.java b/key.core/src/main/java/de/uka/ilkd/key/logic/sort/ParametricSortInstance.java index 5169f2376d6..98f82854b88 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/logic/sort/ParametricSortInstance.java +++ b/key.core/src/main/java/de/uka/ilkd/key/logic/sort/ParametricSortInstance.java @@ -19,7 +19,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -174,7 +173,7 @@ public static Sort instantiate(Sort sort, Map map, return arg == null ? gs : arg.sort(); } else if (sort instanceof ParametricSortInstance psi) { var base = psi.getBase(); - ImmutableList args = ImmutableSLList.nil(); + ImmutableList args = ImmutableList.nil(); for (int i = psi.getArgs().size() - 1; i >= 0; i--) { var psiArg = psi.getArgs().get(i); args = args.prepend(new GenericArgument(instantiate(psiArg.sort(), map, services))); @@ -210,7 +209,7 @@ public boolean isComplete(SVInstantiations instMap) { /// Get the sort if this parametric sort with all generics instantiated with `instMap`. public Sort resolveSort(SVInstantiations instMap, Services services) { - ImmutableList newArgs = ImmutableSLList.nil(); + ImmutableList newArgs = ImmutableList.nil(); for (int i = args.size() - 1; i >= 0; i--) { GenericArgument arg = args.get(i); var sort = arg.sort(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/AbstractProofMacro.java b/key.core/src/main/java/de/uka/ilkd/key/macros/AbstractProofMacro.java index ff6182b5037..a23fd608aea 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/macros/AbstractProofMacro.java +++ b/key.core/src/main/java/de/uka/ilkd/key/macros/AbstractProofMacro.java @@ -12,7 +12,6 @@ import org.key_project.prover.engine.ProverTaskListener; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Takes care of providing the whole ProofMacro interface by only making it necessary to implement @@ -28,7 +27,7 @@ public abstract class AbstractProofMacro implements ProofMacro { private static ImmutableList getGoals(Node node) { if (node == null) { // can happen during initialisation - return ImmutableSLList.nil(); + return ImmutableList.nil(); } else { return node.proof().getSubtreeEnabledGoals(node); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/ProofMacroFinishedInfo.java b/key.core/src/main/java/de/uka/ilkd/key/macros/ProofMacroFinishedInfo.java index 8370edb8bce..eec0b05cea6 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/macros/ProofMacroFinishedInfo.java +++ b/key.core/src/main/java/de/uka/ilkd/key/macros/ProofMacroFinishedInfo.java @@ -15,7 +15,6 @@ import org.key_project.prover.engine.ProofSearchInformation; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -38,7 +37,7 @@ public class ProofMacroFinishedInfo extends DefaultTaskFinishedInfo { ProofMacroFinishedInfo(ProofMacro macro, Goal goal, Proof proof, long time, int appliedRules, int closedGoals) { - this(macro, ImmutableSLList.nil().prepend(goal), proof, time, appliedRules, + this(macro, ImmutableList.nil().prepend(goal), proof, time, appliedRules, closedGoals); } @@ -115,13 +114,13 @@ public ProofMacro getMacro() { public ImmutableList getGoals() { final Object result = getResult(); if (result == null) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } else { return (ImmutableList) result; } } public static ProofMacroFinishedInfo getDefaultInfo(ProofMacro macro, Proof proof) { - return new ProofMacroFinishedInfo(macro, ImmutableSLList.nil(), proof); + return new ProofMacroFinishedInfo(macro, ImmutableList.nil(), proof); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/TryCloseMacro.java b/key.core/src/main/java/de/uka/ilkd/key/macros/TryCloseMacro.java index 753f6f2a894..db69a918242 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/macros/TryCloseMacro.java +++ b/key.core/src/main/java/de/uka/ilkd/key/macros/TryCloseMacro.java @@ -15,7 +15,6 @@ import org.key_project.prover.engine.ProverTaskListener; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * The Class TryCloseMacro tries to close goals. Goals are either closed or left untouched. @@ -173,7 +172,7 @@ public ProofMacroFinishedInfo applyTo(UserInterfaceControl uic, Proof proof, int maxSteps = numberSteps > 0 ? numberSteps : proof.getSettings().getStrategySettings().getMaxSteps(); final ProofSearchInformation result = applyStrategy.start(proof, - ImmutableSLList.nil().prepend(goal), maxSteps, -1, false); + ImmutableList.nil().prepend(goal), maxSteps, -1, false); // final Goal closedGoal; // retreat if not closed diff --git a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/DefaultBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/DefaultBuilder.java index edeffedf972..b0f997b17fd 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/DefaultBuilder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/DefaultBuilder.java @@ -30,7 +30,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.rules.RuleSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.antlr.v4.runtime.ParserRuleContext; @@ -368,7 +367,7 @@ private ImmutableList getGenericArgs(KeYParser.Formal_sort_args semanticError(ctx, "Expected %d sort arguments, got only %d", params.size(), ctx.sortId().size()); } - ImmutableList args = ImmutableSLList.nil(); + ImmutableList args = ImmutableList.nil(); for (int i = params.size() - 1; i >= 0; i--) { var arg = ctx.sortId(i); var sort = visitSortId(arg); diff --git a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ExpressionBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ExpressionBuilder.java index b5b27874d6d..d088ed77a86 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ExpressionBuilder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ExpressionBuilder.java @@ -44,7 +44,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.java.StringUtil; @@ -570,7 +569,7 @@ public Object visitTermorseq(KeYParser.TermorseqContext ctx) { } if (head != null && ss != null) { // A sequent with only head in the antecedent. - var ant = ImmutableSLList.singleton(new SequentFormula(head)); + var ant = ImmutableList.singleton(new SequentFormula(head)); return JavaDLSequentKit.createSequent(ant, ss); } if (head != null && s != null) { @@ -579,7 +578,7 @@ public Object visitTermorseq(KeYParser.TermorseqContext ctx) { return JavaDLSequentKit.createSequent(newAnt, s.succedent().asList()); } if (ss != null) { - return JavaDLSequentKit.createSequent(ImmutableSLList.nil(), ss); + return JavaDLSequentKit.createSequent(ImmutableList.nil(), ss); } assert (false); return null; @@ -589,7 +588,7 @@ public Object visitTermorseq(KeYParser.TermorseqContext ctx) { public ImmutableList visitSemisequent(KeYParser.SemisequentContext ctx) { ImmutableList ss = accept(ctx.ss); if (ss == null) { - ss = ImmutableSLList.nil(); + ss = ImmutableList.nil(); } JTerm head = accept(ctx.term()); if (head != null) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ProblemFinder.java b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ProblemFinder.java index f79f810304b..701dfb1f8ff 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ProblemFinder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ProblemFinder.java @@ -18,7 +18,7 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.Nullable; @@ -112,7 +112,7 @@ public ProblemFinder(Services services, NamespaceSet nss) { return s; if (obj instanceof JTerm t) return JavaDLSequentKit - .createSuccSequent(ImmutableSLList.singleton(new SequentFormula(t))); + .createSuccSequent(ImmutableList.singleton(new SequentFormula(t))); return null; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java index 47f7a06730e..6c49d9249ba 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java @@ -27,10 +27,7 @@ import de.uka.ilkd.key.rule.tacletbuilder.*; import de.uka.ilkd.key.util.parsing.BuildingException; -import org.key_project.logic.Choice; -import org.key_project.logic.ChoiceExpr; -import org.key_project.logic.Name; -import org.key_project.logic.Namespace; +import org.key_project.logic.*; import org.key_project.logic.op.Function; import org.key_project.logic.op.QuantifiableVariable; import org.key_project.logic.op.sv.SchemaVariable; @@ -139,7 +136,7 @@ public TacletBuilder visitTriggers(KeYParser.TriggersContext ctx) { TacletBuilder b = peekTBuilder(); JTerm t = accept(ctx.t); List avoidConditions = mapOf(ctx.avoidCond); - b.setTrigger(new Trigger(triggerVar, t, ImmutableList.fromList(avoidConditions))); + b.setTrigger(new Trigger(triggerVar, t, ImmutableList.fromList(avoidConditions))); return null; } @@ -165,8 +162,8 @@ public Taclet visitTaclet(KeYParser.TacletContext ctx) { TacletBuilder b = createTacletBuilderFor(null, ApplicationRestriction.NONE, ctx); currentTBuilder.push(b); SequentFormula sform = new SequentFormula(form); - Sequent addSeq = JavaDLSequentKit.createAnteSequent(ImmutableSLList.singleton(sform)); - ImmutableList noTaclets = ImmutableSLList.nil(); + Sequent addSeq = JavaDLSequentKit.createAnteSequent(ImmutableList.singleton(sform)); + ImmutableList noTaclets = ImmutableList.nil(); DefaultImmutableSet noSV = DefaultImmutableSet.nil(); addGoalTemplate(null, null, addSeq, noTaclets, noSV, null, null, ctx); b.setName(new Name(name)); @@ -187,7 +184,6 @@ public Taclet visitTaclet(KeYParser.TacletContext ctx) { ifSeq = accept(ctx.ifSeq); } - @Nullable Object find = accept(ctx.find); Sequent seq = find instanceof Sequent ? (Sequent) find : null; @@ -257,7 +253,7 @@ public Object visitDatatype_decl(KeYParser.Datatype_declContext ctx) { if (genParams != null) { var psd = namespaces().parametricSorts().lookup(ctx.name.getText()); assert psd != null; - ImmutableList args = ImmutableSLList.nil(); + ImmutableList args = ImmutableList.nil(); for (int i = psd.getParameters().size() - 1; i >= 0; i--) { args = args.prepend(new GenericArgument(psd.getParameters().get(i).sort())); } @@ -363,7 +359,7 @@ private TacletBuilder createDeconstructorEQTaclet( tacletBuilder.setFind(tb.func(function, tb.var(x))); tacletBuilder.setIfSequent(JavaDLSequentKit.createAnteSequent( - ImmutableSLList + ImmutableList .singleton(new SequentFormula(tb.equals(tb.func(consFn, args), tb.var(x)))))); tacletBuilder.addTacletGoalTemplate(new RewriteTacletGoalTemplate(tb.var(res))); tacletBuilder.setApplicationRestriction( @@ -418,8 +414,8 @@ private TacletBuilder createInductionTaclet( var use = tb.all(qvar, tb.var(phi)); var useCase = new TacletGoalTemplate( - JavaDLSequentKit.createAnteSequent(ImmutableSLList.singleton(new SequentFormula(use))), - ImmutableSLList.nil()); + JavaDLSequentKit.createAnteSequent(ImmutableList.singleton(new SequentFormula(use))), + ImmutableList.nil()); useCase.setName("Use case of " + ctx.name.getText()); cases.add(new GoalTemplAndVars(useCase, null)); @@ -434,8 +430,8 @@ private GoalTemplAndVars createGoalDtConstructor(KeYParser.Datatype_constructorC var constr = createQuantifiedFormula(it, qvar, var, sort); var goal = new TacletGoalTemplate( JavaDLSequentKit - .createSuccSequent(ImmutableSLList.singleton(new SequentFormula(constr.term))), - ImmutableSLList.nil()); + .createSuccSequent(ImmutableList.singleton(new SequentFormula(constr.term))), + ImmutableList.nil()); goal.setName(it.getText()); return new GoalTemplAndVars(goal, constr.vars); } @@ -471,8 +467,8 @@ private TacletBuilder createAxiomTaclet( var goal = new TacletGoalTemplate( JavaDLSequentKit - .createAnteSequent(ImmutableSLList.singleton(new SequentFormula(axiom))), - ImmutableSLList.nil()); + .createAnteSequent(ImmutableList.singleton(new SequentFormula(axiom))), + ImmutableList.nil()); tacletBuilder.addTacletGoalTemplate(goal); tacletBuilder.setName(new Name(String.format("DT_%s_Axiom", sort.name()))); @@ -559,9 +555,9 @@ private RewriteTacletBuilder createConstructorSplit( for (int i = 0; i < args.length; i++) { args[i] = variables.get(context.argName.get(i).getText()); } - Sequent addedSeq = JavaDLSequentKit.createAnteSequent(ImmutableSLList + Sequent addedSeq = JavaDLSequentKit.createAnteSequent(ImmutableList .singleton(new SequentFormula(tb.equals(tb.var(phi), tb.func(func, args))))); - TacletGoalTemplate goal = new TacletGoalTemplate(addedSeq, ImmutableSLList.nil()); + TacletGoalTemplate goal = new TacletGoalTemplate(addedSeq, ImmutableList.nil()); goal.setName("#var = " + context.name.getText()); b.addTacletGoalTemplate(goal); } @@ -798,7 +794,7 @@ public Object visitGoalspec(KeYParser.GoalspecContext ctx) { String name = accept(ctx.string_value()); Sequent addSeq = JavaDLSequentKit.getInstance().getEmptySequent(); - ImmutableSLList addRList = ImmutableSLList.nil(); + ImmutableList addRList = ImmutableList.nil(); DefaultImmutableSet addpv = DefaultImmutableSet.nil(); @Nullable diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/HideSequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/HideSequentPrintFilter.java index c31af6e96d4..c4e819de25e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/pp/HideSequentPrintFilter.java +++ b/key.core/src/main/java/de/uka/ilkd/key/pp/HideSequentPrintFilter.java @@ -10,7 +10,7 @@ import de.uka.ilkd.key.pp.IdentitySequentPrintFilter.IdentityFilterEntry; import org.key_project.prover.sequent.SequentFormula; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; /** * This filter takes a search string and yields a sequent containing only sequent formulas that @@ -50,7 +50,7 @@ protected void filterSequent() { return; } - antec = ImmutableSLList.nil(); + antec = ImmutableList.nil(); it = originalSequent.antecedent().iterator(); while (it.hasNext()) { SequentFormula sf = it.next(); @@ -63,7 +63,7 @@ protected void filterSequent() { } } - succ = ImmutableSLList.nil(); + succ = ImmutableList.nil(); it = originalSequent.succedent().iterator(); while (it.hasNext()) { SequentFormula sf = it.next(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/InitialPositionTable.java b/key.core/src/main/java/de/uka/ilkd/key/pp/InitialPositionTable.java index c530f2669b6..bcd41eb0a7d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/pp/InitialPositionTable.java +++ b/key.core/src/main/java/de/uka/ilkd/key/pp/InitialPositionTable.java @@ -7,7 +7,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * An InitialPositionTable is a PositionTable that describes the beginning of the element/subelement @@ -22,12 +21,12 @@ */ public class InitialPositionTable extends PositionTable { - private ImmutableList updateRanges = ImmutableSLList.nil(); + private ImmutableList updateRanges = ImmutableList.nil(); /** Ranges of keywords */ - private ImmutableList keywordRanges = ImmutableSLList.nil(); + private ImmutableList keywordRanges = ImmutableList.nil(); /** Ranges of java blocks */ - private ImmutableList javaBlockRanges = ImmutableSLList.nil(); + private ImmutableList javaBlockRanges = ImmutableList.nil(); /** * creates a new Initial PositionTable. @@ -88,7 +87,7 @@ private PosInSequent getTopPIS(ImmutableList posList, SequentPrintFilte */ public ImmutableList pathForPosition(PosInOccurrence pio, SequentPrintFilter filter) { - ImmutableList p = ImmutableSLList.nil(); + ImmutableList p = ImmutableList.nil(); p = prependPathInFormula(p, pio); int index = indexOfCfma(pio.sequentFormula(), filter); if (index == -1) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/PositionTable.java b/key.core/src/main/java/de/uka/ilkd/key/pp/PositionTable.java index 173a9c0d452..36b9008f504 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/pp/PositionTable.java +++ b/key.core/src/main/java/de/uka/ilkd/key/pp/PositionTable.java @@ -7,7 +7,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * A PositionTable describes the start and end positions of substrings of a String in order to get a @@ -88,7 +87,7 @@ private int searchEntry(int index) { protected ImmutableList pathForIndex(int index) { int sub = searchEntry(index); if (sub == -1) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } else { return children[sub].pathForIndex(index - startPos[sub]).prepend(sub); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/RegroupSequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/RegroupSequentPrintFilter.java index cf8f1664812..a22d8564bce 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/pp/RegroupSequentPrintFilter.java +++ b/key.core/src/main/java/de/uka/ilkd/key/pp/RegroupSequentPrintFilter.java @@ -10,7 +10,7 @@ import de.uka.ilkd.key.pp.IdentitySequentPrintFilter.IdentityFilterEntry; import org.key_project.prover.sequent.SequentFormula; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; /** * @author jschiffl This filter takes a search string and regroups the sequent so that the sequent @@ -45,7 +45,7 @@ protected void filterSequent() { return; } - antec = ImmutableSLList.nil(); + antec = ImmutableList.nil(); it = originalSequent.antecedent().iterator(); while (it.hasNext()) { SequentFormula sf = it.next(); @@ -60,7 +60,7 @@ protected void filterSequent() { } } - succ = ImmutableSLList.nil(); + succ = ImmutableList.nil(); it = originalSequent.succedent().iterator(); while (it.hasNext()) { SequentFormula sf = it.next(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java index 6ccfcd65c3e..cffd3c87a0b 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java +++ b/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java @@ -10,7 +10,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -26,12 +25,12 @@ public abstract class SequentPrintFilter { /** * the antecedent of the filtered formula */ - ImmutableList antec = ImmutableSLList.nil(); + ImmutableList antec = ImmutableList.nil(); /** * the antecedent of the filtered formula */ - ImmutableList succ = ImmutableSLList.nil(); + ImmutableList succ = ImmutableList.nil(); /** * @return the original sequent @@ -82,13 +81,13 @@ public ImmutableList getFilteredSucc() { * entries. */ protected void filterIdentity() { - antec = ImmutableSLList.nil(); + antec = ImmutableList.nil(); Iterator it = originalSequent.antecedent().iterator(); while (it.hasNext()) { antec = antec.append(new IdentityFilterEntry(it.next())); } - succ = ImmutableSLList.nil(); + succ = ImmutableList.nil(); it = originalSequent.succedent().iterator(); while (it.hasNext()) { succ = succ.append(new IdentityFilterEntry(it.next())); diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/ShowSelectedSequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/ShowSelectedSequentPrintFilter.java index 1ef4e3b701c..fce08e88625 100755 --- a/key.core/src/main/java/de/uka/ilkd/key/pp/ShowSelectedSequentPrintFilter.java +++ b/key.core/src/main/java/de/uka/ilkd/key/pp/ShowSelectedSequentPrintFilter.java @@ -6,7 +6,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * This filter takes a {@link PosInOccurrence} and only shows the sub-formula at that position. @@ -35,18 +34,18 @@ protected void filterSequent() {} @Override public ImmutableList getFilteredAntec() { if (pos.isInAntec()) { - return ImmutableSLList.nil().append(new Entry(pos)); + return ImmutableList.nil().append(new Entry(pos)); } else { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } } @Override public ImmutableList getFilteredSucc() { if (!pos.isInAntec()) { - return ImmutableSLList.nil().append(new Entry(pos)); + return ImmutableList.nil().append(new Entry(pos)); } else { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/BranchLocation.java b/key.core/src/main/java/de/uka/ilkd/key/proof/BranchLocation.java index f1e0460e22c..ce77ea2f01f 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/BranchLocation.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/BranchLocation.java @@ -7,7 +7,6 @@ import java.util.Objects; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; /** @@ -20,7 +19,7 @@ public class BranchLocation { /** * Branch location of the initial proof branch. */ - public static final BranchLocation ROOT = new BranchLocation(ImmutableSLList.nil()); + public static final BranchLocation ROOT = new BranchLocation(ImmutableList.nil()); /** * List of branch choices (branching nodes and sub-proof indices). diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleAppIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleAppIndex.java index d50be41ff40..91b7fd6f045 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleAppIndex.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleAppIndex.java @@ -10,7 +10,6 @@ import org.key_project.prover.sequent.*; import org.key_project.prover.strategy.NewRuleListener; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; public class BuiltInRuleAppIndex { @@ -34,7 +33,7 @@ public BuiltInRuleAppIndex(BuiltInRuleIndex index, NewRuleListener p_newRuleList */ public ImmutableList getBuiltInRule(Goal goal, PosInOccurrence pos) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); ImmutableList rules = index.rules(); while (!rules.isEmpty()) { @@ -98,7 +97,7 @@ private void scanSimplificationRule(ImmutableList rules, Goal goal, private void scanSimplificationRule(ImmutableList rules, Goal goal, boolean antec, SequentFormula cfma, NewRuleListener listener) { final PosInOccurrence pos = new PosInOccurrence(cfma, PosInTerm.getTopLevel(), antec); - ImmutableList subrules = ImmutableSLList.nil(); + ImmutableList subrules = ImmutableList.nil(); while (!rules.isEmpty()) { final BuiltInRule rule = rules.head(); rules = rules.tail(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleIndex.java index e1487a83123..584c7802c4e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleIndex.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleIndex.java @@ -8,7 +8,6 @@ import de.uka.ilkd.key.rule.BuiltInRule; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Index for managing built-in rules such as integer decision or update simplification rule. @@ -20,7 +19,7 @@ public class BuiltInRuleIndex implements Serializable { */ private static final long serialVersionUID = -4399004272449882750L; /** list of available built-in rules */ - private ImmutableList rules = ImmutableSLList.nil(); + private ImmutableList rules = ImmutableList.nil(); /** constructs empty rule index */ public BuiltInRuleIndex() { diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java b/key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java index 2e12543c5f1..87c8f1cfb76 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java @@ -41,7 +41,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.prover.strategy.RuleApplicationManager; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; @@ -79,7 +78,7 @@ public final class Goal implements ProofGoal { * list of all applied rule applications at this branch */ private ImmutableList appliedRuleApps = - ImmutableSLList.nil(); + ImmutableList.nil(); /** * this object manages the tags for all formulas of the sequent */ @@ -133,7 +132,7 @@ public Goal(Node node, TacletIndex tacletIndex, BuiltInRuleAppIndex builtInRuleA Services services) { this.node = node; this.ruleAppIndex = new RuleAppIndex(tacletIndex, builtInRuleAppIndex, this, services); - this.appliedRuleApps = ImmutableSLList.nil(); + this.appliedRuleApps = ImmutableList.nil(); this.goalStrategy = null; this.strategyInfos = new MapProperties(); this.tagManager = new FormulaTagManager(this); @@ -543,7 +542,7 @@ public void removeLastAppliedRuleApp() { * @return the list of new created goals. */ public ImmutableList split(int n) { - ImmutableList goalList = ImmutableSLList.nil(); + ImmutableList goalList = ImmutableList.nil(); final Node parent = node; // has to be stored because the node // of this goal will be replaced diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/InstantiationProposerCollection.java b/key.core/src/main/java/de/uka/ilkd/key/proof/InstantiationProposerCollection.java index 8cd945e6bd5..351c5996a41 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/InstantiationProposerCollection.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/InstantiationProposerCollection.java @@ -8,7 +8,6 @@ import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -17,7 +16,7 @@ public class InstantiationProposerCollection implements InstantiationProposer { private ImmutableList proposers = - ImmutableSLList.nil(); + ImmutableList.nil(); /** * adds an instantiation proposer to the collection diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/MultiThreadedTacletIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/MultiThreadedTacletIndex.java index 216ae49e6f6..cb510fc2b5e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/MultiThreadedTacletIndex.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/MultiThreadedTacletIndex.java @@ -17,7 +17,6 @@ import org.key_project.prover.proof.rulefilter.RuleFilter; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -75,7 +74,7 @@ public TacletIndex copy() { protected ImmutableList matchTaclets( @NonNull ImmutableList tacletApps, RuleFilter p_filter, PosInOccurrence pos, LogicServices services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (tacletApps.size() > 256) { NoPosTacletApp[] toMatch = tacletApps.toArray(NoPosTacletApp.class); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/NameRecorder.java b/key.core/src/main/java/de/uka/ilkd/key/proof/NameRecorder.java index 03d4f5c0d1e..57539c7044d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/NameRecorder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/NameRecorder.java @@ -5,17 +5,16 @@ import org.key_project.logic.Name; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; public class NameRecorder { - private ImmutableList pre = ImmutableSLList.nil(); + private ImmutableList pre = ImmutableList.nil(); - private ImmutableList post = ImmutableSLList.nil(); + private ImmutableList post = ImmutableList.nil(); public void setProposals(ImmutableList proposals) { if (proposals == null) { - pre = ImmutableSLList.nil(); + pre = ImmutableList.nil(); } else { pre = proposals; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/Node.java b/key.core/src/main/java/de/uka/ilkd/key/proof/Node.java index 93c58da43ce..da31485b164 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/Node.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/Node.java @@ -26,7 +26,6 @@ import org.key_project.prover.sequent.SequentChangeInfo; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; import org.key_project.util.lookup.Lookup; @@ -72,13 +71,13 @@ public class Node implements Iterable { * a linked list of the locally generated program variables. It extends the list of the parent * node. */ - private ImmutableList localProgVars = ImmutableSLList.nil(); + private ImmutableList localProgVars = ImmutableList.nil(); /** * a linked list of the locally generated function symbols. It extends the list of the parent * node. */ - private ImmutableList localFunctions = ImmutableSLList.nil(); + private ImmutableList localFunctions = ImmutableList.nil(); private boolean closed = false; diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/OpReplacer.java b/key.core/src/main/java/de/uka/ilkd/key/proof/OpReplacer.java index 2401588a5e5..4b6338c6e8d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/OpReplacer.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/OpReplacer.java @@ -16,7 +16,6 @@ import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import static de.uka.ilkd.key.logic.equality.TermLabelsProperty.TERM_LABELS_PROPERTY; @@ -275,7 +274,7 @@ public JTerm replace(JTerm term) { * @return the list of transformed terms. */ public ImmutableList replace(ImmutableList terms) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (final JTerm term : terms) { result = result.append(replace(term)); } @@ -289,7 +288,7 @@ public ImmutableList replace(ImmutableList terms) { * @return the list of transformed terms. */ public ImmutableList replaceInfFlowSpec(ImmutableList terms) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (terms == null) { return result; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/Proof.java b/key.core/src/main/java/de/uka/ilkd/key/proof/Proof.java index 5e1ecaa95ec..e53db1d0916 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/Proof.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/Proof.java @@ -39,7 +39,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.lookup.Lookup; import org.jspecify.annotations.NullMarked; @@ -82,14 +81,14 @@ public class Proof implements ProofObject, Named { /** * list with the open goals of the proof */ - private ImmutableList openGoals = ImmutableSLList.nil(); + private ImmutableList openGoals = ImmutableList.nil(); /** * list with the closed goals of the proof, needed to make pruning in closed branches possible. * If the list needs too much memory, pruning can be disabled via the command line option * "--no-pruning-closed". In this case the list will not be filled. */ - private ImmutableList closedGoals = ImmutableSLList.nil(); + private ImmutableList closedGoals = ImmutableList.nil(); /** * declarations &c, read from a problem file or otherwise @@ -250,7 +249,7 @@ public Proof(String name, JTerm problem, KeyAst.@Nullable Declarations header, InitConfig initConfig) { this(name, JavaDLSequentKit - .createSuccSequent(ImmutableSLList.singleton(new SequentFormula(problem))), + .createSuccSequent(ImmutableList.singleton(new SequentFormula(problem))), initConfig.createTacletIndex(), initConfig.createBuiltInRuleIndex(), initConfig); problemHeader = header; } @@ -509,7 +508,7 @@ public ImmutableList openEnabledGoals() { * @see Goal#isAutomatic() */ private ImmutableList filterEnabledGoals(ImmutableList goals) { - ImmutableList enabledGoals = ImmutableSLList.nil(); + ImmutableList enabledGoals = ImmutableList.nil(); for (Goal g : goals) { if (g.isAutomatic() && !g.isLinked()) { enabledGoals = enabledGoals.prepend(g); @@ -567,7 +566,7 @@ public void closeGoal(Goal goalToClose) { if (b) { // For the moment it is necessary to fire the message ALWAYS // in order to detect branch closing. - fireProofGoalsAdded(ImmutableSLList.nil()); + fireProofGoalsAdded(ImmutableList.nil()); } } @@ -680,7 +679,7 @@ public void setStepIndices() { } void removeOpenGoals(Collection toBeRemoved) { - ImmutableList newGoalList = ImmutableSLList.nil(); + ImmutableList newGoalList = ImmutableList.nil(); for (Goal openGoal : openGoals()) { if (!toBeRemoved.contains(openGoal.node())) { newGoalList = newGoalList.append(openGoal); @@ -697,7 +696,7 @@ void removeOpenGoals(Collection toBeRemoved) { * @param toBeRemoved the goals to remove */ void removeClosedGoals(Collection toBeRemoved) { - ImmutableList newGoalList = ImmutableSLList.nil(); + ImmutableList newGoalList = ImmutableList.nil(); for (Goal closedGoal : closedGoals) { if (!toBeRemoved.contains(closedGoal.node())) { newGoalList = newGoalList.prepend(closedGoal); @@ -881,7 +880,7 @@ protected void fireProofGoalsAdded(ImmutableList goals) { * fires the event that new goals have been added to the list of goals */ protected void fireProofGoalsAdded(Goal goal) { - fireProofGoalsAdded(ImmutableSLList.nil().prepend(goal)); + fireProofGoalsAdded(ImmutableList.nil().prepend(goal)); } @@ -1039,7 +1038,7 @@ public ImmutableList getClosedSubtreeGoals(Node node) { * @return the goals below node that are contained in fromGoals */ private static ImmutableList getGoalsBelow(Node node, ImmutableList fromGoals) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); List leaves = node.getLeaves(); for (final Goal goal : fromGoals) { // if list contains node, remove it to make the list faster later diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/ProofPruner.java b/key.core/src/main/java/de/uka/ilkd/key/proof/ProofPruner.java index 03f8f392add..bcde7e60845 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/ProofPruner.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/ProofPruner.java @@ -13,7 +13,6 @@ import de.uka.ilkd.key.settings.GeneralSettings; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * This class is responsible for pruning a proof tree at a certain cutting point. It has been @@ -161,7 +160,7 @@ private void refreshGoal(Goal goal, Node node) { } private ImmutableList cut(Node node) { - ImmutableList children = ImmutableSLList.nil(); + ImmutableList children = ImmutableList.nil(); Iterator it = node.childrenIterator(); while (it.hasNext()) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/ProofTreeEvent.java b/key.core/src/main/java/de/uka/ilkd/key/proof/ProofTreeEvent.java index cd6c5fac8a8..d9d41e21591 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/ProofTreeEvent.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/ProofTreeEvent.java @@ -4,7 +4,6 @@ package de.uka.ilkd.key.proof; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Encapsulates information describing changes to a proof tree, and used to notify proof tree @@ -16,7 +15,7 @@ public class ProofTreeEvent { private final Proof source; private Node node; private Goal goal; - private ImmutableList goals = ImmutableSLList.nil(); + private ImmutableList goals = ImmutableList.nil(); /** * Create ProofTreeEvent for an event that happens at the specified node. diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/RuleAppIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/RuleAppIndex.java index 08ab2f2e798..3f1b465cc8d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/RuleAppIndex.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/RuleAppIndex.java @@ -16,7 +16,6 @@ import org.key_project.prover.sequent.SequentChangeInfo; import org.key_project.prover.strategy.NewRuleListener; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; @@ -146,7 +145,7 @@ public void setNewRuleListener(@Nullable NewRuleListener l) { public ImmutableList getTacletAppAt(TacletFilter filter, PosInOccurrence pos, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (!autoMode) { result = result.prepend(interactiveTacletAppIndex.getTacletAppAt(pos, filter, services)); @@ -169,7 +168,7 @@ public ImmutableList getTacletAppAt(TacletFilter filter, public ImmutableList getTacletAppAtAndBelow(TacletFilter filter, PosInOccurrence pos, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (!autoMode) { result = result.prepend( interactiveTacletAppIndex.getTacletAppAtAndBelow(pos, filter, services)); @@ -189,7 +188,7 @@ public ImmutableList getTacletAppAtAndBelow(TacletFilter filter, */ public ImmutableList getFindTaclet(TacletFilter filter, PosInOccurrence pos) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (!autoMode) { result = result.prepend(interactiveTacletAppIndex.getFindTaclet(pos, filter)); } @@ -206,7 +205,7 @@ public ImmutableList getFindTaclet(TacletFilter filter, * @return list of all possible instantiations */ public ImmutableList getNoFindTaclet(TacletFilter filter, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (!autoMode) { result = interactiveTacletAppIndex.getNoFindTaclet(filter, services); } @@ -225,7 +224,7 @@ public ImmutableList getNoFindTaclet(TacletFilter filter, Servic */ public ImmutableList getRewriteTaclet(TacletFilter filter, PosInOccurrence pos) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (!autoMode) { result = result.prepend(interactiveTacletAppIndex.getRewriteTaclet(pos, filter)); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/SingleThreadedTacletIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/SingleThreadedTacletIndex.java index 117d5339685..94692083f14 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/SingleThreadedTacletIndex.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/SingleThreadedTacletIndex.java @@ -13,7 +13,6 @@ import org.key_project.prover.proof.rulefilter.RuleFilter; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -67,7 +66,7 @@ public TacletIndex copy() { protected ImmutableList matchTaclets( @NonNull ImmutableList tacletApps, RuleFilter p_filter, PosInOccurrence pos, LogicServices services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (final NoPosTacletApp tacletApp : tacletApps) { if (!p_filter.filter(tacletApp.taclet())) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/TacletAppIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/TacletAppIndex.java index 659999ce94c..c0af745aa09 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/TacletAppIndex.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/TacletAppIndex.java @@ -21,7 +21,6 @@ import org.key_project.prover.sequent.SequentChangeInfo; import org.key_project.prover.strategy.NewRuleListener; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -208,7 +207,7 @@ public ImmutableList getTacletAppAt( */ static ImmutableList createTacletApps(ImmutableList tacletInsts, PosInOccurrence pos, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (NoPosTacletApp tacletApp : tacletInsts) { if (tacletApp.taclet() instanceof FindTaclet) { PosTacletApp newTacletApp = tacletApp.setPosInOccurrence(pos, services); @@ -257,7 +256,7 @@ public ImmutableList getRewriteTaclet( final Iterator it = getFindTaclet(pos, filter).iterator(); - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); while (it.hasNext()) { final NoPosTacletApp tacletApp = it.next(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java index 06acc82b424..9f17b55354a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java @@ -30,7 +30,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -65,7 +64,7 @@ public abstract class TacletIndex implements RuleIndex { /** * contains NoFind-Taclets */ - protected ImmutableList noFindList = ImmutableSLList.nil(); + protected ImmutableList noFindList = ImmutableList.nil(); /** * keeps track of no pos taclet apps with partial instantiations @@ -86,7 +85,7 @@ public abstract class TacletIndex implements RuleIndex { rwList = new LinkedHashMap<>(); antecList = new LinkedHashMap<>(); succList = new LinkedHashMap<>(); - noFindList = ImmutableSLList.nil(); + noFindList = ImmutableList.nil(); addTaclets(toNoPosTacletApp(tacletSet)); } @@ -147,7 +146,7 @@ private void insertToMap(NoPosTacletApp tacletApp, Object indexObj = getIndexObj((FindTaclet) tacletApp.taclet()); ImmutableList opList = map.get(indexObj); opList = Objects.requireNonNullElseGet(opList, - ImmutableSLList::nil).prepend(tacletApp); + ImmutableList::nil).prepend(tacletApp); map.put(indexObj, opList); } @@ -177,7 +176,7 @@ public void addTaclets(Iterable tacletAppList) { } public static ImmutableSet toNoPosTacletApp(Iterable rule) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (Taclet t : rule) { result = result.prepend(NoPosTacletApp.createNoPosTacletApp(t)); } @@ -314,7 +313,7 @@ protected abstract ImmutableList matchTaclets( private ImmutableList getJavaTacletList( HashMap> map, ProgramElement pe, PrefixOccurrences prefixOccurrences) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); if (pe instanceof ProgramPrefix nt) { int next = prefixOccurrences.occurred(pe); if (next < nt.getChildCount()) { @@ -334,7 +333,7 @@ private ImmutableList getListHelp( final HashMap> map, final JTerm term, final boolean ignoreUpdates, final PrefixOccurrences prefixOccurrences) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); final Operator op = term.op(); assert !(op instanceof Metavariable) @@ -636,7 +635,7 @@ public int occurred(ProgramElement pe) { */ public ImmutableList getList( HashMap> map) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (int i = 0; i < PREFIXTYPES; i++) { if (occurred[i]) { ImmutableList inMap = map.get(prefixClasses[i]); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndex.java index da13b1ec7f1..5b744155c9a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndex.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndex.java @@ -78,7 +78,7 @@ private static ImmutableList getRewriteTaclet( private static ImmutableList getFindTaclet( PosInOccurrence pos, RuleFilter filter, Services services, TacletIndex tacletIndex) { - ImmutableList tacletInsts = ImmutableSLList.nil(); + ImmutableList tacletInsts = ImmutableList.nil(); if (pos.isTopLevel()) { if (pos.isInAntec()) { tacletInsts = tacletInsts.prepend(antecTaclet(pos, filter, services, tacletIndex)); @@ -503,10 +503,10 @@ private ImmutableList collectTacletApps( PosInOccurrence pos, RuleFilter p_filter, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); final ImmutableList>> allTacletsHereAndBelow = - collectAllTacletAppsHereAndBelow(pos, ImmutableSLList.nil()); + collectAllTacletAppsHereAndBelow(pos, ImmutableList.nil()); for (final Pair> pair : allTacletsHereAndBelow) { result = convert(pair.second, pair.first, p_filter, result, services); @@ -526,7 +526,7 @@ void reportTacletApps(PosInOccurrence pos, NewRuleListener listener) { final ImmutableList>> result = - ImmutableSLList.nil(); + ImmutableList.nil(); final ImmutableList>> allTacletsHereAndBelow = collectAllTacletAppsHereAndBelow(pos, result); @@ -568,7 +568,7 @@ private ImmutableList>> coll */ private void reportTacletApps(PIOPathIterator pathToModification, NewRuleListener listener) { final ImmutableList>> allTacletsHereAndBelow = - collectAllTacletAppsAffectedByModification(pathToModification, ImmutableSLList.nil()); + collectAllTacletAppsAffectedByModification(pathToModification, ImmutableList.nil()); for (final Pair> pair : allTacletsHereAndBelow) { fireRulesAdded(listener, pair.second, pair.first); @@ -633,7 +633,7 @@ private static void fireRulesAdded(NewRuleListener listener, */ public static ImmutableList filter(RuleFilter p_filter, ImmutableList taclets) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (final NoPosTacletApp app : taclets) { if (p_filter.filter(app.taclet())) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndexCacheSet.java b/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndexCacheSet.java index 356604b8044..f2d00e68ac1 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndexCacheSet.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndexCacheSet.java @@ -17,7 +17,6 @@ import org.key_project.prover.rules.Taclet; import org.key_project.util.LRUCache; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Cache that is used for accelerating TermTacletAppIndex. Basically, this is a mapping @@ -91,7 +90,7 @@ public void putIndexForTerm(Term t, TermTacletAppIndex index) {} * cache for locations that are below updates, but not below programs or in the scope of binders */ private final ITermTacletAppIndexCache belowUpdateCacheEmptyPrefix = - new BelowUpdateCache(ImmutableSLList.nil()); + new BelowUpdateCache(ImmutableList.nil()); /** * cache for locations that are below programs, but not in the scope of binders @@ -111,12 +110,12 @@ public void putIndexForTerm(Term t, TermTacletAppIndex index) {} public TermTacletAppIndexCacheSet(Map cache) { assert cache != null; this.cache = cache; - antecCache = new TopLevelCache(ImmutableSLList.nil(), cache); - succCache = new TopLevelCache(ImmutableSLList.nil(), cache); + antecCache = new TopLevelCache(ImmutableList.nil(), cache); + succCache = new TopLevelCache(ImmutableList.nil(), cache); topLevelCacheEmptyPrefix = - new TopLevelCache(ImmutableSLList.nil(), cache); + new TopLevelCache(ImmutableList.nil(), cache); belowProgCacheEmptyPrefix = - new BelowProgCache(ImmutableSLList.nil(), cache); + new BelowProgCache(ImmutableList.nil(), cache); } //////////////////////////////////////////////////////////////////////////// diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/calculus/Semisequent.java b/key.core/src/main/java/de/uka/ilkd/key/proof/calculus/Semisequent.java index 06fe0890cb0..f1c78daa2a9 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/calculus/Semisequent.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/calculus/Semisequent.java @@ -8,7 +8,6 @@ import org.key_project.prover.sequent.SemisequentChangeInfo; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; class Semisequent extends org.key_project.prover.sequent.Semisequent { @@ -63,7 +62,7 @@ public SemisequentChangeInfo insert(int idx, SequentFormula sequentFormula) { @Override public SemisequentChangeInfo insertFirst(SequentFormula sequentFormula) { final SemisequentChangeInfo sci = new SemisequentChangeInfo( - ImmutableSLList.singleton(sequentFormula)); + ImmutableList.singleton(sequentFormula)); sci.addedFormula(0, sequentFormula); return sci; } @@ -117,7 +116,7 @@ public int size() { */ @Override public SemisequentChangeInfo remove(int idx) { - return new SemisequentChangeInfo(ImmutableSLList.nil()); + return new SemisequentChangeInfo(ImmutableList.nil()); } /** diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/calculus/Sequent.java b/key.core/src/main/java/de/uka/ilkd/key/proof/calculus/Sequent.java index 390312095ca..842231849cc 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/calculus/Sequent.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/calculus/Sequent.java @@ -8,7 +8,6 @@ import org.key_project.prover.sequent.Semisequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -42,7 +41,7 @@ public boolean isEmpty() { @Override public @NonNull Iterator iterator() { - return ImmutableSLList.nil().iterator(); + return ImmutableList.nil().iterator(); } }; diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/delayedcut/DelayedCutProcessor.java b/key.core/src/main/java/de/uka/ilkd/key/proof/delayedcut/DelayedCutProcessor.java index 81d3d85e74a..2017a0c2e5e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/delayedcut/DelayedCutProcessor.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/delayedcut/DelayedCutProcessor.java @@ -24,7 +24,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** *

@@ -434,7 +433,7 @@ private int add(LinkedList pairs, LinkedList openLea * This function uncovers the decision predicate that is hidden after applying the cut rule. */ private void uncoverDecisionPredicate(DelayedCut cut, List openLeaves) { - ImmutableList list = ImmutableSLList.nil(); + ImmutableList list = ImmutableList.nil(); for (NodeGoalPair pair : openLeaves) { list = list.append(new NodeGoalPair(pair.node, pair.goal.apply(cut.getHideApp()).head())); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractOperationPO.java b/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractOperationPO.java index 1ea6eb95518..c2a5305e33e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractOperationPO.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractOperationPO.java @@ -36,7 +36,6 @@ import org.key_project.logic.op.Function; import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import com.github.javaparser.ast.key.KeyTransactionStatement; @@ -779,7 +778,7 @@ protected JTerm createUninterpretedPredicate(ImmutableList for JTerm exceptionVar, String name, Services services) { // Create parameters for predicate // SETAccumulate(HeapSort, MethodParameter1Sort, ... MethodParameterNSort) - ImmutableList arguments = ImmutableSLList.nil(); // tb.var(paramVars); + ImmutableList arguments = ImmutableList.nil(); // tb.var(paramVars); // Method parameters for (LocationVariable formalParam : formalParamVars) { arguments = arguments.prepend(tb.var(formalParam)); @@ -1005,7 +1004,7 @@ protected boolean isCopyOfMethodArgumentsUsed() { private ImmutableList createFormalParamVars( final ImmutableList paramVars, final Services proofServices) { // create arguments from formal parameters for method call - ImmutableList formalParamVars = ImmutableSLList.nil(); + ImmutableList formalParamVars = ImmutableList.nil(); for (final LocationVariable paramVar : paramVars) { if (isCopyOfMethodArgumentsUsed()) { ProgramElementName pen = new ProgramElementName("_" + paramVar.name()); @@ -1023,7 +1022,7 @@ private ImmutableList createFormalParamVars( private ImmutableList collectLookupContracts( final IProgramMethod pm, final Services proofServices) { ImmutableList lookupContracts = - ImmutableSLList.nil(); + ImmutableList.nil(); ImmutableSet cs = proofServices.getSpecificationRepository() .getOperationContracts(getCalleeKeYJavaType(), pm); for (KeYJavaType superType : proofServices.getJavaInfo() diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractPO.java b/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractPO.java index 054ff20a142..82f8be9c396 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractPO.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractPO.java @@ -28,7 +28,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -301,7 +300,7 @@ private void registerClassAxiomTaclets(KeYJavaType selfKJT, InitConfig proofConf ImmutableList> scc = allSCCs.get(node); for (Taclet axiomTaclet : axiom.getTaclets( DefaultImmutableSet.fromImmutableList( - scc == null ? ImmutableSLList.nil() : scc), + scc == null ? ImmutableList.nil() : scc), proofConfig.getServices())) { assert axiomTaclet != null : "class axiom returned null taclet: " + axiom.getName(); // only include if choices are appropriate @@ -354,7 +353,7 @@ private void getSCCForNode(final Vertex node, ImmutableSet axioms, if (node.index == node.lowLink) { ImmutableList> scc = - ImmutableSLList.nil(); + ImmutableList.nil(); Vertex sccMember; do { sccMember = stack.pop(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractProfile.java b/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractProfile.java index 98eef285de0..dfaa6ef20ec 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractProfile.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractProfile.java @@ -22,7 +22,6 @@ import org.key_project.prover.engine.GoalChooserFactory; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -98,7 +97,7 @@ protected ImmutableSet getStrategyFactories() { } protected ImmutableList initBuiltInRules() { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/init/FunctionalOperationContractPO.java b/key.core/src/main/java/de/uka/ilkd/key/proof/init/FunctionalOperationContractPO.java index dc5609ac994..26443596f7c 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/init/FunctionalOperationContractPO.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/init/FunctionalOperationContractPO.java @@ -32,7 +32,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -166,7 +165,7 @@ protected ImmutableList buildOperationBlocks( result[1] = new StatementBlock(call); } assert result[1] != null : "null body in method"; - return ImmutableSLList.nil().prepend(result); + return ImmutableList.nil().prepend(result); } /** diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/init/InitConfig.java b/key.core/src/main/java/de/uka/ilkd/key/proof/init/InitConfig.java index ba9216516f1..42a4714bdc9 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/init/InitConfig.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/init/InitConfig.java @@ -31,7 +31,6 @@ import org.key_project.prover.rules.RuleSet; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -52,7 +51,7 @@ public class InitConfig { private RuleJustificationInfo justifInfo = new RuleJustificationInfo(); - private ImmutableList taclets = ImmutableSLList.nil(); + private ImmutableList taclets = ImmutableList.nil(); /** * maps categories to their default choice (both represented as Strings), which is used if no @@ -189,7 +188,7 @@ public void setActivatedChoices(ImmutableSet activatedChoices) { c2DC.remove(c.category()); } - ImmutableList category2DefaultChoiceList = ImmutableSLList.nil(); + ImmutableList category2DefaultChoiceList = ImmutableList.nil(); for (final String s : c2DC.values()) { final Choice c = choiceNS().lookup(new Name(s)); if (c != null) { @@ -279,7 +278,7 @@ private void fillActiveTacletCache() { */ public ImmutableList builtInRules() { Profile profile = getProfile(); - return (profile == null ? ImmutableSLList.nil() + return (profile == null ? ImmutableList.nil() : profile.getStandardRules().standardBuiltInRules()); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/init/JavaProfile.java b/key.core/src/main/java/de/uka/ilkd/key/proof/init/JavaProfile.java index 267f4176035..a62ebea84c1 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/init/JavaProfile.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/init/JavaProfile.java @@ -25,7 +25,6 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -97,11 +96,11 @@ private JavaProfile(boolean perms) { @Override protected ImmutableList computeTermLabelConfiguration() { ImmutableList originTermLabelPolicyList = - ImmutableSLList.nil().append(new OriginTermLabelPolicy()); + ImmutableList.nil().append(new OriginTermLabelPolicy()); ImmutableList originTermLabelRefactorings = - ImmutableSLList.nil().append(new OriginTermLabelRefactoring()); + ImmutableList.nil().append(new OriginTermLabelRefactoring()); - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); result = result.prepend(new TermLabelConfiguration(ParameterlessTermLabel.ANON_HEAP_LABEL_NAME, new SingletonLabelFactory<>(ParameterlessTermLabel.ANON_HEAP_LABEL))); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/init/ProofInitServiceUtil.java b/key.core/src/main/java/de/uka/ilkd/key/proof/init/ProofInitServiceUtil.java index 9612b5f0fd4..4bb7f6ba239 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/init/ProofInitServiceUtil.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/init/ProofInitServiceUtil.java @@ -9,7 +9,6 @@ import java.util.ServiceConfigurationError; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.reflection.ClassLoaderUtil; /** @@ -48,7 +47,7 @@ private ProofInitServiceUtil() { * @return The available {@link POExtension}s. */ public static ImmutableList getOperationPOExtension(ProofOblInput po) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (POExtension extension : poExtensions) { if (extension.isPOSupported(po)) { result = result.prepend(extension); @@ -63,7 +62,7 @@ public static ImmutableList getOperationPOExtension(ProofOblInput p * @return The available {@link POExtension}s. */ private static ImmutableList createOperationPOExtension() { - ImmutableList extensions = ImmutableSLList.nil(); + ImmutableList extensions = ImmutableList.nil(); Iterator iter = ClassLoaderUtil.loadServices(POExtension.class).iterator(); while (iter.hasNext()) { try { diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediatePresentationProofFileParser.java b/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediatePresentationProofFileParser.java index a5cec77b332..09bb18f4856 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediatePresentationProofFileParser.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediatePresentationProofFileParser.java @@ -16,7 +16,6 @@ import org.key_project.logic.Name; import org.key_project.logic.PosInTerm; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; /** @@ -173,14 +172,14 @@ public void beginExpr(ProofElementID eid, String str) { case ASSUMES_INST_BUILT_IN -> { // ifInst (for built in rules) BuiltinRuleInformation builtinInfo = (BuiltinRuleInformation) ruleInfo; if (builtinInfo.builtinIfInsts == null) { - builtinInfo.builtinIfInsts = ImmutableSLList.nil(); + builtinInfo.builtinIfInsts = ImmutableList.nil(); } builtinInfo.currIfInstFormula = 0; builtinInfo.currIfInstPosInTerm = PosInTerm.getTopLevel(); } case NEW_NAMES -> { final String[] newNames = str.split(","); - ruleInfo.currNewNames = ImmutableSLList.nil(); + ruleInfo.currNewNames = ImmutableList.nil(); for (String newName : newNames) { ruleInfo.currNewNames = ruleInfo.currNewNames.append(new Name(newName)); } @@ -372,8 +371,8 @@ public boolean isBuiltinInfo() { private static class TacletInformation extends RuleInformation { /* + Taclet Information */ protected List loadedInsts = null; - protected ImmutableList ifSeqFormulaList = ImmutableSLList.nil(); - protected ImmutableList ifDirectFormulaList = ImmutableSLList.nil(); + protected ImmutableList ifSeqFormulaList = ImmutableList.nil(); + protected ImmutableList ifDirectFormulaList = ImmutableList.nil(); public TacletInformation(String ruleName) { super(ruleName); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java b/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java index dc42cc8ec19..493e812468d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java @@ -67,7 +67,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -508,7 +507,7 @@ private TacletApp constructTacletApp(TacletAppIntermediate currInterm, Goal curr ourApp = constructInsts(ourApp, currGoal, currInterm.getInsts(), services); - ImmutableList ifFormulaList = ImmutableSLList.nil(); + ImmutableList ifFormulaList = ImmutableList.nil(); for (String ifFormulaStr : currInterm.getIfSeqFormulaList()) { ifFormulaList = ifFormulaList @@ -587,7 +586,7 @@ private IBuiltInRuleApp constructBuiltinApp(BuiltInAppIntermediate currInterm, G // Load ifInsts, if applicable if (currInterm.getBuiltInIfInsts() != null) { - builtinIfInsts = ImmutableSLList.nil(); + builtinIfInsts = ImmutableList.nil(); for (final Pair ifInstP : currInterm.getBuiltInIfInsts()) { final int currIfInstFormula = ifInstP.first; final PosInTerm currIfInstPosInTerm = ifInstP.second; @@ -828,7 +827,7 @@ private MergeRuleBuiltInRuleApp instantiateJoinApp(final MergeAppIntermediate jo } - ImmutableList joinPartners = ImmutableSLList.nil(); + ImmutableList joinPartners = ImmutableList.nil(); for (PartnerNode partnerNodeInfo : partnerNodesInfo) { SymbolicExecutionStateWithProgCnt ownSEState = diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinProcessor.java b/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinProcessor.java index 4008f750ee0..221d2c24fe4 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinProcessor.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinProcessor.java @@ -26,7 +26,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** *

@@ -106,7 +105,7 @@ private void processJoin() { orRight(result); - ImmutableList list = ImmutableSLList.nil(); + ImmutableList list = ImmutableList.nil(); for (NodeGoalPair pair : cut.getGoalsAfterUncovering()) { if (pair.node == partner.getNode(0) || pair.node == partner.getNode(1)) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/ProofCorrectnessMgt.java b/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/ProofCorrectnessMgt.java index 7c30b3c697f..41ee259f925 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/ProofCorrectnessMgt.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/ProofCorrectnessMgt.java @@ -21,7 +21,6 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.slf4j.Logger; @@ -98,7 +97,7 @@ public boolean isContractApplicable(Contract contract) { // initial paths ImmutableSet> newPaths = DefaultImmutableSet.nil(); for (Contract c : contractsToBeApplied) { - newPaths = newPaths.add(ImmutableSLList.nil().prepend(c)); + newPaths = newPaths.add(ImmutableList.nil().prepend(c)); } // look for cycles diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java b/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java index 455e5a2a48f..474dea26701 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java @@ -164,7 +164,7 @@ private static Taclet getLimitedToUnlimitedTaclet(IObserverFunction limited, tacletBuilder.setFind(limitedTerm); tacletBuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), unlimitedTerm)); + ImmutableList.nil(), unlimitedTerm)); tacletBuilder.setName( MiscTools.toValidTacletName("unlimit " + getUniqueNameForObserver(unlimited))); return tacletBuilder.getTaclet(); @@ -190,9 +190,9 @@ private static Taclet getUnlimitedToLimitedTaclet(IObserverFunction limited, tacletBuilder.setFind(tb.func(unlimited, subs)); final SequentFormula cf = new SequentFormula(tb.equals(limitedTerm, unlimitedTerm)); final Sequent addedSeq = - JavaDLSequentKit.createAnteSequent(ImmutableSLList.singleton(cf)); + JavaDLSequentKit.createAnteSequent(ImmutableList.singleton(cf)); tacletBuilder.addTacletGoalTemplate(new RewriteTacletGoalTemplate(addedSeq, - ImmutableSLList.nil(), tb.func(unlimited, subs))); + ImmutableList.nil(), tb.func(unlimited, subs))); tacletBuilder.setApplicationRestriction( new ApplicationRestriction(ApplicationRestriction.IN_SEQUENT_STATE)); tacletBuilder.setName( @@ -259,7 +259,7 @@ protected IObserverFunction getCanonicalFormForKJT(IObserverFunction obs, KeYJav private ImmutableSet> getOverridingMethods(KeYJavaType kjt, IProgramMethod pm) { - ImmutableList> result = ImmutableSLList.nil(); + ImmutableList> result = ImmutableList.nil(); // static methods and constructors are not overriden if (pm.isConstructor() || pm.isStatic()) { @@ -895,23 +895,23 @@ public ImmutableSet getClassAxioms(KeYJavaType selfKjt) { final ClassAxiom invRepresentsAxiom = new RepresentsAxiom("Class invariant axiom for " + kjt.getFullName(), invSymbol, - kjt, new Private(), null, invDef, selfVar, ImmutableSLList.nil(), null); + kjt, new Private(), null, invDef, selfVar, ImmutableList.nil(), null); result = result.add(invRepresentsAxiom); final ClassAxiom staticInvRepresentsAxiom = new RepresentsAxiom( "Static class invariant axiom for " + kjt.getFullName(), staticInvSymbol, kjt, - new Private(), null, staticInvDef, null, ImmutableSLList.nil(), null); + new Private(), null, staticInvDef, null, ImmutableList.nil(), null); result = result.add(staticInvRepresentsAxiom); final ClassAxiom invFreeRepresentsAxiom = new RepresentsAxiom( "Free class invariant axiom for " + kjt.getFullName(), freeInvSymbol, kjt, - new Private(), null, freeInvDef, selfVar, ImmutableSLList.nil(), null); + new Private(), null, freeInvDef, selfVar, ImmutableList.nil(), null); result = result.add(invFreeRepresentsAxiom); final ClassAxiom staticFreeInvRepresentsAxiom = new RepresentsAxiom( "Free static class invariant axiom for " + kjt.getFullName(), freeStaticInvSymbol, kjt, new Private(), null, freeStaticInvDef, null, - ImmutableSLList.nil(), null); + ImmutableList.nil(), null); result = result.add(staticFreeInvRepresentsAxiom); } @@ -965,7 +965,7 @@ private ImmutableSet getModelMethodAxioms() { // We need to construct an inheritance chain of contracts // starting at the bottom ImmutableList lookupContracts = - ImmutableSLList.nil(); + ImmutableList.nil(); ImmutableSet cs = getOperationContracts(kjt, pm); List superTypes = services.getJavaInfo().getAllSupertypes(kjt); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeChangeJournal.java b/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeChangeJournal.java index faacdc59d9a..4bc0e480f2a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeChangeJournal.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeChangeJournal.java @@ -17,7 +17,6 @@ import org.key_project.util.collection.ImmutableList; import org.key_project.util.collection.ImmutableMap; import org.key_project.util.collection.ImmutableMapEntry; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -56,7 +55,7 @@ public NodeChangeJournal(Proof p_proof, Goal p_goal) { * listeners */ public RuleAppInfo getRuleAppInfo(RuleApp p_ruleApp) { - ImmutableList nrs = ImmutableSLList.nil(); + ImmutableList nrs = ImmutableList.nil(); for (final ImmutableMapEntry entry : changes) { final Node newNode = entry.key(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeChangesHolder.java b/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeChangesHolder.java index 2f238d22737..920d2dc63b6 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeChangesHolder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeChangesHolder.java @@ -5,14 +5,13 @@ import org.key_project.prover.sequent.SequentChangeInfo; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; public class NodeChangesHolder { public ImmutableList scis; NodeChangesHolder() { - this(ImmutableSLList.nil()); + this(ImmutableList.nil()); } NodeChangesHolder( diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeReplacement.java b/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeReplacement.java index f718fd79bcb..ecbcbb2b1fa 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeReplacement.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeReplacement.java @@ -16,7 +16,6 @@ import org.key_project.prover.sequent.SequentChangeInfo; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -178,7 +177,7 @@ private void addNodeChange(NodeChange p_nc) { private void removeNodeChanges(SequentFormula p_cf, boolean p_inAntec) { Iterator it = changes.iterator(); - changes = ImmutableSLList.nil(); + changes = ImmutableList.nil(); NodeChange oldNC; PosInOccurrence oldPio; @@ -205,7 +204,7 @@ public Node getNode() { */ public Iterator getNodeChanges() { if (changes == null) { - changes = ImmutableSLList.nil(); + changes = ImmutableList.nil(); addNodeChanges(); } return changes.iterator(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/replay/AbstractProofReplayer.java b/key.core/src/main/java/de/uka/ilkd/key/proof/replay/AbstractProofReplayer.java index 9ced2d960cf..e5817e32ee8 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/proof/replay/AbstractProofReplayer.java +++ b/key.core/src/main/java/de/uka/ilkd/key/proof/replay/AbstractProofReplayer.java @@ -35,7 +35,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -122,7 +121,7 @@ private IBuiltInRuleApp constructBuiltinApp(Node originalStep, Goal currGoal) } // Load ifInsts, if applicable - builtinIfInsts = ImmutableSLList.nil(); + builtinIfInsts = ImmutableList.nil(); for (PosInOccurrence oldFormulaPio : RuleAppUtil .assumesInstantiationsOfRuleApp(originalStep.getAppliedRuleApp(), originalStep)) { PosInOccurrence newFormula = @@ -266,7 +265,7 @@ private TacletApp constructTacletApp(Node originalStep, Goal currGoal) { ourApp = IntermediateProofReplayer.constructInsts(ourApp, currGoal, getInterestingInstantiations(instantantions), services); - ImmutableList ifFormulaList = ImmutableSLList.nil(); + ImmutableList ifFormulaList = ImmutableList.nil(); List> oldFormulas = RuleAppUtil .assumesInstantiationsOfRuleApp(originalTacletApp, originalStep) .stream() diff --git a/key.core/src/main/java/de/uka/ilkd/key/prover/impl/ApplyStrategy.java b/key.core/src/main/java/de/uka/ilkd/key/prover/impl/ApplyStrategy.java index d8cc79a0ab5..1561a8033d4 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/prover/impl/ApplyStrategy.java +++ b/key.core/src/main/java/de/uka/ilkd/key/prover/impl/ApplyStrategy.java @@ -17,7 +17,6 @@ import org.key_project.prover.engine.impl.DefaultProver; import org.key_project.prover.rules.RuleApp; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; @@ -78,7 +77,7 @@ private void init(Proof newProof, ImmutableList goals, int maxSteps, long */ @Override public synchronized ApplyStrategyInfo start(Proof proof, Goal goal) { - return start(proof, ImmutableSLList.nil().prepend(goal)); + return start(proof, ImmutableList.nil().prepend(goal)); } /* @@ -244,7 +243,7 @@ public void clear() { final GoalChooser goalChooser = getGoalChooserForProof(proof); proof = null; if (goalChooser != null) { - goalChooser.init(null, ImmutableSLList.nil()); + goalChooser.init(null, ImmutableList.nil()); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/prover/impl/DefaultGoalChooser.java b/key.core/src/main/java/de/uka/ilkd/key/prover/impl/DefaultGoalChooser.java index 32631f67804..d2aad495f14 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/prover/impl/DefaultGoalChooser.java +++ b/key.core/src/main/java/de/uka/ilkd/key/prover/impl/DefaultGoalChooser.java @@ -13,7 +13,6 @@ import org.key_project.prover.engine.GoalChooser; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -71,9 +70,9 @@ public void init(@Nullable Proof p_proof, @Nullable ImmutableList p_goals) } protected void setupGoals(ImmutableList p_goals) { - goalList = ImmutableSLList.nil(); - selectedList = ImmutableSLList.nil(); - nextGoals = ImmutableSLList.nil(); + goalList = ImmutableList.nil(); + selectedList = ImmutableList.nil(); + nextGoals = ImmutableList.nil(); if (allGoalsSatisfiable) { goalList = p_goals; @@ -151,7 +150,7 @@ public void proofPruned(ProofTreeEvent e) { */ public void removeGoal(Goal goal) { selectedList = selectedList.removeAll(goal); - nextGoals = ImmutableSLList.nil(); + nextGoals = ImmutableList.nil(); if (selectedList.isEmpty()) { setupGoals(goalList); @@ -176,7 +175,7 @@ public void updateGoalList(@Nullable Object node, @NonNull ImmutableList n if (proof.openGoals().isEmpty()) // proof has been closed { - nextGoals = selectedList = goalList = ImmutableSLList.nil(); + nextGoals = selectedList = goalList = ImmutableList.nil(); } else { if (selectedList.isEmpty() || (currentSubtreeRoot != null && !isSatisfiableSubtree(currentSubtreeRoot))) { @@ -186,10 +185,10 @@ public void updateGoalList(@Nullable Object node, @NonNull ImmutableList n } protected void updateGoalListHelp(Object node, ImmutableList newGoals) { - ImmutableList prevGoalList = ImmutableSLList.nil(); + ImmutableList prevGoalList = ImmutableList.nil(); boolean newGoalsInserted = false; - nextGoals = ImmutableSLList.nil(); + nextGoals = ImmutableList.nil(); // Remove "node" and goals contained within "newGoals" while (!selectedList.isEmpty()) { @@ -233,7 +232,7 @@ protected ImmutableList insertNewGoals(ImmutableList newGoals, protected static ImmutableList rotateList(ImmutableList p_list) { if (p_list.isEmpty()) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } return p_list.tail().append(p_list.head()); @@ -242,7 +241,7 @@ protected static ImmutableList rotateList(ImmutableList p_list) { protected void removeClosedGoals() { boolean changed = false; Iterator it = goalList.iterator(); - goalList = ImmutableSLList.nil(); + goalList = ImmutableList.nil(); while (it.hasNext()) { final Goal goal = it.next(); @@ -254,7 +253,7 @@ protected void removeClosedGoals() { } it = selectedList.iterator(); - ImmutableList newList = ImmutableSLList.nil(); + ImmutableList newList = ImmutableList.nil(); while (it.hasNext()) { final Goal goal = it.next(); @@ -271,11 +270,11 @@ protected void removeClosedGoals() { } if (changed) { - nextGoals = ImmutableSLList.nil(); + nextGoals = ImmutableList.nil(); // for "selectedList", order does matter it = newList.iterator(); - selectedList = ImmutableSLList.nil(); + selectedList = ImmutableList.nil(); while (it.hasNext()) { selectedList = selectedList.prepend(it.next()); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/prover/impl/DepthFirstGoalChooser.java b/key.core/src/main/java/de/uka/ilkd/key/prover/impl/DepthFirstGoalChooser.java index d76de6e176b..004e817b6fe 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/prover/impl/DepthFirstGoalChooser.java +++ b/key.core/src/main/java/de/uka/ilkd/key/prover/impl/DepthFirstGoalChooser.java @@ -6,7 +6,6 @@ import de.uka.ilkd.key.proof.Goal; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -69,10 +68,10 @@ protected ImmutableList insertNewGoals(ImmutableList newGoals, @Override protected void updateGoalListHelp(Object node, ImmutableList newGoals) { - ImmutableList prevGoalList = ImmutableSLList.nil(); + ImmutableList prevGoalList = ImmutableList.nil(); boolean newGoalsInserted = false; - nextGoals = ImmutableSLList.nil(); + nextGoals = ImmutableList.nil(); // Remove "node" and goals contained within "newGoals" while (!selectedList.isEmpty()) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBuiltInRuleApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBuiltInRuleApp.java index f91e61cbd05..fd085270929 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBuiltInRuleApp.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBuiltInRuleApp.java @@ -13,7 +13,6 @@ import org.key_project.logic.op.Function; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.NullMarked; @@ -34,7 +33,7 @@ protected AbstractBuiltInRuleApp(T rule, @Nullable PosInOccurrence pio, @Nullable ImmutableList ifInsts) { this.builtInRule = rule; this.pio = pio; - this.ifInsts = (ifInsts == null ? ImmutableSLList.nil() : ifInsts); + this.ifInsts = (ifInsts == null ? ImmutableList.nil() : ifInsts); } protected AbstractBuiltInRuleApp(T rule, @Nullable PosInOccurrence pio) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractContractRuleApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractContractRuleApp.java index eb321b9c927..8a500105b57 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractContractRuleApp.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractContractRuleApp.java @@ -11,7 +11,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.jspecify.annotations.NullMarked; @@ -29,7 +28,7 @@ protected AbstractContractRuleApp(T rule, @Nullable PosInOccurrence pio) { protected AbstractContractRuleApp(T rule, @Nullable PosInOccurrence pio, @Nullable Contract contract) { - this(rule, pio, ImmutableSLList.nil(), contract); + this(rule, pio, ImmutableList.nil(), contract); } protected AbstractContractRuleApp(T rule, diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractLoopInvariantRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractLoopInvariantRule.java index 126ef455d22..b0cbb815e99 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractLoopInvariantRule.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractLoopInvariantRule.java @@ -30,7 +30,6 @@ import org.key_project.prover.rules.RuleApp; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -502,7 +501,7 @@ protected static AdditionalHeapTerms createAdditionalHeapTerms(Services services inst.inv.getFreeModifiable(heap, inst.selfTerm, atPres, services)); } - ImmutableList anonUpdateData = ImmutableSLList.nil(); + ImmutableList anonUpdateData = ImmutableList.nil(); for (LocationVariable heap : heapContext) { // weigl: prevent NPE JTerm modifiableTerm = modifiables.get(heap); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/AuxiliaryContractBuilders.java b/key.core/src/main/java/de/uka/ilkd/key/rule/AuxiliaryContractBuilders.java index d78676170aa..00b8a0cd7ab 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/AuxiliaryContractBuilders.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/AuxiliaryContractBuilders.java @@ -51,10 +51,7 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.ExtList; -import org.key_project.util.collection.DefaultImmutableSet; -import org.key_project.util.collection.ImmutableArray; -import org.key_project.util.collection.ImmutableSLList; -import org.key_project.util.collection.ImmutableSet; +import org.key_project.util.collection.*; import com.github.javaparser.ast.key.KeyTransactionStatement; import org.jspecify.annotations.NonNull; @@ -1359,7 +1356,7 @@ public JTerm setUpValidityGoal(final Goal goal, final JTerm[] updates, JavaBlock newJavaBlock = getJavaBlock(exceptionParameter); JTerm newPost = tb.and(postconditions); newPost = AbstractOperationPO.addAdditionalUninterpretedPredicateIfRequired(services, - newPost, ImmutableSLList.nil() + newPost, ImmutableList.nil() .prependReverse(terms.remembranceLocalVariables.keySet()), terms.exception); if (goal != null) { @@ -1681,7 +1678,7 @@ private JTerm[] createPosts(final Goal goal, final JTerm[] postconditions, final TermBuilder tb) { JTerm post = tb.and(postconditions); post = AbstractOperationPO.addAdditionalUninterpretedPredicateIfRequired(services, post, - ImmutableSLList.nil() + ImmutableList.nil() .prependReverse(terms.remembranceLocalVariables.keySet()), terms.exception); post = TermLabelManager.refactorTerm(termLabelState, services, null, post, rule, goal, @@ -1689,7 +1686,7 @@ private JTerm[] createPosts(final Goal goal, final JTerm[] postconditions, JTerm postNext = tb.and(postconditionsNext); postNext = AbstractOperationPO.addAdditionalUninterpretedPredicateIfRequired(services, - postNext, ImmutableSLList.nil() + postNext, ImmutableList.nil() .prependReverse(terms.remembranceLocalVariables.keySet()), terms.exception); postNext = TermLabelManager.refactorTerm(termLabelState, services, null, postNext, rule, diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/BoundUniquenessChecker.java b/key.core/src/main/java/de/uka/ilkd/key/rule/BoundUniquenessChecker.java index 39bd9329777..9329c7c1a17 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/BoundUniquenessChecker.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/BoundUniquenessChecker.java @@ -13,7 +13,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * The bound uniqueness checker ensures that schemavariables can be bound at most once in the @@ -27,7 +26,7 @@ public class BoundUniquenessChecker { private final HashSet boundVars = new LinkedHashSet<>(); - private ImmutableList terms = ImmutableSLList.nil(); + private ImmutableList terms = ImmutableList.nil(); public BoundUniquenessChecker(Sequent seq) { addAll(seq); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/LoopApplyHeadRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/LoopApplyHeadRule.java index f06a8f78a85..8f760399951 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/LoopApplyHeadRule.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/LoopApplyHeadRule.java @@ -23,7 +23,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -104,7 +103,7 @@ public class LoopApplyHeadRule implements BuiltInRule { new SequentFormula( tb.apply(update, tb.prog(modality.kind(), newJavaBlock, target.sub(0)))), ruleApp.pio); - return ImmutableSLList.nil().append(goal); + return ImmutableList.nil().append(goal); } @Override diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java b/key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java index c04e03ef185..b1379c491b5 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java @@ -45,7 +45,6 @@ import org.key_project.util.LRUCache; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Immutables; import org.jspecify.annotations.NonNull; @@ -80,7 +79,7 @@ public static final class Protocol extends ArrayList { * would not improve prover performance. I tested it for "simplify_literals", "cast_del", and * "evaluate_instanceof"; in any case there was a measurable slowdown. -- DB 03/06/14 */ - private static final ImmutableList ruleSets = ImmutableSLList.nil() + private static final ImmutableList ruleSets = ImmutableList.nil() .append("concrete").append("concrete_java").append("update_elim") .append("update_apply_on_update") .append("update_apply").append("update_join").append("elimQuantifier"); @@ -121,7 +120,7 @@ public OneStepSimplifier() { // Visibility must be public because it is no longe private ImmutableList tacletsForRuleSet(Proof proof, String ruleSetName, ImmutableList excludedRuleSetNames) { assert !proof.openGoals().isEmpty(); - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); // collect apps present in all open goals Set allApps = @@ -190,11 +189,11 @@ private void initIndices(Proof proof) { if (proof != lastProof) { shutdownIndices(); lastProof = proof; - appsTakenOver = ImmutableSLList.nil(); + appsTakenOver = ImmutableList.nil(); indices = new TacletIndex[ruleSets.size()]; notSimplifiableCaches = (Map[]) new LRUCache[indices.length]; int i = 0; - ImmutableList done = ImmutableSLList.nil(); + ImmutableList done = ImmutableList.nil(); for (String ruleSet : ruleSets) { ImmutableList taclets = tacletsForRuleSet(proof, ruleSet, done); indices[i] = TacletIndexKit.getKit().createTacletIndex(taclets); @@ -430,7 +429,7 @@ private RuleApp makeReplaceKnownTacletApp(JTerm formula, inAntecedent); // It is required to create a new PosInOccurrence because formula and // pio.constrainedFormula().formula() are only equals module // renamings and term labels - ImmutableList ifInst = ImmutableSLList.nil(); + ImmutableList ifInst = ImmutableList.nil(); ifInst = ifInst.append(new AssumesFormulaInstDirect(pio.sequentFormula())); TacletApp ta = PosTacletApp.createPosTacletApp(taclet, svi, ifInst, applicatinPIO, lastProof.getServices()); @@ -497,7 +496,7 @@ private Instantiation computeInstantiation(PosInOccurrence ossPIO, new ArrayList<>(seq.size()); // simplify as long as possible - ImmutableList list = ImmutableSLList.nil(); + ImmutableList list = ImmutableList.nil(); SequentFormula simplifiedCf = cf; while (true) { simplifiedCf = simplifyConstrainedFormula(simplifiedCf, ossPIO.isInAntec(), @@ -513,7 +512,7 @@ private Instantiation computeInstantiation(PosInOccurrence ossPIO, PosInOccurrence[] ifInstsArr = ifInsts.toArray(new PosInOccurrence[0]); ImmutableList immutableIfInsts = - ImmutableSLList.nil().append(ifInstsArr); + ImmutableList.nil().append(ifInstsArr); return new Instantiation(list.head(), list.size(), immutableIfInsts); } @@ -619,9 +618,9 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) { ImmutableList ifInsts = ((OneStepSimplifierRuleApp) ruleApp).assumesInsts(); ImmutableList anteFormulas = - ImmutableSLList.nil(); + ImmutableList.nil(); ImmutableList succFormulas = - ImmutableSLList.nil(); + ImmutableList.nil(); if (ifInsts != null) { for (PosInOccurrence it : ifInsts) { if (it.isInAntec()) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/QueryExpand.java b/key.core/src/main/java/de/uka/ilkd/key/rule/QueryExpand.java index 7c9c327582e..f55d47a48c3 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/QueryExpand.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/QueryExpand.java @@ -38,7 +38,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.jspecify.annotations.NonNull; @@ -281,9 +280,9 @@ public JTerm evaluateQueries(Services services, JTerm term, boolean positiveCont final int depth = term.depth(); List qeps = new ArrayList<>(); int[] path = new int[depth]; - final ImmutableSLList instVars; + final ImmutableList instVars; if (allowExpandBelowInstQuantifier) { - instVars = ImmutableSLList.nil(); + instVars = ImmutableList.nil(); } else { instVars = null; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/SyntacticalReplaceVisitor.java b/key.core/src/main/java/de/uka/ilkd/key/rule/SyntacticalReplaceVisitor.java index cb2e99a268b..71b977428d6 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/SyntacticalReplaceVisitor.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/SyntacticalReplaceVisitor.java @@ -32,7 +32,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * visitor for method {@link JTerm#execPostOrder(Visitor)}. Called with that @@ -396,7 +395,7 @@ private ImmutableArray instantiateLabels(JTerm tacletTerm, Operator n } private Operator handleParametricFunction(ParametricFunctionInstance pfi) { - ImmutableList args = ImmutableSLList.nil(); + ImmutableList args = ImmutableList.nil(); for (int i = pfi.getArgs().size() - 1; i >= 0; i--) { args = args.prepend(pfi.getArgs().get(i).instantiate(svInst, services)); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/TacletApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/TacletApp.java index 226512729bd..0a7a41770c8 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/TacletApp.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/TacletApp.java @@ -535,7 +535,7 @@ private TacletApp instantiationHelper(boolean force, Services services) { final TermBuilder tb = services.getTermBuilder(); TacletApp app = this; - ImmutableList proposals = ImmutableSLList.nil(); + ImmutableList proposals = ImmutableList.nil(); for (final SchemaVariable variable : uninstantiatedVars()) { if (!(variable instanceof JOperatorSV operatorSv)) { @@ -847,7 +847,7 @@ public TacletApp setIfFormulaInstantiations(ImmutableList findIfFormulaInstantiations(Sequent seq, Service "The if formulas have already been instantiated"); if (taclet().assumesSequent().isEmpty()) { - return ImmutableSLList.nil().prepend(this); + return ImmutableList.nil().prepend(this); } return findIfFormulaInstantiationsHelp( @@ -885,7 +885,7 @@ public ImmutableList findIfFormulaInstantiations(Sequent seq, Service createSemisequentList(taclet().assumesSequent().antecedent()), AssumesFormulaInstSeq.createList(seq, false, services), AssumesFormulaInstSeq.createList(seq, true, services), - ImmutableSLList.nil(), matchConditions(), services); + ImmutableList.nil(), matchConditions(), services); } /** @@ -918,9 +918,9 @@ private ImmutableList findIfFormulaInstantiationsHelp( // All formulas have been matched, collect the results TacletApp res = setAllInstantiations(matchCond, instAlreadyMatched, services); if (res != null) { - return ImmutableSLList.nil().prepend(res); + return ImmutableList.nil().prepend(res); } - return ImmutableSLList.nil(); + return ImmutableList.nil(); } else { // Change from succedent to antecedent ruleSuccTail = ruleAntecTail; @@ -936,7 +936,7 @@ private ImmutableList findIfFormulaInstantiationsHelp( // For each matching formula call the method again to match // the remaining terms - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); Iterator itMC = mr.matchConditions().iterator(); ruleSuccTail = ruleSuccTail.tail(); for (final AssumesFormulaInstantiation instantiationCandidate : mr.candidates()) { @@ -950,7 +950,7 @@ private ImmutableList findIfFormulaInstantiationsHelp( private ImmutableList createSemisequentList( Semisequent p_ss) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); for (SequentFormula p_s : p_ss) { res = res.prepend(p_s); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/TacletSchemaVariableCollector.java b/key.core/src/main/java/de/uka/ilkd/key/rule/TacletSchemaVariableCollector.java index 64221c86128..8ab80dbc4c2 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/TacletSchemaVariableCollector.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/TacletSchemaVariableCollector.java @@ -24,7 +24,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -48,7 +47,7 @@ public class TacletSchemaVariableCollector implements DefaultVisitor { public TacletSchemaVariableCollector() { - varList = ImmutableSLList.nil(); + varList = ImmutableList.nil(); } @@ -57,7 +56,7 @@ public TacletSchemaVariableCollector() { * constructs to determine which labels are needed) */ public TacletSchemaVariableCollector(@NonNull SVInstantiations svInsts) { - varList = ImmutableSLList.nil(); + varList = ImmutableList.nil(); instantiations = svInsts; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractApp.java index 69d6bdf9a67..99d1fbd0a92 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractApp.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractApp.java @@ -17,7 +17,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; public class UseDependencyContractApp @@ -32,7 +31,7 @@ public UseDependencyContractApp(UseDependencyContractRule builtInRule, PosInOccu public UseDependencyContractApp(UseDependencyContractRule builtInRule, PosInOccurrence pio, Contract instantiation, PosInOccurrence step) { - this(builtInRule, pio, ImmutableSLList.nil(), instantiation, step); + this(builtInRule, pio, ImmutableList.nil(), instantiation, step); } public UseDependencyContractApp(UseDependencyContractRule rule, PosInOccurrence pio, diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java index ec6b10b9f4b..a31c263fe9a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java @@ -34,7 +34,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -92,7 +91,7 @@ private static List> getEqualityDefsAndPos( private ImmutableSet addEqualDefs(ImmutableSet terms, Goal g) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (SequentFormula cf : g.sequent().antecedent()) { final JTerm formula = (JTerm) cf.formula(); @@ -183,7 +182,7 @@ private static Pair> getChangedLocsForStep final TermBuilder TB = services.getTermBuilder(); if (heapTerm.equals(stepHeap)) { return new Pair<>(TB.empty(), - ImmutableSLList.nil()); + ImmutableList.nil()); } else if (op == heapLDT.getStore()) { final JTerm h = heapTerm.sub(0); final JTerm o = heapTerm.sub(1); @@ -416,7 +415,7 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) { selfTerm = focus.sub(target.getHeapCount(services) * target.getStateCount()); } - ImmutableList paramTerms = ImmutableSLList.nil(); + ImmutableList paramTerms = ImmutableList.nil(); for (int i = target.getHeapCount(services) * target.getStateCount() + (target.isStatic() ? 0 : 1); i < focus.arity(); i++) { paramTerms = paramTerms.append(focus.sub(i)); @@ -461,7 +460,7 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) { int heapExprIndex = 0; boolean useful = false; ImmutableList ifInsts = - ImmutableSLList.nil(); + ImmutableList.nil(); int hc = 0; for (LocationVariable heap : heaps) { if (hc >= obsHeapCount) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/UseOperationContractRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/UseOperationContractRule.java index 3780c359933..3aa0eb08c76 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/UseOperationContractRule.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/UseOperationContractRule.java @@ -154,7 +154,7 @@ private static IProgramMethod getProgramMethod(MethodOrConstructorReference mr, } } else { New n = (New) mr; - ImmutableList sig = ImmutableSLList.nil(); + ImmutableList sig = ImmutableList.nil(); for (Expression e : n.getArguments()) { sig = sig.append(e.getKeYJavaType(services, ec)); } @@ -191,7 +191,7 @@ private static JTerm getActualSelf(MethodOrConstructorReference mr, IProgramMeth private static ImmutableList getActualParams(MethodOrConstructorReference mr, ExecutionContext ec, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (Expression expr : mr.getArguments()) { JTerm actualParam = services.getTypeConverter().convertToLogicElement(expr, ec); result = result.append(actualParam); @@ -672,7 +672,7 @@ protected static class UseOperationContractRuleApplier { protected JTerm atPreUpdates; protected JTerm reachableState; protected ImmutableList anonUpdateDatas = - ImmutableSLList.nil(); + ImmutableList.nil(); protected final Map modifiables; protected final JTerm globalDefs; protected final JTerm originalPre; diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java index e727678997f..a55202beda0 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java @@ -314,7 +314,7 @@ public WhileInvariantRuleApplier(Goal goal, LoopInvariantBuiltInRuleApp ruleA var anonUpdate = createLocalAnonUpdate(localOuts, services); localAnonUpdate = anonUpdate != null ? anonUpdate : tb.skip(); // Term anonAssumption = null; - ImmutableList anonUpdateDatas = ImmutableSLList.nil(); + ImmutableList anonUpdateDatas = ImmutableList.nil(); for (LocationVariable heap : heapContext) { final AnonUpdateData tAnon = createAnonUpdate(heap, modifiables.get(heap), inst.inv, services); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/conditions/NewLocalVarsCondition.java b/key.core/src/main/java/de/uka/ilkd/key/rule/conditions/NewLocalVarsCondition.java index 7b564bae403..39b88bfe1e6 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/conditions/NewLocalVarsCondition.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/conditions/NewLocalVarsCondition.java @@ -79,8 +79,8 @@ public MatchResultInfo check(SchemaVariable var, SyntaxElement instCandidate, var vars = MiscTools.getLocalOuts(body, services); List decls = new ArrayList<>(vars.size()); - ImmutableList updatesBefore = ImmutableSLList.nil(); - ImmutableList updatesFrame = ImmutableSLList.nil(); + ImmutableList updatesBefore = ImmutableList.nil(); + ImmutableList updatesFrame = ImmutableList.nil(); var tb = services.getTermBuilder(); for (var v : vars) { final var newName = diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/TacletExecutor.java b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/TacletExecutor.java index c01f777c4db..fe8961630e6 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/TacletExecutor.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/TacletExecutor.java @@ -28,7 +28,6 @@ import org.key_project.prover.rules.instantiation.MatchResultInfo; import org.key_project.prover.sequent.*; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -138,7 +137,7 @@ protected ImmutableList instantiateSemisequent( Object... instantiationInfo) { // TermLabelState termLabelState, TacletLabelHint // labelHint) { - ImmutableList replacements = ImmutableSLList.nil(); + ImmutableList replacements = ImmutableList.nil(); for (SequentFormula sf : semi) { replacements = replacements.append(instantiateReplacement(sf, services, @@ -213,7 +212,7 @@ protected void applyAddProgVars(ImmutableSet pvs, LogicServices p_services, MatchResultInfo matchCond) { final Services services = (Services) p_services; - ImmutableList renamings = ImmutableSLList.nil(); + ImmutableList renamings = ImmutableList.nil(); for (final SchemaVariable sv : pvs) { final LocationVariable inst = (LocationVariable) matchCond.getInstantiations().getInstantiation(sv); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/inst/GenericSortCondition.java b/key.core/src/main/java/de/uka/ilkd/key/rule/inst/GenericSortCondition.java index cfceb1525e8..e0298a01c22 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/inst/GenericSortCondition.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/inst/GenericSortCondition.java @@ -15,7 +15,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.rules.instantiation.InstantiationEntry; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -98,7 +97,7 @@ protected static ImmutableList createCondition(Sort s0, So if (!(s1 instanceof ParametricSortInstance ps1) || ps1.getBase() != psi.getBase()) { return null; } - ImmutableList conds = ImmutableSLList.nil(); + ImmutableList conds = ImmutableList.nil(); for (int i = psi.getArgs().size() - 1; i >= 0; i--) { var a0 = psi.getArgs().get(i); var a1 = ps1.getArgs().get(i); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/inst/GenericSortInstantiations.java b/key.core/src/main/java/de/uka/ilkd/key/rule/inst/GenericSortInstantiations.java index 7c97e9309ac..2d84d64737c 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/inst/GenericSortInstantiations.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/inst/GenericSortInstantiations.java @@ -24,7 +24,6 @@ import org.key_project.util.collection.ImmutableList; import org.key_project.util.collection.ImmutableMap; import org.key_project.util.collection.ImmutableMapEntry; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -60,7 +59,7 @@ public static GenericSortInstantiations create( Iterator>> p_instantiations, ImmutableList p_conditions, LogicServices services) { - ImmutableList sorts = ImmutableSLList.nil(); + ImmutableList sorts = ImmutableList.nil(); ImmutableList c; final Iterator it; @@ -172,7 +171,7 @@ public boolean isEmpty() { * anything about further generic sorts) */ public ImmutableList toConditions() { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); for (final ImmutableMapEntry entry : insts) { @@ -200,7 +199,7 @@ public Sort getRealSort(Sort p_s, Services services) { throw new GenericSortException("Generic sort is not yet instantiated", null); } } else if (p_s instanceof ParametricSortInstance psi && psi.containsGenericSort()) { - ImmutableList args = ImmutableSLList.nil(); + ImmutableList args = ImmutableList.nil(); for (int i = psi.getArgs().size() - 1; i >= 0; i--) { GenericArgument oa = psi.getArgs().get(i); Sort realSort = getRealSort(oa.sort(), services); @@ -222,7 +221,7 @@ public Sort getRealSort(Sort p_s, Services services) { /** exception thrown if no solution exists */ private final static GenericSortException UNSATISFIABLE_SORT_CONSTRAINTS = new GenericSortException("Conditions for generic sorts could not be solved: ", - ImmutableSLList.nil()); + ImmutableList.nil()); /** * Really solve the conditions given @@ -243,7 +242,7 @@ private static ImmutableMap solve(ImmutableList ImmutableList topologicalSorts = topology(p_sorts); res = solveHelp(topologicalSorts, DefaultImmutableMap.nilMap(), - p_conditions, ImmutableSLList.nil(), services); + p_conditions, ImmutableList.nil(), services); if (res == null) { @@ -286,9 +285,9 @@ private static ImmutableMap solveHelp( // Find the sorts "gs" has to be a supersort of and the // identity conditions - ImmutableList subsorts = ImmutableSLList.nil(); + ImmutableList subsorts = ImmutableList.nil(); ImmutableList idConditions = - ImmutableSLList.nil(); + ImmutableList.nil(); // subsorts given by the conditions (could be made faster // by using a hash map for storing the conditions) @@ -375,7 +374,7 @@ private static ImmutableList chooseResults(GenericSort p_gs, } } - return ImmutableSLList.nil().prepend(chosen); + return ImmutableList.nil().prepend(chosen); } else { // if a list of possible instantiations of the generic // sort has been given, use it @@ -390,7 +389,7 @@ private static ImmutableList chooseResults(GenericSort p_gs, private static ImmutableList toList(ImmutableSet p_set) { ImmutableList res; - res = ImmutableSLList.nil(); + res = ImmutableList.nil(); for (Sort sort : p_set) { res = res.prepend(sort); } @@ -433,7 +432,7 @@ private static ImmutableMap solveForcedInst( } Iterator it = topology(p_remainingSorts).iterator(); - p_remainingSorts = ImmutableSLList.nil(); + p_remainingSorts = ImmutableList.nil(); // reverse the order of the sorts, to start with the most // general one @@ -528,7 +527,7 @@ private static ImmutableMap solveForcedInstHelp( * @return sorted sorts */ private static ImmutableList topology(ImmutableList p_sorts) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); Iterator it; GenericSort curMax; GenericSort tMax; @@ -544,7 +543,7 @@ private static ImmutableList topology(ImmutableList p_ continue; } - tList = ImmutableSLList.nil(); + tList = ImmutableList.nil(); while (it.hasNext()) { tMax = it.next(); @@ -619,16 +618,16 @@ private static ImmutableList minimalSupersorts(ImmutableList p_sorts */ private static ImmutableList findMinimalElements(Set p_inside) { if (p_inside.size() == 1) { - return ImmutableSLList.nil().prepend(p_inside.iterator().next()); + return ImmutableList.nil().prepend(p_inside.iterator().next()); } - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); final Iterator it = p_inside.iterator(); mainloop: while (it.hasNext()) { final Sort sort = it.next(); - ImmutableList res2 = ImmutableSLList.nil(); + ImmutableList res2 = ImmutableList.nil(); for (Sort oldMinimal : res) { if (oldMinimal.extendsTrans(sort)) { continue mainloop; diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/inst/SVInstantiations.java b/key.core/src/main/java/de/uka/ilkd/key/rule/inst/SVInstantiations.java index 9444966b5c6..eef30f81e0e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/inst/SVInstantiations.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/inst/SVInstantiations.java @@ -29,7 +29,6 @@ import org.key_project.util.collection.ImmutableList; import org.key_project.util.collection.ImmutableMap; import org.key_project.util.collection.ImmutableMapEntry; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -84,8 +83,8 @@ public boolean canStandFor(ProgramElement pe, Services services) { /** creates a new SVInstantiations object with an empty map */ private SVInstantiations() { - genericSortConditions = ImmutableSLList.nil(); - updateContext = ImmutableSLList.nil(); + genericSortConditions = ImmutableList.nil(); + updateContext = ImmutableList.nil(); map = DefaultImmutableMap.nilMap(); interesting = DefaultImmutableMap.nilMap(); } @@ -424,7 +423,7 @@ public SVInstantiations clearUpdateContext() { // avoid unnecessary creation of SVInstantiations return this; } - return new SVInstantiations(map, interesting(), ImmutableSLList.nil(), + return new SVInstantiations(map, interesting(), ImmutableList.nil(), getGenericSortInstantiations(), getGenericSortConditions()); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/match/vm/VMTacletMatcher.java b/key.core/src/main/java/de/uka/ilkd/key/rule/match/vm/VMTacletMatcher.java index 2a877e4fabc..8133ab3fd2e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/match/vm/VMTacletMatcher.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/match/vm/VMTacletMatcher.java @@ -33,7 +33,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -130,12 +129,12 @@ public VMTacletMatcher(Taclet taclet) { VMProgramInterpreter interpreter = assumesMatchPrograms.get(p_template); final var mc = (MatchConditions) p_matchCond; - ImmutableList resFormulas = ImmutableSLList.nil(); + ImmutableList resFormulas = ImmutableList.nil(); ImmutableList resMC = - ImmutableSLList.nil(); + ImmutableList.nil(); final boolean updateContextPresent = !mc.getInstantiations().getUpdateContext().isEmpty(); - ImmutableList context = ImmutableSLList.nil(); + ImmutableList context = ImmutableList.nil(); if (updateContextPresent) { context = mc.getInstantiations().getUpdateContext(); @@ -223,7 +222,7 @@ private JTerm matchUpdateContext(ImmutableList context, JTerm f assert assumesSequentIterator.hasNext() : "p_toMatch and assumes sequent must have same number of elements"; newMC = matchAssumes( - ImmutableSLList.nil().prepend(candidateInst), + ImmutableList.nil().prepend(candidateInst), assumesSequentIterator.next().formula(), p_matchCond, p_services).matchConditions(); if (newMC.isEmpty()) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeProcedure.java b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeProcedure.java index ec21d8143da..54b0a637286 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeProcedure.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeProcedure.java @@ -16,7 +16,6 @@ import org.key_project.logic.Name; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -40,11 +39,11 @@ public abstract class MergeProcedure { /** Concrete merge procedures. */ - static ImmutableList CONCRETE_RULES = ImmutableSLList.nil(); + static ImmutableList CONCRETE_RULES = ImmutableList.nil(); static { CONCRETE_RULES = - ImmutableSLList.nil().prepend(MergeTotalWeakening.instance()) + ImmutableList.nil().prepend(MergeTotalWeakening.instance()) .prepend(MergeWithPredicateAbstractionFactory.instance()) .prepend(MergeIfThenElseAntecedent.instance()) .prepend(MergeByIfThenElse.instance()); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java index 22fec157f8e..90f833dc1ed 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java @@ -41,7 +41,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -332,7 +331,7 @@ protected MergeStateEntry mergeStates( progVars = progVars.union(getUpdateLeftSideLocations(state1.first)); progVars = progVars.union(getUpdateLeftSideLocations(state2.first)); - ImmutableList newElementaryUpdates = ImmutableSLList.nil(); + ImmutableList newElementaryUpdates = ImmutableList.nil(); // New constraints on introduced Skolem constants JTerm newAdditionalConstraints = null; @@ -680,7 +679,7 @@ public static ImmutableList findPotentialMergePartners(Goal goal, // Find potential partners -- for which isApplicable is true and // they have the same program counter (and post condition). - ImmutableList potentialPartners = ImmutableSLList.nil(); + ImmutableList potentialPartners = ImmutableList.nil(); for (final Goal g : allGoals) { if (!g.equals(goal) && !g.isLinked()) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRuleBuiltInRuleApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRuleBuiltInRuleApp.java index a262a48205a..e20e960c490 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRuleBuiltInRuleApp.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRuleBuiltInRuleApp.java @@ -24,7 +24,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.Nullable; @@ -138,7 +137,7 @@ private boolean distinguishablePathConditionsRequirement() { // the concrete lattice. if (concreteRule.requiresDistinguishablePathConditions() || concreteRule instanceof MergeWithLatticeAbstraction) { - ImmutableList allStates = ImmutableSLList.nil(); + ImmutableList allStates = ImmutableList.nil(); allStates = allStates.prepend(mergePartnerStates); allStates = allStates.prepend(thisSEState.toSymbolicExecutionState()); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/EnhancedForElimination.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/EnhancedForElimination.java index efb484735f1..7a3bafe873a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/EnhancedForElimination.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/EnhancedForElimination.java @@ -37,7 +37,7 @@ import de.uka.ilkd.key.speclang.LoopSpecification; import org.key_project.util.ExtList; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.key_project.util.collection.Pair; /** @@ -240,7 +240,7 @@ private ProgramElement makeIterableForLoop(EnhancedFor enhancedFor, Transformati final KeYJavaType iterableType = iterableExpr.getKeYJavaType(services, data.execContext()); final IProgramMethod iteratorMethod = services.getJavaInfo().getProgramMethod(iterableType, ITERATOR_METHOD_NAME, - ImmutableSLList.nil(), data.execContext().getTypeReference().getKeYJavaType()); + ImmutableList.nil(), data.execContext().getTypeReference().getKeYJavaType()); // local variable "it" final KeYJavaType iteratorType = iteratorMethod.getReturnType(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ForToWhile.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ForToWhile.java index 2fcb26db942..94e6e80af35 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ForToWhile.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ForToWhile.java @@ -11,7 +11,6 @@ import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * converts a for-loop to a while loop. Invariant and other rules cannot be performed on for but @@ -98,7 +97,7 @@ public ProgramElement[] transform(ProgramElement pe, Services services, */ @Override public ImmutableList neededInstantiations(SVInstantiations svInst) { - ImmutableList ret = ImmutableSLList.nil(); + ImmutableList ret = ImmutableList.nil(); if (innerLabel != null) { ret = ret.prepend(innerLabel); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/MethodCall.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/MethodCall.java index 9d889a2b8e4..0dc41539f51 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/MethodCall.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/MethodCall.java @@ -42,7 +42,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -110,7 +109,7 @@ protected MethodCall(Name name, ProgramSV ec, SchemaVariable result, ProgramElem /** gets an array of expression and returns a list of types */ private ImmutableList getTypes(ImmutableArray args, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (int i = args.size() - 1; i >= 0; i--) { Expression argument = args.get(i); result = diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ObserverEqualityMetaConstruct.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ObserverEqualityMetaConstruct.java index 15523953b1e..b51d27ba1e8 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ObserverEqualityMetaConstruct.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ObserverEqualityMetaConstruct.java @@ -136,7 +136,7 @@ private JTerm buildConditionDependency(JTerm larger, JTerm smaller, DependencyCo // static methods do not a self var ==> one argument less to ignore (#1672) int paramOffset = contract.hasSelfVar() ? 2 : 1; - ImmutableList params = smaller.subs().toImmutableList().take(paramOffset); + ImmutableList params = smaller.subs().toImmutableList().skip(paramOffset); JTerm mod = contract.getDep(baseHeap, false, smaller.sub(0), smaller.sub(1), params, Collections.emptyMap(), services); @@ -178,7 +178,7 @@ private JTerm buildConditionPrecondition(JTerm app, DependencyContract contract, LocationVariable baseHeap = services.getTypeConverter().getHeapLDT().getHeap(); // static methods do not a self var ==> one argument less to ignore (#1672) int paramOffset = contract.hasSelfVar() ? 2 : 1; - ImmutableList params = app.subs().toImmutableList().take(paramOffset); + ImmutableList params = app.subs().toImmutableList().skip(paramOffset); return contract.getPre(baseHeap, app.sub(0), app.sub(1), params, Collections.emptyMap(), services); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ProgramTransformer.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ProgramTransformer.java index 79ab2757adc..d1b8368b0ae 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ProgramTransformer.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ProgramTransformer.java @@ -19,7 +19,6 @@ import org.key_project.logic.Name; import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * ProgramTransformers are used to describe schematic transformations that cannot be expressed by @@ -232,7 +231,7 @@ public KeYJavaType getKeYJavaType(Services javaServ, ExecutionContext ec) { * @return a list of schema variables relevant for this entity; */ public ImmutableList needs() { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } /** @@ -243,7 +242,7 @@ public ImmutableList needs() { * @return a list of schema variables relevant for this entity; */ public ImmutableList neededInstantiations(SVInstantiations svInst) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/UnwindLoop.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/UnwindLoop.java index 06f9eb4bccf..e01477b7063 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/UnwindLoop.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/UnwindLoop.java @@ -11,7 +11,6 @@ import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * This class is used to perform program transformations needed for the symbolic execution of a @@ -92,7 +91,7 @@ public SchemaVariable getOuterLabelSV() { */ @Override public ImmutableList neededInstantiations(SVInstantiations svInst) { - ImmutableList ret = ImmutableSLList.nil(); + ImmutableList ret = ImmutableList.nil(); if (innerLabel != null) { ret = ret.prepend(innerLabel); diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/WhileInvariantTransformer.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/WhileInvariantTransformer.java index 3f0907a142d..2a1f35ab326 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/WhileInvariantTransformer.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/WhileInvariantTransformer.java @@ -36,7 +36,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import com.github.javaparser.ast.key.KeyTransactionStatement; @@ -302,7 +301,7 @@ public ImmutableList neededInstantiations(ProgramElement origina WhileInvariantTransformation w = new WhileInvariantTransformation(originalLoop, svInst, javaInfo == null ? null : javaInfo.getServices()); w.start(); - instantiations = ImmutableSLList.nil(); + instantiations = ImmutableList.nil(); if (w.innerLabelNeeded()) { instantiations = instantiations.prepend(innerLabel); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/arith/Monomial.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/arith/Monomial.java index e3dcd55ea85..5b08713c38a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/arith/Monomial.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/arith/Monomial.java @@ -18,7 +18,6 @@ import org.key_project.logic.op.Operator; import org.key_project.util.LRUCache; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Class for analysing and modifying monomial expressions over the integers @@ -33,7 +32,7 @@ private Monomial(final ImmutableList parts, final BigInteger coefficient) this.coefficient = coefficient; } - public static final Monomial ONE = new Monomial(ImmutableSLList.nil(), BigInteger.ONE); + public static final Monomial ONE = new Monomial(ImmutableList.nil(), BigInteger.ONE); public static Monomial create(Term monoTerm, Services services) { final LRUCache monomialCache = services.getCaches().getMonomialCache(); @@ -134,7 +133,7 @@ public Monomial reduce(Monomial m) { final BigInteger c = this.coefficient; if (a.signum() == 0 || c.signum() == 0) { - return new Monomial(ImmutableSLList.nil(), BigInteger.ZERO); + return new Monomial(ImmutableList.nil(), BigInteger.ZERO); } return new Monomial(difference(m.parts, this.parts), LexPathOrdering.divide(a, c)); @@ -237,7 +236,7 @@ public String toString() { private static class Analyser { public BigInteger coeff = BigInteger.ONE; - public ImmutableList parts = ImmutableSLList.nil(); + public ImmutableList parts = ImmutableList.nil(); private final Services services; private final Operator numbers, mul; diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/arith/Polynomial.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/arith/Polynomial.java index 6fd46319acb..41b8e4a679e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/arith/Polynomial.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/arith/Polynomial.java @@ -17,7 +17,6 @@ import org.key_project.logic.op.Operator; import org.key_project.util.LRUCache; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Class for analysing and modifying polynomial expressions over the integers @@ -28,12 +27,12 @@ public class Polynomial { * The polynomial expression of the BigInteger constant '0'. */ public final static Polynomial ZERO = - new Polynomial(ImmutableSLList.nil(), BigInteger.ZERO); + new Polynomial(ImmutableList.nil(), BigInteger.ZERO); /** * The polynomial expression of the BigInteger constant '1'. */ public final static Polynomial ONE = - new Polynomial(ImmutableSLList.nil(), BigInteger.ONE); + new Polynomial(ImmutableList.nil(), BigInteger.ONE); /** * The BigInteger constant for the value '-1'. @@ -75,9 +74,9 @@ private static Polynomial createHelp(Term polynomial, Services services) { public Polynomial multiply(BigInteger c) { if (c.signum() == 0) { - return new Polynomial(ImmutableSLList.nil(), BigInteger.ZERO); + return new Polynomial(ImmutableList.nil(), BigInteger.ZERO); } - ImmutableList newParts = ImmutableSLList.nil(); + ImmutableList newParts = ImmutableList.nil(); for (Monomial part : parts) { newParts = newParts.prepend(part.multiply(c)); } @@ -87,10 +86,10 @@ public Polynomial multiply(BigInteger c) { public Polynomial multiply(Monomial m) { if (m.getCoefficient().signum() == 0) { - return new Polynomial(ImmutableSLList.nil(), BigInteger.ZERO); + return new Polynomial(ImmutableList.nil(), BigInteger.ZERO); } - ImmutableList newParts = ImmutableSLList.nil(); + ImmutableList newParts = ImmutableList.nil(); for (Monomial part : parts) { newParts = newParts.prepend(part.multiply(m)); } @@ -268,7 +267,7 @@ public String toString() { private static class Analyser { public BigInteger constantPart = BigInteger.ZERO; - public ImmutableList parts = ImmutableSLList.nil(); + public ImmutableList parts = ImmutableList.nil(); private final Services services; private final TypeConverter tc; private final Operator numbers, add; diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/RewriteTacletGoalTemplate.java b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/RewriteTacletGoalTemplate.java index fb8a6636ff6..144e24d57ac 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/RewriteTacletGoalTemplate.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/RewriteTacletGoalTemplate.java @@ -13,7 +13,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -47,7 +46,7 @@ public RewriteTacletGoalTemplate(Sequent addedSeq, ImmutableList addedRu public RewriteTacletGoalTemplate(JTerm replacewith) { - this(JavaDLSequentKit.getInstance().getEmptySequent(), ImmutableSLList.nil(), replacewith); + this(JavaDLSequentKit.getInstance().getEmptySequent(), ImmutableList.nil(), replacewith); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletBuilder.java index bcfd38f2692..fdf0eee7413 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletBuilder.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletBuilder.java @@ -28,7 +28,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -46,19 +45,19 @@ public abstract class TacletBuilder { protected Name name = NONAME; protected Sequent ifseq = JavaDLSequentKit.getInstance().getEmptySequent(); - protected ImmutableList varsNew = ImmutableSLList.nil(); - protected ImmutableList varsNotFreeIn = ImmutableSLList.nil(); - protected ImmutableList varsNewDependingOn = ImmutableSLList.nil(); + protected ImmutableList varsNew = ImmutableList.nil(); + protected ImmutableList varsNotFreeIn = ImmutableList.nil(); + protected ImmutableList varsNewDependingOn = ImmutableList.nil(); protected ImmutableList goals = - ImmutableSLList.nil(); - protected ImmutableList ruleSets = ImmutableSLList.nil(); + ImmutableList.nil(); + protected ImmutableList ruleSets = ImmutableList.nil(); protected TacletAttributes attrs = new TacletAttributes(NONAME.toString(), null); /** * List of additional generic conditions on the instantiations of schema variables. */ protected ImmutableList variableConditions = - ImmutableSLList.nil(); + ImmutableList.nil(); protected HashMap goal2Choices = null; protected ChoiceExpr choices = ChoiceExpr.TRUE; protected ImmutableSet tacletAnnotations = diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGenerator.java b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGenerator.java index 077d8ec8aaa..ff886897048 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGenerator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGenerator.java @@ -34,7 +34,6 @@ import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -61,10 +60,10 @@ public static TacletGenerator getInstance() { private TacletGoalTemplate createAxiomGoalTemplate(JTerm goalTerm) { final SequentFormula axiomSf = new SequentFormula(goalTerm); final ImmutableList axiomSemiSeq = - ImmutableSLList.singleton(axiomSf); + ImmutableList.singleton(axiomSf); final Sequent axiomSeq = JavaDLSequentKit.createAnteSequent(axiomSemiSeq); final TacletGoalTemplate axiomTemplate = - new TacletGoalTemplate(axiomSeq, ImmutableSLList.nil()); + new TacletGoalTemplate(axiomSeq, ImmutableList.nil()); return axiomTemplate; } @@ -123,8 +122,8 @@ public Taclet generateRelationalRepresentsTaclet(Name tacletName, JTerm original originalAxiom = tb.convertToFormula(originalAxiom); // create schema terms - ImmutableList pvs = ImmutableSLList.nil(); - ImmutableList svs = ImmutableSLList.nil(); + ImmutableList pvs = ImmutableList.nil(); + ImmutableList svs = ImmutableList.nil(); List heapSVs = new ArrayList<>(); for (LocationVariable heap : heaps) { if (target.getStateCount() >= 1) { @@ -143,7 +142,7 @@ public Taclet generateRelationalRepresentsTaclet(Name tacletName, JTerm original final JOperatorSV selfSV = createSchemaVariable(self); - ImmutableList paramSVs = ImmutableSLList.nil(); + ImmutableList paramSVs = ImmutableList.nil(); for (LocationVariable paramVar : paramVars) { paramSVs = paramSVs.append(createSchemaVariable(paramVar)); } @@ -156,8 +155,8 @@ public Taclet generateRelationalRepresentsTaclet(Name tacletName, JTerm original SequentFormula guardedSchemaAxiom = generateGuard(kjt, target, services, selfSV, heapSVs, paramSVs, schemaAxiom.term, tacletBuilder, satisfiabilityGuard); final Sequent addedSeq = JavaDLSequentKit.createAnteSequent( - ImmutableSLList.singleton(guardedSchemaAxiom)); - ImmutableList vars = ImmutableSLList.nil(); + ImmutableList.singleton(guardedSchemaAxiom)); + ImmutableList vars = ImmutableList.nil(); for (TermSV heapSV : heapSVs) { vars = vars.append(tb.var(heapSV)); } @@ -170,7 +169,7 @@ public Taclet generateRelationalRepresentsTaclet(Name tacletName, JTerm original final JTerm findTerm = tb.func(target, vars.toArray(new JTerm[0])); final RewriteTacletGoalTemplate axiomTemplate = - new RewriteTacletGoalTemplate(addedSeq, ImmutableSLList.nil(), findTerm); + new RewriteTacletGoalTemplate(addedSeq, ImmutableList.nil(), findTerm); // choices, rule set // Be careful that the choices used here is actually declared (see optionsDeclarations.key), @@ -212,8 +211,8 @@ public ImmutableSet generateFunctionalRepresentsTaclets(Name name, TermBuilder TB = services.getTermBuilder(); // instantiate axiom with schema variables - ImmutableList pvs = ImmutableSLList.nil(); - ImmutableList svs = ImmutableSLList.nil(); + ImmutableList pvs = ImmutableList.nil(); + ImmutableList svs = ImmutableList.nil(); List heapSVs = new ArrayList<>(); for (var heap : heaps) { if (target.getStateCount() >= 1) { @@ -231,7 +230,7 @@ public ImmutableSet generateFunctionalRepresentsTaclets(Name name, } final TermSV selfSV = createSchemaVariable(self); - ImmutableList paramSVs = ImmutableSLList.nil(); + ImmutableList paramSVs = ImmutableList.nil(); for (ProgramVariable paramVar : paramVars) { paramSVs = paramSVs.append(createSchemaVariable(paramVar)); } @@ -262,12 +261,12 @@ public ImmutableSet generateFunctionalRepresentsTaclets(Name name, // ifSeq = null; final JTerm ifFormula = TB.equals(TB.var(selfSV), TB.NULL()); final SequentFormula ifCf = new SequentFormula(ifFormula); - ifSeq = JavaDLSequentKit.createSuccSequent(ImmutableSLList.singleton(ifCf)); + ifSeq = JavaDLSequentKit.createSuccSequent(ImmutableList.singleton(ifCf)); } else { /* \assumes ( Sort.exactInstance(self) ==> ) */ final JTerm ifFormula = TB.exactInstance(kjt.getSort(), TB.var(selfSV)); final SequentFormula ifCf = new SequentFormula(ifFormula); - ifSeq = JavaDLSequentKit.createAnteSequent(ImmutableSLList.singleton(ifCf)); + ifSeq = JavaDLSequentKit.createAnteSequent(ImmutableList.singleton(ifCf)); } JTerm addForumlaTerm = originalPreTerm; @@ -311,7 +310,7 @@ public ImmutableSet generateFunctionalRepresentsTaclets(Name name, tacletBuilder.setFind(schemaLhs); tacletBuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), limitedRhs)); + ImmutableList.nil(), limitedRhs)); // FIXME - there is a chance this will have to go along with all the other associated // changes @@ -363,7 +362,7 @@ private void functionalRepresentsAddSatisfiabilityBranch(IObserverFunction targe selfSV, paramSVs, schemaRepresents, tacletBuilder); SequentFormula addedCf = new SequentFormula(axiomSatisfiable); final Sequent addedSeq = - JavaDLSequentKit.createSuccSequent(ImmutableSLList.singleton(addedCf)); + JavaDLSequentKit.createSuccSequent(ImmutableList.singleton(addedCf)); final var skolemSV = SchemaVariableFactory.createSkolemTermSV(new Name("sk"), target.sort()); for (SchemaVariable heapSV : heapSVs) { @@ -376,7 +375,7 @@ private void functionalRepresentsAddSatisfiabilityBranch(IObserverFunction targe tacletBuilder.addVarsNewDependingOn(skolemSV, paramSV); } tacletBuilder.addTacletGoalTemplate(new RewriteTacletGoalTemplate(addedSeq, - ImmutableSLList.nil(), services.getTermBuilder().var(skolemSV))); + ImmutableList.nil(), services.getTermBuilder().var(skolemSV))); tacletBuilder.goalTemplates().tail().head().setName("Use Axiom"); tacletBuilder.goalTemplates().head().setName("Show Axiom Satisfiability"); } @@ -387,7 +386,7 @@ private JTerm functionalRepresentsSatisfiability(IObserverFunction target, List heapSVs, final JOperatorSV selfSV, ImmutableList paramSVs, final TermAndBoundVarPair schemaRepresents, final RewriteTacletBuilder tacletBuilder) { - ImmutableList vars = ImmutableSLList.nil(); + ImmutableList vars = ImmutableList.nil(); TermBuilder TB = services.getTermBuilder(); for (var heapSV : heapSVs) { vars = vars.append(TB.var(heapSV)); @@ -447,8 +446,8 @@ public ImmutableSet generateContractAxiomTaclets(Name name, JTerm origin ImmutableSet> toLimit, boolean satisfiabilityGuard, TermServices services) { - ImmutableList pvs = ImmutableSLList.nil(); - ImmutableList svs = ImmutableSLList.nil(); + ImmutableList pvs = ImmutableList.nil(); + ImmutableList svs = ImmutableList.nil(); final List heapSVs = new ArrayList<>(); for (var heap : heaps) { if (target.getStateCount() >= 1) { @@ -542,7 +541,7 @@ public ImmutableSet generateContractAxiomTaclets(Name name, JTerm origin final JTerm addedFormula = schemaAdd.term; final SequentFormula addedCf = new SequentFormula(addedFormula); final Sequent addedSeq = JavaDLSequentKit.createAnteSequent( - ImmutableSLList.singleton(addedCf)); + ImmutableList.singleton(addedCf)); for (VariableSV boundSV : schemaAdd.boundVars) { for (SchemaVariable heapSV : heapSVs) { @@ -561,7 +560,7 @@ public ImmutableSet generateContractAxiomTaclets(Name name, JTerm origin tacletBuilder.setApplicationRestriction( new ApplicationRestriction(ApplicationRestriction.SAME_UPDATE_LEVEL)); tacletBuilder.addTacletGoalTemplate( - new TacletGoalTemplate(addedSeq, ImmutableSLList.nil())); + new TacletGoalTemplate(addedSeq, ImmutableList.nil())); tacletBuilder.setName(name); tacletBuilder.addRuleSet(new RuleSet(new Name("classAxiom"))); @@ -594,7 +593,7 @@ private ImmutableSet generateModelMethodExecutionTaclets(Name name, KeYJ final ProgramSV resultProgSV = SchemaVariableFactory .createProgramSV(new ProgramElementName("#res_sv"), ProgramSVSort.VARIABLE, false); - final ImmutableList sig = ImmutableSLList.nil() + final ImmutableList sig = ImmutableList.nil() .append(target.getParamTypes().toArray(new KeYJavaType[target.getNumParams()])); final IProgramMethod targetImpl = services.getJavaInfo().getProgramMethod(kjt, ((ProgramMethod) target).getName(), sig, kjt); @@ -679,7 +678,7 @@ public ImmutableSet generatePartialInvTaclet(Name name, List hea // create added sequent final SequentFormula addedCf = new SequentFormula(limitedAxiom); final Sequent addedSeq = - JavaDLSequentKit.createAnteSequent(ImmutableSLList.singleton(addedCf)); + JavaDLSequentKit.createAnteSequent(ImmutableList.singleton(addedCf)); final JTerm[] hs = new JTerm[heapSVs.size()]; i = 0; @@ -701,7 +700,7 @@ public ImmutableSet generatePartialInvTaclet(Name name, List hea tacletBuilder.setFind(invTerm); tacletBuilder.addTacletGoalTemplate( - new TacletGoalTemplate(addedSeq, ImmutableSLList.nil())); + new TacletGoalTemplate(addedSeq, ImmutableList.nil())); tacletBuilder.setName(name); tacletBuilder.addRuleSet(new RuleSet(new Name("partialInvAxiom"))); for (VariableSV boundSV : schemaAxiom.boundVars) { @@ -724,9 +723,9 @@ public ImmutableSet generatePartialInvTaclet(Name name, List hea final SequentFormula selfEQSF = new SequentFormula(selfEQ); final SequentFormula eqNullSF = new SequentFormula(eqNull); final var antec = - ImmutableSLList.singleton(selfEQSF); + ImmutableList.singleton(selfEQSF); final var succ = - ImmutableSLList.singleton(eqNullSF); + ImmutableList.singleton(eqNullSF); final Sequent ifSeq = JavaDLSequentKit.createSequent(antec, succ); tacletBuilder.setIfSequent(ifSeq); } else if (!isStatic) { @@ -734,7 +733,7 @@ public ImmutableSet generatePartialInvTaclet(Name name, List hea final JTerm selfNull = TB.equals(TB.var(selfSV), TB.NULL()); final SequentFormula selfNullSF = new SequentFormula(selfNull); final Sequent ifSeq = - JavaDLSequentKit.createSuccSequent(ImmutableSLList.singleton(selfNullSF)); + JavaDLSequentKit.createSuccSequent(ImmutableList.singleton(selfNullSF)); tacletBuilder.setIfSequent(ifSeq); } @@ -746,8 +745,8 @@ public ImmutableSet generatePartialInvTaclet(Name name, List hea @SuppressWarnings("unused") private TermAndBoundVarPair createSchemaTerm(JTerm term, TermServices services, Pair... varPairs) { - ImmutableList progVars = ImmutableSLList.nil(); - ImmutableList schemaVars = ImmutableSLList.nil(); + ImmutableList progVars = ImmutableList.nil(); + ImmutableList schemaVars = ImmutableList.nil(); for (Pair varPair : varPairs) { progVars = progVars.append(varPair.first); schemaVars = schemaVars.append(varPair.second); @@ -780,7 +779,7 @@ private TermSV createSchemaVariable(ProgramVariable programVar) { private ImmutableList createSchemaVariables( ImmutableList programVars) { - ImmutableList schemaVars = ImmutableSLList.nil(); + ImmutableList schemaVars = ImmutableList.nil(); for (LocationVariable progVar : programVars) { JOperatorSV schemaVar = createSchemaVariable(progVar); schemaVars = schemaVars.append(schemaVar); @@ -967,7 +966,7 @@ private JTerm prepareSatisfiabilityGuard(IObserverFunction target, List TermServices services) { final TermBuilder TB = services.getTermBuilder(); - ImmutableList vars = ImmutableSLList.nil(); + ImmutableList vars = ImmutableList.nil(); for (TermSV heapSV : heapSVs) { vars = vars.append(TB.var(heapSV)); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/scripts/AutoCommand.java b/key.core/src/main/java/de/uka/ilkd/key/scripts/AutoCommand.java index 5a92b99b744..4f5ba234cbb 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/scripts/AutoCommand.java +++ b/key.core/src/main/java/de/uka/ilkd/key/scripts/AutoCommand.java @@ -21,7 +21,6 @@ import org.key_project.prover.engine.ProverCore; import org.key_project.prover.strategy.RuleApplicationManager; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.Nullable; @@ -69,7 +68,7 @@ public void execute(ScriptCommandAst args) throws ScriptException, InterruptedEx goals = state().getProof().openGoals(); } else { final Goal goal = state().getFirstOpenAutomaticGoal(); - goals = ImmutableSLList.nil().prepend(goal); + goals = ImmutableList.nil().prepend(goal); if (arguments.matches != null || arguments.breakpoint != null) { setupFocussedBreakpointStrategy( // @@ -105,7 +104,7 @@ public void execute(ScriptCommandAst args) throws ScriptException, InterruptedEx // start actual autoprove try { for (Goal goal : goals) { - applyStrategy.start(state().getProof(), ImmutableSLList.nil().prepend(goal)); + applyStrategy.start(state().getProof(), ImmutableList.nil().prepend(goal)); // only now reraise the interruption exception if (applyStrategy.hasBeenInterrupted()) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/scripts/InstantiateCommand.java b/key.core/src/main/java/de/uka/ilkd/key/scripts/InstantiateCommand.java index a4f795b1011..42f84759660 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/scripts/InstantiateCommand.java +++ b/key.core/src/main/java/de/uka/ilkd/key/scripts/InstantiateCommand.java @@ -28,7 +28,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; @@ -110,7 +109,7 @@ private ImmutableList findAllTacletApps(Parameters p, EngineState sta RuleAppIndex index = g.ruleAppIndex(); index.autoModeStopped(); - ImmutableList allApps = ImmutableSLList.nil(); + ImmutableList allApps = ImmutableList.nil(); for (SequentFormula sf : g.node().sequent().antecedent()) { if (p.formula != null && !(RENAMING_TERM_PROPERTY.equalsModThisProperty(sf.formula(), p.formula))) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/scripts/RewriteCommand.java b/key.core/src/main/java/de/uka/ilkd/key/scripts/RewriteCommand.java index ad3ffc68663..f82692495e0 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/scripts/RewriteCommand.java +++ b/key.core/src/main/java/de/uka/ilkd/key/scripts/RewriteCommand.java @@ -23,7 +23,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.jspecify.annotations.Nullable; @@ -109,7 +108,7 @@ private ImmutableList findAllTacletApps(Parameters p, EngineState sta RuleAppIndex index = g.ruleAppIndex(); index.autoModeStopped(); - ImmutableList allApps = ImmutableSLList.nil(); + ImmutableList allApps = ImmutableList.nil(); // filter taclets that are applicable on the given formula // filter taclets that are applicable on the given formula in the antecedent diff --git a/key.core/src/main/java/de/uka/ilkd/key/scripts/RuleCommand.java b/key.core/src/main/java/de/uka/ilkd/key/scripts/RuleCommand.java index 8c2b4796c40..f50eca5d92a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/scripts/RuleCommand.java +++ b/key.core/src/main/java/de/uka/ilkd/key/scripts/RuleCommand.java @@ -27,7 +27,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.jspecify.annotations.Nullable; @@ -288,7 +287,7 @@ private ImmutableList findBuiltInRuleApps(Parameters p, EngineS final Goal g = state.getFirstOpenAutomaticGoal(); final BuiltInRuleAppIndex index = g.ruleAppIndex().builtInRuleAppIndex(); - ImmutableList allApps = ImmutableSLList.nil(); + ImmutableList allApps = ImmutableList.nil(); for (SequentFormula sf : g.node().sequent().antecedent()) { if (!isFormulaSearchedFor(p, sf, services)) { continue; @@ -319,7 +318,7 @@ private ImmutableList findAllTacletApps(Parameters p, EngineState sta RuleAppIndex index = g.ruleAppIndex(); index.autoModeStopped(); - ImmutableList allApps = ImmutableSLList.nil(); + ImmutableList allApps = ImmutableList.nil(); for (SequentFormula sf : g.node().sequent().antecedent()) { if (!isFormulaSearchedFor(p, sf, services)) { continue; diff --git a/key.core/src/main/java/de/uka/ilkd/key/scripts/SMTCommand.java b/key.core/src/main/java/de/uka/ilkd/key/scripts/SMTCommand.java index 86b21964637..9c47449dd45 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/scripts/SMTCommand.java +++ b/key.core/src/main/java/de/uka/ilkd/key/scripts/SMTCommand.java @@ -17,7 +17,6 @@ import de.uka.ilkd.key.smt.solvertypes.SolverTypes; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; @@ -58,7 +57,7 @@ public void execute(ScriptCommandAst params) throws ScriptException, Interrupted if (args.all) { goals = state.getProof().openGoals(); } else { - goals = ImmutableSLList.nil().prepend(state.getFirstOpenAutomaticGoal()); + goals = ImmutableList.nil().prepend(state.getFirstOpenAutomaticGoal()); } for (Goal goal : goals) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/scripts/SelectCommand.java b/key.core/src/main/java/de/uka/ilkd/key/scripts/SelectCommand.java index 650ef75542d..2a0997cae42 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/scripts/SelectCommand.java +++ b/key.core/src/main/java/de/uka/ilkd/key/scripts/SelectCommand.java @@ -39,9 +39,9 @@ public void execute(ScriptCommandAst params) throws ScriptException, Interrupted ImmutableList goals = state.getProof().openEnabledGoals(); if (args.number >= 0) { - g = goals.take(args.number).head(); + g = goals.get(args.number); } else { - g = goals.take(goals.size() + args.number).head(); + g = goals.get(goals.size() + args.number); } } else if (args.formula != null && args.number == null && args.branch == null) { g = findGoalWith(args.formula, state.getProof()); diff --git a/key.core/src/main/java/de/uka/ilkd/key/scripts/TryCloseCommand.java b/key.core/src/main/java/de/uka/ilkd/key/scripts/TryCloseCommand.java index 065120d638f..720d9bcf2a9 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/scripts/TryCloseCommand.java +++ b/key.core/src/main/java/de/uka/ilkd/key/scripts/TryCloseCommand.java @@ -44,9 +44,9 @@ public void execute(ScriptCommandAst params) throws ScriptException, Interrupted int num = Integer.parseInt(args.branch); ImmutableList goals = state().getProof().openEnabledGoals(); if (num >= 0) { - target = goals.take(num).head().node(); + target = goals.get(num).node(); } else { - target = goals.take(goals.size() + num).head().node(); + target = goals.get(goals.size() + num).node(); } } catch (NumberFormatException e) { target = state().getProof().root(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/settings/ChoiceSettings.java b/key.core/src/main/java/de/uka/ilkd/key/settings/ChoiceSettings.java index 7cd84fdcc85..b1913800255 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/settings/ChoiceSettings.java +++ b/key.core/src/main/java/de/uka/ilkd/key/settings/ChoiceSettings.java @@ -11,7 +11,6 @@ import org.key_project.logic.Namespace; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -77,7 +76,7 @@ public Map> getChoices() { } private static ImmutableSet choiceMap2choiceSet(Map ccc) { - ImmutableList choices = ImmutableSLList.nil(); + ImmutableList choices = ImmutableList.nil(); for (final Map.Entry entry : ccc.entrySet()) { choices = choices.prepend(new Choice(new Name(entry.getValue()), entry.getKey())); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/smt/SMTFocusResults.java b/key.core/src/main/java/de/uka/ilkd/key/smt/SMTFocusResults.java index ff31facfaf3..28458953572 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/smt/SMTFocusResults.java +++ b/key.core/src/main/java/de/uka/ilkd/key/smt/SMTFocusResults.java @@ -24,7 +24,6 @@ import org.key_project.prover.sequent.Semisequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; @@ -155,7 +154,7 @@ public static boolean focus(SMTProblem smtProblem, Services services) { Arrays.stream(numbers).forEach(unsatCore::add); ImmutableList unsatCoreFormulas = - ImmutableSLList.nil(); + ImmutableList.nil(); Semisequent antecedent = goalNode.sequent().antecedent(); int i = 1; diff --git a/key.core/src/main/java/de/uka/ilkd/key/smt/SMTProblem.java b/key.core/src/main/java/de/uka/ilkd/key/smt/SMTProblem.java index 8fea97ca991..a533023cecf 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/smt/SMTProblem.java +++ b/key.core/src/main/java/de/uka/ilkd/key/smt/SMTProblem.java @@ -17,7 +17,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Represents a problem that can be passed to a solver. This class was introduced because the SMT @@ -157,7 +156,7 @@ void addSolver(SMTSolver solver) { } public static JTerm sequentToTerm(Sequent s, Services services) { - ImmutableList ante = ImmutableSLList.nil(); + ImmutableList ante = ImmutableList.nil(); final TermBuilder tb = services.getTermBuilder(); ante = ante.append(tb.tt()); @@ -165,7 +164,7 @@ public static JTerm sequentToTerm(Sequent s, Services services) { ante = ante.append((JTerm) f.formula()); } - ImmutableList succ = ImmutableSLList.nil(); + ImmutableList succ = ImmutableList.nil(); succ = succ.append(tb.ff()); for (SequentFormula f : s.succedent()) { succ = succ.append((JTerm) f.formula()); @@ -178,7 +177,7 @@ public static JTerm sequentToTerm(Sequent s, Services services) { private JTerm sequentToTerm(Sequent s) { - ImmutableList ante = ImmutableSLList.nil(); + ImmutableList ante = ImmutableList.nil(); final TermBuilder tb = goal.proof().getServices().getTermBuilder(); ante = ante.append(tb.tt()); @@ -186,7 +185,7 @@ private JTerm sequentToTerm(Sequent s) { ante = ante.append((JTerm) f.formula()); } - ImmutableList succ = ImmutableSLList.nil(); + ImmutableList succ = ImmutableList.nil(); succ = succ.append(tb.ff()); for (SequentFormula f : s.succedent()) { succ = succ.append((JTerm) f.formula()); diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/AuxiliaryContract.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/AuxiliaryContract.java index 53a30efff06..9246f032b7f 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/AuxiliaryContract.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/AuxiliaryContract.java @@ -42,7 +42,6 @@ import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -911,7 +910,7 @@ public OriginalVariables toOrigVars() { atPreVars.put(h, remembranceLocalVariables.get(h)); } return new OriginalVariables(self, result, exception, atPreVars, - ImmutableSLList.nil()); + ImmutableList.nil()); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/ClassAxiomImpl.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/ClassAxiomImpl.java index 9f66ad38829..fe401824b56 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/ClassAxiomImpl.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/ClassAxiomImpl.java @@ -22,7 +22,6 @@ import org.key_project.prover.rules.RuleSet; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -131,7 +130,7 @@ public VisibilityModifier getVisibility() { @Override public ImmutableSet getTaclets(ImmutableSet> toLimit, Services services) { - ImmutableList replaceVars = ImmutableSLList.nil(); + ImmutableList replaceVars = ImmutableList.nil(); replaceVars = replaceVars.append(services.getTypeConverter().getHeapLDT().getHeap()); if (!isStatic) { replaceVars = replaceVars.append(originalSelfVar); diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/ClassInvariantImpl.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/ClassInvariantImpl.java index 3c04fef42d2..98639681e29 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/ClassInvariantImpl.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/ClassInvariantImpl.java @@ -19,7 +19,7 @@ import de.uka.ilkd.key.speclang.Contract.OriginalVariables; import org.key_project.logic.op.Operator; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; /** @@ -211,6 +211,6 @@ public OriginalVariables getOrigVars() { self = this.originalSelfVar; return new OriginalVariables(self, null, null, new LinkedHashMap<>(), - ImmutableSLList.nil()); + ImmutableList.nil()); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/Contract.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/Contract.java index 571df0b7c71..57a5bd17324 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/Contract.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/Contract.java @@ -17,7 +17,6 @@ import de.uka.ilkd.key.proof.init.ProofOblInput; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * A contractual agreement about an ObserverFunction. @@ -330,7 +329,7 @@ public OriginalVariables(LocationVariable selfVar, LocationVariable resVar, this.exception = excVar; this.atPres = atPreVars; if (paramVars == null) { - this.params = ImmutableSLList.nil(); + this.params = ImmutableList.nil(); } else { this.params = paramVars; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/FunctionalOperationContractImpl.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/FunctionalOperationContractImpl.java index 5867dba2c24..0f0664c2cf0 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/FunctionalOperationContractImpl.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/FunctionalOperationContractImpl.java @@ -33,7 +33,6 @@ import org.key_project.logic.op.Operator; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.MapUtil; import static de.uka.ilkd.key.logic.equality.RenamingTermProperty.RENAMING_TERM_PROPERTY; @@ -410,7 +409,7 @@ protected Map getReplaceMap(Map heapTerms private ImmutableList addGhostParams( ImmutableList paramVars) { // make sure ghost parameters are present - ImmutableList ghostParams = ImmutableSLList.nil(); + ImmutableList ghostParams = ImmutableList.nil(); for (LocationVariable param : originalParamVars) { if (param.isGhost()) { ghostParams = ghostParams.append(param); @@ -423,7 +422,7 @@ private ImmutableList addGhostParams( /** Make sure ghost parameters appear in the list of parameter variables. */ private ImmutableList addGhostParamTerms(ImmutableList paramVars) { // make sure ghost parameters are present - ImmutableList ghostParams = ImmutableSLList.nil(); + ImmutableList ghostParams = ImmutableList.nil(); for (LocationVariable param : originalParamVars) { if (param.isGhost()) { ghostParams = ghostParams.append(tb.var(param)); diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/LoopSpecImpl.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/LoopSpecImpl.java index e60d10b1796..d7a9f1d7475 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/LoopSpecImpl.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/LoopSpecImpl.java @@ -25,7 +25,6 @@ import de.uka.ilkd.key.util.InfFlowSpec; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.MapUtil; /** @@ -561,7 +560,7 @@ public OriginalVariables getOrigVars() { self = null; } return new OriginalVariables(self, null, null, atPreVars, - ImmutableSLList.nil()); + ImmutableList.nil()); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/QueryAxiom.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/QueryAxiom.java index e479c78702c..d4acf1600eb 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/QueryAxiom.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/QueryAxiom.java @@ -34,7 +34,6 @@ import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.collection.Pair; @@ -171,7 +170,7 @@ public ImmutableSet getTaclets(ImmutableSet sig = ImmutableSLList.nil() + final ImmutableList sig = ImmutableList.nil() .append(target.getParamTypes().toArray(new KeYJavaType[target.getNumParams()])); // get real implementation of program method final IProgramMethod targetImpl = @@ -189,7 +188,7 @@ public ImmutableSet getTaclets(ImmutableSet antecedent = - ImmutableSLList.singleton(ifCf); + ImmutableList.singleton(ifCf); ifSeq = JavaDLSequentKit.createAnteSequent(antecedent); } @@ -218,7 +217,7 @@ public ImmutableSet getTaclets(ImmutableSet tacletBuilder = @@ -240,7 +239,7 @@ public ImmutableSet getTaclets(ImmutableSet extractParamVars( UseOperationContractRule.Instantiation inst) throws ProofInputException { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JTerm param : inst.actualParams()) { if (param.op() instanceof LocationVariable lv) { result = result.append(lv); diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLInfoExtractor.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLInfoExtractor.java index d63ac422977..87089e19d2a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLInfoExtractor.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLInfoExtractor.java @@ -15,7 +15,6 @@ import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -84,7 +83,7 @@ private static ImmutableList getJMLComments(TypeDeclaration } private static ImmutableList getJMLComments(MethodDeclaration method) { - ImmutableList coms = ImmutableSLList.nil(); + ImmutableList coms = ImmutableList.nil(); // Either method is attached to the method itself ... Comment[] methodComments = method.getComments(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLSpecExtractor.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLSpecExtractor.java index a7f3c262dc4..f607782b394 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLSpecExtractor.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLSpecExtractor.java @@ -67,7 +67,7 @@ public final class JMLSpecExtractor implements SpecExtractor { ParameterlessTermLabel.IMPLICIT_SPECIFICATION_LABEL; private final Services services; private final JMLSpecFactory jsf; - private ImmutableList warnings = ImmutableSLList.nil(); + private ImmutableList warnings = ImmutableList.nil(); // ------------------------------------------------------------------------- // constructors @@ -575,7 +575,7 @@ public LoopSpecification extractLoopInvariant(IProgramMethod pm, LoopStatement l if (constructs.isEmpty()) { return result; } - TextualJMLConstruct c = constructs.take(constructs.size() - 1).head(); + TextualJMLConstruct c = constructs.skip(constructs.size() - 1).head(); if (c instanceof TextualJMLLoopSpec textualLoopSpec) { result = jsf.createJMLLoopInvariant(pm, loop, textualLoopSpec); diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLAssertStatement.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLAssertStatement.java index 849b3f45190..9803f34c7b4 100755 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLAssertStatement.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLAssertStatement.java @@ -5,7 +5,7 @@ import de.uka.ilkd.key.nparser.KeyAst; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.antlr.v4.runtime.RuleContext; @@ -17,7 +17,7 @@ public class TextualJMLAssertStatement extends TextualJMLConstruct { private final Kind kind; public TextualJMLAssertStatement(Kind kind, KeyAst.Expression clause) { - super(ImmutableSLList.nil(), kind.toString() + " " + clause); + super(ImmutableList.nil(), kind.toString() + " " + clause); this.kind = kind; this.context = clause; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLClassAxiom.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLClassAxiom.java index 9b20eab24e7..b1209fb2218 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLClassAxiom.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLClassAxiom.java @@ -8,7 +8,6 @@ import de.uka.ilkd.key.speclang.njml.LabeledParserRuleContext; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -26,8 +25,8 @@ public final class TextualJMLClassAxiom extends TextualJMLConstruct { */ public TextualJMLClassAxiom(ImmutableList modifiers, LabeledParserRuleContext inv) { - super(ImmutableSLList.nil()); // no modifiers allowed in axiom clause (see - // Sect. 8 of reference manual) + super(ImmutableList.nil()); // no modifiers allowed in axiom clause (see + // Sect. 8 of reference manual) assert inv != null; this.inv = inv; setPosition(inv); diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLDepends.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLDepends.java index fe04fc7b68e..31667c7d644 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLDepends.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLDepends.java @@ -11,7 +11,6 @@ import org.key_project.logic.Name; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -28,11 +27,11 @@ public TextualJMLDepends(ImmutableList modifiers, Name[] heaps, super(modifiers); setPosition(depends); for (Name hName : HeapLDT.VALID_HEAP_NAMES) { - this.depends.put(hName, ImmutableSLList.nil()); + this.depends.put(hName, ImmutableList.nil()); } for (Name heap : heaps) { - this.depends.put(heap, ImmutableSLList.singleton(depends)); + this.depends.put(heap, ImmutableList.singleton(depends)); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLLoopSpec.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLLoopSpec.java index fc5a4216e4b..38d7631b9f8 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLLoopSpec.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLLoopSpec.java @@ -11,7 +11,6 @@ import org.key_project.logic.Name; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.antlr.v4.runtime.ParserRuleContext; import org.jspecify.annotations.Nullable; @@ -137,14 +136,14 @@ private Map> getMapInit(ClauseHd if (clause.equals(entry.clauseType)) { String h = (entry.heap != null ? entry.heap : defaultHeap).toString(); ImmutableList l = - map.getOrDefault(h, ImmutableSLList.nil()); + map.getOrDefault(h, ImmutableList.nil()); map.put(h, l.append(entry.ctx)); } } for (Name h : HeapLDT.VALID_HEAP_NAMES) { if (!map.containsKey(h.toString())) { - map.put(h.toString(), ImmutableSLList.nil()); + map.put(h.toString(), ImmutableList.nil()); } } return map; @@ -157,14 +156,14 @@ private Map> getMap(ClauseHd cla if (clause.equals(entry.clauseType)) { String h = (entry.heap != null ? entry.heap : defaultHeap).toString(); ImmutableList l = - map.getOrDefault(h, ImmutableSLList.nil()); + map.getOrDefault(h, ImmutableList.nil()); map.put(h, l.append(entry.ctx)); } } for (Name h : HeapLDT.VALID_HEAP_NAMES) { if (!map.containsKey(h.toString())) { - map.put(h.toString(), ImmutableSLList.nil()); + map.put(h.toString(), ImmutableList.nil()); } } return map; diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java index d51b8123339..0db0c1006d3 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java @@ -266,7 +266,7 @@ public Contract createDefaultContract(IProgramMethod method, boolean useSoundDef // internal classes // ------------------------------------------------------------------------- public static class ContractClauses { - public ImmutableList abbreviations = ImmutableSLList.nil(); + public ImmutableList abbreviations = ImmutableList.nil(); public final Map requires = new LinkedHashMap<>(); public final Map requiresFree = new LinkedHashMap<>(); public JTerm measuredBy; @@ -327,7 +327,7 @@ private String getContractName(IProgramMethod programMethod, Behavior behavior) */ private ImmutableList collectLocalVariables(StatementContainer sc, LoopStatement loop) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (int i = 0, m = sc.getStatementCount(); i < m; i++) { Statement s = sc.getStatementAt(i); @@ -569,7 +569,7 @@ private void translateAssignable(Context context, ProgramVariableCollection prog final Boolean hasAssignable = clauses.hasAssignable.get(heap); if (hasAssignable == null || !hasAssignable) { final ImmutableList assignableNothing = - ImmutableSLList.nil().append(getAssignableNothing()); + ImmutableList.nil().append(getAssignableNothing()); clauses.assignables.put(heap, translateAssignable(context, progVars.paramVars, progVars.atPres, progVars.atBefores, assignableNothing)); } else { @@ -584,7 +584,7 @@ private void translateAssignable(Context context, ProgramVariableCollection prog final Boolean hasFreeAssignable = clauses.hasFreeAssignable.get(heap); if (hasFreeAssignable == null || !hasFreeAssignable) { final ImmutableList assignableFreeNothing = - ImmutableSLList + ImmutableList .nil().append(getAssignableFreeNothing()); clauses.assignablesFree.put(heap, translateAssignableFree(context, progVars.paramVars, @@ -645,9 +645,9 @@ private ImmutableList translateInfFlowSpecClauses(Context context, ImmutableList paramVars, LocationVariable resultVar, LocationVariable excVar, ImmutableList originalClauses) { if (originalClauses.isEmpty()) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } else { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (LabeledParserRuleContext expr : originalClauses) { InfFlowSpec translated = new JmlIO(services).context(context).parameters(paramVars) .resultVariable(resultVar).exceptionVariable(excVar).translateInfFlow(expr); @@ -1189,7 +1189,7 @@ public ClassAxiom createJMLRepresents(@NonNull KeYJavaType kjt, VisibilityModifi JTerm repFormula = tb.convertToFormula(rep.second); // create class axiom return new RepresentsAxiom("JML represents clause for " + rep.first.name(), rep.first, kjt, - visibility, null, repFormula, context.selfVar(), ImmutableSLList.nil(), null); + visibility, null, repFormula, context.selfVar(), ImmutableList.nil(), null); } public ClassAxiom createJMLRepresents(KeYJavaType kjt, TextualJMLRepresents textualRep) @@ -1217,7 +1217,7 @@ public ClassAxiom createJMLRepresents(KeYJavaType kjt, TextualJMLRepresents text : "JML represents clause \"" + textualRep.getName() + "\" for " + rep.first.name(); JTerm repFormula = tb.convertToFormula(rep.second); return new RepresentsAxiom(name, displayName, rep.first, kjt, getVisibility(textualRep), - null, repFormula, context.selfVar(), ImmutableSLList.nil(), null); + null, repFormula, context.selfVar(), ImmutableList.nil(), null); } /** @@ -1375,7 +1375,7 @@ public ImmutableSet createJMLMergeContracts(final IProgramMethod tb.var(tb.atPreVar(param.toString(), param.sort(), false)))); final MergeParamsSpec specs = new JmlIO(services).context(context) - .parameters(append(ImmutableSLList.nil(), params)) + .parameters(append(ImmutableList.nil(), params)) .resultVariable(progVars.resultVar).exceptionVariable(progVars.excVar) .atPres(atPres).translateMergeParams(ctx.mergeparamsspec()); @@ -1644,7 +1644,7 @@ private ProgramVariableCollection createProgramVariables(final IProgramMethod me vars = append(collectLocalVariables(method.getBody(), (For) first), method.collectParameters()).append(collectLocalVariablesVisibleTo(block, method)); } else { - vars = append(ImmutableSLList.nil(), method.collectParameters()) + vars = append(ImmutableList.nil(), method.collectParameters()) .append(collectLocalVariablesVisibleTo(block, method)); } @@ -1670,7 +1670,7 @@ protected ImmutableList collectLocalVariablesVisibleTo( private ImmutableList collectLocalVariablesVisibleTo(Statement statement, StatementContainer container) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); final int statementCount = container.getStatementCount(); for (int i = 0; i < statementCount; i++) { final Statement s = container.getStatementAt(i); @@ -1800,7 +1800,7 @@ private Map> translateToTermInfFlow infFlowSpecTermList = translateInfFlowSpecClauses(context, allVars, resultVar, excVar, originalInfFlowSpecs); } else { - infFlowSpecTermList = ImmutableSLList.nil(); + infFlowSpecTermList = ImmutableList.nil(); } infFlowSpecs.put(heap, infFlowSpecTermList); } @@ -1846,7 +1846,7 @@ private Map translateToTermModifiable(Context context, // Hence this little helper. private ImmutableList append(ImmutableList localVars, ImmutableList paramVars) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (LocationVariable param : paramVars) { result = result.prepend(param); } @@ -1875,7 +1875,7 @@ public LoopSpecification createJMLLoopInvariant(IProgramMethod pm, LoopStatement public FunctionalOperationContract initiallyClauseToContract(InitiallyClause ini, IProgramMethod pm) throws SLTranslationException { final ImmutableList modifiers = - ImmutableSLList.nil().append(JMLModifier.PRIVATE); + ImmutableList.nil().append(JMLModifier.PRIVATE); final TextualJMLSpecCase specCase = new TextualJMLSpecCase(modifiers, Behavior.NONE); specCase.addName(ini.getName()); for (LabeledParserRuleContext context : createPrecond(pm, ini.getOriginalSpec())) { @@ -1903,7 +1903,7 @@ public FunctionalOperationContract initiallyClauseToContract(InitiallyClause ini private ImmutableList createPrecond(IProgramMethod pm, LabeledParserRuleContext originalSpec) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); // TODO: add static invariant for (ParameterDeclaration p : pm.getMethodDeclaration().getParameters()) { if (!JMLInfoExtractor.parameterIsNullable(pm, p)) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/JmlIO.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/JmlIO.java index 9f9cee10243..1cf10ba3313 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/JmlIO.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/JmlIO.java @@ -21,7 +21,6 @@ import de.uka.ilkd.key.util.mergerule.MergeParamsSpec; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.antlr.v4.runtime.ParserRuleContext; @@ -47,7 +46,7 @@ @NullMarked public class JmlIO { - private ImmutableList warnings = ImmutableSLList.nil(); + private ImmutableList warnings = ImmutableList.nil(); private final Services services; @@ -394,7 +393,7 @@ public JmlIO clear() { this.specMathMode = null; clearWarnings(); exceptionVariable(null); - parameters(ImmutableSLList.nil()); + parameters(ImmutableList.nil()); return this; } @@ -408,6 +407,6 @@ public ImmutableList getWarnings() { } public void clearWarnings() { - warnings = ImmutableSLList.nil(); + warnings = ImmutableList.nil(); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/JmlTermFactory.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/JmlTermFactory.java index 731ae0da7f2..ad1f44bc542 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/JmlTermFactory.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/JmlTermFactory.java @@ -35,7 +35,6 @@ import org.key_project.logic.op.QuantifiableVariable; import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.antlr.v4.runtime.Token; @@ -380,7 +379,7 @@ public JTerm upperBound(JTerm a, LogicVariable lv) { if (it.hasNext() || !isBoundedNumerical(t1, lv)) { // not interval range, create unbounded comprehension term ImmutableList _qvs = - ImmutableSLList.nil().prepend(lv); + ImmutableList.nil().prepend(lv); while (it.hasNext()) { _qvs = _qvs.prepend(it.next()); } @@ -908,7 +907,7 @@ public JTerm createStoreRef(SLExpression expr) { || t.op().equals(locSetLDT.getSingleton())) { return t; } else { - ImmutableList exprList = ImmutableSLList.nil(); + ImmutableList exprList = ImmutableList.nil(); exprList = exprList.append(expr); return createLocSet(exprList); } @@ -917,7 +916,7 @@ public JTerm createStoreRef(SLExpression expr) { } public JTerm createLocSet(ImmutableList exprList) { - ImmutableList singletons = ImmutableSLList.nil(); + ImmutableList singletons = ImmutableList.nil(); for (SLExpression expr : exprList) { if (expr.isTerm()) { JTerm t = expr.getTerm(); @@ -956,7 +955,7 @@ public JTerm createLocSet(ImmutableList exprList) { } public SLExpression createPairwiseDisjoint(ImmutableList list) { - ImmutableList disTerms = ImmutableSLList.nil(); + ImmutableList disTerms = ImmutableList.nil(); while (!list.isEmpty()) { JTerm t1 = list.head(); list = list.tail(); @@ -978,7 +977,7 @@ public SLExpression seqConcat(JTerm seq1, JTerm seq2) { } public SLExpression seqConst(ImmutableList exprList) { - ImmutableList terms = ImmutableSLList.nil(); + ImmutableList terms = ImmutableList.nil(); for (SLExpression expr : exprList) { if (expr.isTerm()) { JTerm t = ensureTerm(expr.getTerm()); @@ -1261,7 +1260,7 @@ public SLExpression translateToJDLTerm(final String functName, JTerm[] args; if (list == null) { - list = ImmutableSLList.nil(); + list = ImmutableList.nil(); } JTerm heap = tb.getBaseHeap(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/TextualTranslator.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/TextualTranslator.java index 4ca3aa427d3..851bf25bd4a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/TextualTranslator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/TextualTranslator.java @@ -11,7 +11,6 @@ import org.key_project.logic.Name; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; @@ -38,8 +37,8 @@ class TextualTranslator extends JmlParserBaseVisitor { private final boolean attachOriginLabel; - public ImmutableList constructs = ImmutableSLList.nil(); - public ImmutableList mods = ImmutableSLList.nil(); + public ImmutableList constructs = ImmutableList.nil(); + public ImmutableList mods = ImmutableList.nil(); private @Nullable TextualJMLSpecCase methodContract; private @Nullable TextualJMLLoopSpec loopContract; @@ -102,7 +101,7 @@ public TextualTranslator(boolean attachOriginLabel) { */ protected void finishConstruct(TextualJMLConstruct construct) { constructs = constructs.append(construct); - mods = ImmutableSLList.nil(); + mods = ImmutableList.nil(); methodContract = null; loopContract = null; } @@ -133,7 +132,7 @@ public Object visitSpec_case(JmlParser.Spec_caseContext ctx) { constructs = constructs.append(methodContract); super.visitSpec_body(ctx.spec_body()); methodContract = null; - mods = ImmutableSLList.nil(); + mods = ImmutableList.nil(); return null; } diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/Translator.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/Translator.java index eb06cf15008..c7d1403edf9 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/Translator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/njml/Translator.java @@ -43,7 +43,6 @@ import org.key_project.logic.op.Function; import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; import org.antlr.v4.runtime.ParserRuleContext; @@ -146,7 +145,7 @@ private List mapOf(List contexts) { @SuppressWarnings("unchecked") private ImmutableList listOf(List contexts) { - ImmutableList seq = ImmutableSLList.nil(); + ImmutableList seq = ImmutableList.nil(); for (ParserRuleContext context : contexts) { seq = seq.append((T) accept(context)); } @@ -327,7 +326,7 @@ public Object visitStoreRefUnion(JmlParser.StoreRefUnionContext ctx) { @Override public ImmutableList visitStoreRefList(JmlParser.StoreRefListContext ctx) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JmlParser.StorerefContext context : ctx.storeref()) { result = result.append((JTerm) accept(context)); } @@ -361,7 +360,7 @@ public Object visitStoreref(JmlParser.StorerefContext ctx) { public Object visitCreateLocset(JmlParser.CreateLocsetContext ctx) { JmlParser.ExprListContext exprList = ctx.exprList(); if (exprList == null) { - return termFactory.createLocSet(ImmutableSLList.nil()); + return termFactory.createLocSet(ImmutableList.nil()); } else { return termFactory.createLocSet(requireNonNull(accept(exprList))); } @@ -370,7 +369,7 @@ public Object visitCreateLocset(JmlParser.CreateLocsetContext ctx) { @Override public ImmutableList visitExprList(JmlParser.ExprListContext ctx) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JmlParser.ExpressionContext context : ctx.expression()) { result = result.append((SLExpression) accept(context)); } @@ -1121,7 +1120,7 @@ private SLExpression processJmlBuiltInFunction(String name, private SLParameters visitParameters(JmlParser.Param_listContext ctx) { ImmutableList params = ctx.param_decl().stream().map(it -> lookupIdentifier(it.p.getText(), null, null, it)) - .collect(ImmutableSLList.toImmutableList()); + .collect(ImmutableList.collector()); return getSlParametersWithHeap(params); } @@ -1131,7 +1130,7 @@ private SLParameters visitParameters(JmlParser.ExpressionlistContext ctx) { } private SLParameters getSlParametersWithHeap(ImmutableList params) { - ImmutableList preHeapParams = ImmutableSLList.nil(); + ImmutableList preHeapParams = ImmutableList.nil(); for (LocationVariable heap : HeapContext.getModifiableHeaps(services, false)) { JTerm p; if (atPres == null || atPres.get(heap) == null) { @@ -1539,7 +1538,7 @@ public Object visitPrimaryEmptySet(JmlParser.PrimaryEmptySetContext ctx) { @Override public Object visitPrimaryStoreRef(JmlParser.PrimaryStoreRefContext ctx) { if (ctx.storeRefUnion() == null) { - return new SLExpression(termFactory.createLocSet(ImmutableSLList.nil())); + return new SLExpression(termFactory.createLocSet(ImmutableList.nil())); } JTerm t = accept(ctx.storeRefUnion()); return new SLExpression(t, javaInfo.getPrimitiveKeYJavaType(PrimitiveType.JAVA_LOCSET)); @@ -1864,7 +1863,7 @@ public Object visitSeqdefterm(JmlParser.SeqdeftermContext ctx) { @Override public Pair> visitQuantifiedvardecls( JmlParser.QuantifiedvardeclsContext ctx) { - ImmutableList vars = ImmutableSLList.nil(); + ImmutableList vars = ImmutableList.nil(); KeYJavaType t = accept(ctx.typespec()); for (JmlParser.QuantifiedvariabledeclaratorContext context : ctx .quantifiedvariabledeclarator()) { @@ -2025,7 +2024,7 @@ public SLExpression visitLoop_assignable_clause(JmlParser.Loop_assignable_clause @Override public SLExpression visitSignals_only_clause(JmlParser.Signals_only_clauseContext ctx) { - ImmutableList typeList = ImmutableSLList.nil(); + ImmutableList typeList = ImmutableList.nil(); for (JmlParser.ReferencetypeContext context : ctx.referencetype()) { typeList = typeList.append((KeYJavaType) accept(context)); } @@ -2068,7 +2067,7 @@ public SLExpression visitReturns_clause(JmlParser.Returns_clauseContext ctx) { @Override public ImmutableList visitModifiers(JmlParser.ModifiersContext ctx) { - mods = ImmutableSLList.nil(); + mods = ImmutableList.nil(); return mods; } @@ -2256,9 +2255,9 @@ public Pair visitRepresents_clause( @Override public InfFlowSpec visitSeparates_clause(JmlParser.Separates_clauseContext ctx) { - ImmutableList decl = ImmutableSLList.nil(); - ImmutableList erases = ImmutableSLList.nil(); - ImmutableList newObs = ImmutableSLList.nil(); + ImmutableList decl = ImmutableList.nil(); + ImmutableList erases = ImmutableList.nil(); + ImmutableList newObs = ImmutableList.nil(); ImmutableList sep = accept(ctx.sep); @@ -2274,17 +2273,17 @@ public InfFlowSpec visitSeparates_clause(JmlParser.Separates_clauseContext ctx) @Override public Object visitLoop_separates_clause(JmlParser.Loop_separates_clauseContext ctx) { ImmutableList sep = accept(ctx.sep); - ImmutableList newObs = ImmutableSLList.nil(); + ImmutableList newObs = ImmutableList.nil(); newObs = append(newObs, ctx.newobj); return new InfFlowSpec(sep, sep, newObs); } @Override public Object visitDetermines_clause(JmlParser.Determines_clauseContext ctx) { - ImmutableList decl = ImmutableSLList.nil(); - ImmutableList erases = ImmutableSLList.nil(); - ImmutableList newObs = ImmutableSLList.nil(); - ImmutableList by = ImmutableSLList.nil(); + ImmutableList decl = ImmutableList.nil(); + ImmutableList erases = ImmutableList.nil(); + ImmutableList newObs = ImmutableList.nil(); + ImmutableList by = ImmutableList.nil(); ImmutableList determined = accept(ctx.determined); @@ -2310,8 +2309,8 @@ public Object visitDetermines_clause(JmlParser.Determines_clauseContext ctx) { @Override public Object visitLoop_determines_clause(JmlParser.Loop_determines_clauseContext ctx) { - ImmutableList newObs = ImmutableSLList.nil(); - ImmutableList det = append(ImmutableSLList.nil(), ctx.det); + ImmutableList newObs = ImmutableList.nil(); + ImmutableList det = append(ImmutableList.nil(), ctx.det); newObs = append(newObs, ctx.newObs); return new InfFlowSpec(det, det, newObs); } @@ -2319,7 +2318,7 @@ public Object visitLoop_determines_clause(JmlParser.Loop_determines_clauseContex @Override public ImmutableList visitInfflowspeclist(JmlParser.InfflowspeclistContext ctx) { if (ctx.NOTHING() != null) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } ImmutableList seq = accept(ctx.expressionlist()); assert seq != null; diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/translation/SLParameters.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/translation/SLParameters.java index 1f99e379eaa..537b2d1edb8 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/translation/SLParameters.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/translation/SLParameters.java @@ -9,7 +9,6 @@ import de.uka.ilkd.key.logic.JTerm; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Wraps a list of expressions. @@ -31,7 +30,7 @@ public boolean isListOfTerm() { * @return the list of types that compose the type signature */ public ImmutableList getSignature(Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (SLExpression expr : parameters) { KeYJavaType type = expr.getType(); if (type == null) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/translation/SLResolverManager.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/translation/SLResolverManager.java index eea06618962..9ca75fb279c 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/translation/SLResolverManager.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/translation/SLResolverManager.java @@ -18,7 +18,6 @@ import org.key_project.logic.Namespace; import org.key_project.logic.op.ParsableVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -31,16 +30,16 @@ public abstract class SLResolverManager { public final SLExceptionFactory excManager; private ImmutableList resolvers = - ImmutableSLList.nil(); + ImmutableList.nil(); private final KeYJavaType specInClass; private final LocationVariable selfVar; private final TermBuilder tb; private ImmutableList> localVariablesNamespaces = - ImmutableSLList.nil(); + ImmutableList.nil(); private ImmutableList> logicVariablesNamespaces = - ImmutableSLList.nil(); + ImmutableList.nil(); private final Map kjts = new LinkedHashMap<>(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/AbstractFeatureStrategy.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/AbstractFeatureStrategy.java index 0da58226050..7a1a6d44443 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/AbstractFeatureStrategy.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/AbstractFeatureStrategy.java @@ -31,7 +31,6 @@ import org.key_project.prover.strategy.costbased.termfeature.TermFeature; import org.key_project.prover.strategy.costbased.termgenerator.TermGenerator; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -72,7 +71,7 @@ protected Feature ifHeuristics(String[] names, int priority) { } protected TacletFilter getFilterFor(String[] p_names) { - ImmutableList heur = ImmutableSLList.nil(); + ImmutableList heur = ImmutableList.nil(); for (int i = 0; i != p_names.length; ++i) { heur = heur.prepend(getHeuristic(p_names[i])); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/AssumesInstantiator.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/AssumesInstantiator.java index 27a6b42ad75..fd16f14f8cc 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/AssumesInstantiator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/AssumesInstantiator.java @@ -24,7 +24,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * This class implements custom instantiation of if-formulas. @@ -36,7 +35,7 @@ public class AssumesInstantiator { private ImmutableArray allAntecFormulas; private ImmutableArray allSuccFormulas; - private ImmutableList results = ImmutableSLList.nil(); + private ImmutableList results = ImmutableList.nil(); private final TacletAppContainer tacletAppContainer; @@ -79,7 +78,7 @@ public void findAssumesFormulaInstantiations() { //// with the //// last //// formula - ifSequent.antecedent().asList().reverse(), ImmutableSLList.nil(), + ifSequent.antecedent().asList().reverse(), ImmutableList.nil(), tacletAppContainer.getTacletApp().matchConditions(), false); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/BuiltInRuleAppContainer.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/BuiltInRuleAppContainer.java index cbcb861dd3f..289cb5484b9 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/BuiltInRuleAppContainer.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/BuiltInRuleAppContainer.java @@ -13,7 +13,6 @@ import org.key_project.prover.strategy.costbased.RuleAppCost; import org.key_project.prover.strategy.costbased.TopRuleAppCost; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -114,7 +113,7 @@ static RuleAppContainer createAppContainer(IBuiltInRuleApp bir, static ImmutableList createInitialAppContainers( ImmutableList birs, PosInOccurrence pio, Goal goal) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (IBuiltInRuleApp bir : birs) { result = result.prepend(createAppContainer(bir, pio, goal)); @@ -128,16 +127,16 @@ static ImmutableList createInitialAppContainers( @Override public ImmutableList createFurtherApps(Goal goal) { if (!isStillApplicable(goal)) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } final PosInOccurrence pio = getPosInOccurrence(goal); RuleAppContainer container = createAppContainer(bir, pio, goal); if (container.getCost() instanceof TopRuleAppCost) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } - return ImmutableSLList.nil().prepend(container); + return ImmutableList.nil().prepend(container); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/FocussedBreakpointRuleApplicationManager.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/FocussedBreakpointRuleApplicationManager.java index ded23249e51..9c7094c8101 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/FocussedBreakpointRuleApplicationManager.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/FocussedBreakpointRuleApplicationManager.java @@ -16,7 +16,6 @@ import org.key_project.prover.strategy.DelegationBasedRuleApplicationManager; import org.key_project.prover.strategy.RuleApplicationManager; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; @@ -91,7 +90,7 @@ public void ruleAdded(RuleApp rule, PosInOccurrence pos) { public void rulesAdded(ImmutableList rules, PosInOccurrence pos) { ImmutableList applicableRules = // - ImmutableSLList.nil(); + ImmutableList.nil(); for (RuleApp r : rules) { if (mayAddRule(r, pos)) { applicableRules = applicableRules.prepend(r); diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/FocussedRuleApplicationManager.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/FocussedRuleApplicationManager.java index 5ab8202f1a9..d12731f3b65 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/FocussedRuleApplicationManager.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/FocussedRuleApplicationManager.java @@ -15,7 +15,6 @@ import org.key_project.prover.strategy.costbased.MutableState; import org.key_project.prover.strategy.costbased.feature.BinaryFeature; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * A rule app manager that ensures that rules are only applied to a certain subterm within the proof @@ -133,7 +132,7 @@ protected boolean isRuleApplicationForFocussedFormula(RuleApp rule, @Override public void rulesAdded(ImmutableList rules, PosInOccurrence pos) { - ImmutableList applicableRules = ImmutableSLList.nil(); + ImmutableList applicableRules = ImmutableList.nil(); for (RuleApp r : rules) { if (isRuleApplicationForFocussedFormula(r, pos)) { applicableRules = applicableRules.prepend(r); diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/QueueRuleApplicationManager.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/QueueRuleApplicationManager.java index ff7fbb523af..2372d96a4be 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/QueueRuleApplicationManager.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/QueueRuleApplicationManager.java @@ -20,7 +20,6 @@ import org.key_project.util.collection.ImmutableHeap; import org.key_project.util.collection.ImmutableLeftistHeap; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.NullMarked; @@ -277,7 +276,7 @@ private void computeNextRuleApp(ImmutableHeap<@NonNull RuleAppContainer> further * Working list contains rule apps that cannot be completed in the current round but will be * reconsidered during the next round. */ - ImmutableList workingList = ImmutableSLList.nil(); + ImmutableList workingList = ImmutableList.nil(); /* * Try to find a rule app that can be completed until both queues are exhausted. diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/RuleAppContainer.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/RuleAppContainer.java index 5e622bbb551..bd7d999e9cb 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/RuleAppContainer.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/RuleAppContainer.java @@ -12,7 +12,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.strategy.costbased.RuleAppCost; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -95,15 +94,15 @@ public final RuleAppCost getCost() { public static ImmutableList createAppContainers( ImmutableList rules, PosInOccurrence pos, Goal goal) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (rules.size() == 1) { result = result.prepend(createAppContainer(rules.head(), pos, goal)); } else if (rules.size() > 1) { ImmutableList tacletApplications = - ImmutableSLList.nil(); + ImmutableList.nil(); ImmutableList builtInRuleApplications = - ImmutableSLList.nil(); + ImmutableList.nil(); for (RuleApp rule : rules) { if (rule instanceof NoPosTacletApp) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/TacletAppContainer.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/TacletAppContainer.java index 22282daa683..17c4406987a 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/TacletAppContainer.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/TacletAppContainer.java @@ -21,7 +21,6 @@ import org.key_project.prover.strategy.costbased.RuleAppCost; import org.key_project.prover.strategy.costbased.TopRuleAppCost; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; /** @@ -85,16 +84,16 @@ public final ImmutableList createFurtherApps(Goal p_goal) { if (!isStillApplicable(p_goal) || (getTacletApp().assumesInstantionsComplete() && !assumesFormulasStillValid(p_goal))) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } final TacletAppContainer newCont = createContainer(p_goal); if (newCont.getCost() instanceof TopRuleAppCost) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } ImmutableList res = - ImmutableSLList.nil().prepend(newCont); + ImmutableList.nil().prepend(newCont); if (getTacletApp().assumesInstantionsComplete()) { res = addInstances(getTacletApp(), res, p_goal); @@ -200,7 +199,7 @@ protected static ImmutableList createInitialAppContainers( costs.add(p_goal.getGoalStrategy().computeCost(app, p_pio, p_goal)); } - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (RuleAppCost cost : costs) { final TacletAppContainer container = createContainer(p_app.head(), p_pio, p_goal, cost, true); diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/DependencyContractFeature.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/DependencyContractFeature.java index 9ce5fab1369..3416967d7a3 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/DependencyContractFeature.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/DependencyContractFeature.java @@ -19,7 +19,7 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.strategy.costbased.MutableState; import org.key_project.prover.strategy.costbased.feature.BinaryFeature; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.jspecify.annotations.NonNull; @@ -73,7 +73,7 @@ private void removePreviouslyUsedSteps(JTerm focus, Goal goal, } // instantiate with arbitrary remaining step - bapp = bapp.setAssumesInsts(ImmutableSLList.nil().prepend(steps.get(0))); + bapp = bapp.setAssumesInsts(ImmutableList.nil().prepend(steps.get(0))); return true; } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/SmallerThanFeature.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/SmallerThanFeature.java index 75e8b02b859..910f849ea8c 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/SmallerThanFeature.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/SmallerThanFeature.java @@ -10,7 +10,6 @@ import org.key_project.logic.Term; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -51,7 +50,7 @@ protected final boolean lessThan(ImmutableList list1, ImmutableList protected abstract static class Collector { - private ImmutableList terms = ImmutableSLList.nil(); + private ImmutableList terms = ImmutableList.nil(); protected void addTerm(Term mon) { terms = terms.prepend(mon); diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/instantiator/SVInstantiationCP.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/instantiator/SVInstantiationCP.java index 2f8b69dfc4f..c758b7356c1 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/instantiator/SVInstantiationCP.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/feature/instantiator/SVInstantiationCP.java @@ -24,7 +24,7 @@ import org.key_project.prover.strategy.costbased.feature.instantiator.CPBranch; import org.key_project.prover.strategy.costbased.feature.instantiator.ChoicePoint; import org.key_project.prover.strategy.costbased.termProjection.ProjectionToTerm; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -124,7 +124,7 @@ public void choose() {} public RuleApp getRuleAppForBranch() { return newApp; } }; - return ImmutableSLList.nil().prepend(branch).iterator(); + return ImmutableList.nil().prepend(branch).iterator(); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/EqualityConstraint.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/EqualityConstraint.java index 8b20cd0ca5a..997d5a4c33b 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/EqualityConstraint.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/EqualityConstraint.java @@ -25,7 +25,6 @@ import org.key_project.util.LRUCache; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import static de.uka.ilkd.key.logic.equality.RenamingSourceElementProperty.RENAMING_SOURCE_ELEMENT_PROPERTY; @@ -538,8 +537,8 @@ && compareBoundVariables((QuantifiableVariable) t0.op(), * modified. Constraint.TOP is always returned for ununifiable terms */ private Constraint unifyHelp(JTerm t1, JTerm t2, boolean modifyThis, Services services) { - return unifyHelp(t1, t2, ImmutableSLList.nil(), - ImmutableSLList.nil(), null, modifyThis, services); + return unifyHelp(t1, t2, ImmutableList.nil(), + ImmutableList.nil(), null, modifyThis, services); } @@ -742,8 +741,8 @@ private Constraint joinHelp(EqualityConstraint co, Services services) { * @return a boolean that is true iff. adding a mapping (mv,term) would cause a cycle */ private boolean hasCycle(Metavariable mv, JTerm term, Services services) { - ImmutableList body = ImmutableSLList.nil(); - ImmutableList fringe = ImmutableSLList.nil(); + ImmutableList body = ImmutableList.nil(); + ImmutableList fringe = ImmutableList.nil(); JTerm checkForCycle = term; while (true) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/Instantiation.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/Instantiation.java index 9aab846d447..a112dee0b83 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/Instantiation.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/Instantiation.java @@ -24,7 +24,6 @@ import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; import org.key_project.util.collection.ImmutableMap; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; class Instantiation { @@ -75,7 +74,7 @@ static Instantiation create(Term qf, Sequent seq, Services services) { } private static ImmutableSet sequentToTerms(Sequent seq) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); for (final SequentFormula cf : seq) { res = res.prepend(cf.formula()); } @@ -150,7 +149,7 @@ private void addInstance(Substitution sub, long cost) { */ private ImmutableSet initAssertLiterals(Sequent seq, TermServices services) { - ImmutableList assertLits = ImmutableSLList.nil(); + ImmutableList assertLits = ImmutableList.nil(); for (final SequentFormula cf : seq.antecedent()) { final Term atom = cf.formula(); final var op = atom.op(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/MultiTrigger.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/MultiTrigger.java index 60c9a572163..44a3aa2b9fd 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/MultiTrigger.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/MultiTrigger.java @@ -13,7 +13,6 @@ import org.key_project.util.collection.ImmutableList; import org.key_project.util.collection.ImmutableMap; import org.key_project.util.collection.ImmutableMapEntry; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; class MultiTrigger implements Trigger { @@ -34,7 +33,7 @@ class MultiTrigger implements Trigger { @Override public ImmutableSet getSubstitutionsFromTerms(ImmutableSet targetTerms, Services services) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); ImmutableSet mulsubs = setMultiSubstitution(triggers.iterator(), targetTerms, services); @@ -51,7 +50,7 @@ public ImmutableSet getSubstitutionsFromTerms(ImmutableSet t /** help function for getMultiSubstitution */ private ImmutableSet setMultiSubstitution(Iterator ts, ImmutableSet terms, Services services) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); if (ts.hasNext()) { ImmutableSet subi = ts.next().getSubstitutionsFromTerms(terms, services); ImmutableSet nextSubs = setMultiSubstitution(ts, terms, services); diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/UniTrigger.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/UniTrigger.java index 1461de0b5b2..110d329698d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/UniTrigger.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/UniTrigger.java @@ -14,7 +14,6 @@ import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; import org.key_project.util.collection.ImmutableMap; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; @@ -138,8 +137,8 @@ private static boolean containsLoop(Substitution subst) { private static boolean containsLoop( ImmutableMap varMap, QuantifiableVariable var) { - ImmutableList body = ImmutableSLList.nil(); - ImmutableList fringe = ImmutableSLList.nil(); + ImmutableList body = ImmutableList.nil(); + ImmutableList fringe = ImmutableList.nil(); Term checkForCycle = varMap.get(var); if (checkForCycle.op() == var) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/termProjection/AssumptionProjection.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/termProjection/AssumptionProjection.java index ab235f9aaec..c2a96413741 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/termProjection/AssumptionProjection.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/termProjection/AssumptionProjection.java @@ -40,6 +40,6 @@ public Term toTerm(RuleApp app, PosInOccurrence pos, Goal goal, MutableState mut + " but got " + app; - return tapp.assumesFormulaInstantiations().take(no).head().getSequentFormula().formula(); + return tapp.assumesFormulaInstantiations().get(no).getSequentFormula().formula(); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/MultiplesModEquationsGenerator.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/MultiplesModEquationsGenerator.java index 74da4f6689a..075d3e52f6e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/MultiplesModEquationsGenerator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/MultiplesModEquationsGenerator.java @@ -23,7 +23,6 @@ import org.key_project.prover.strategy.costbased.termProjection.ProjectionToTerm; import org.key_project.prover.strategy.costbased.termgenerator.TermGenerator; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Try to rewrite a monomial (term) source so that it becomes a multiple of another @@ -70,14 +69,14 @@ public Iterator generate(RuleApp app, PosInOccurrence pos, Goal goal, final List cofactorPolys = extractPolys(goal, services); if (cofactorPolys.isEmpty()) { - return ImmutableSLList.nil().iterator(); + return ImmutableList.nil().iterator(); } return computeMultiples(sourceM, targetM, cofactorPolys, services).iterator(); } private Iterator toIterator(Term quotient) { - return ImmutableSLList.nil().prepend(quotient).iterator(); + return ImmutableList.nil().prepend(quotient).iterator(); } /** @@ -89,7 +88,7 @@ private Iterator toIterator(Term quotient) { */ private ImmutableList computeMultiples(Monomial sourceM, Monomial targetM, List cofactorPolys, Services services) { - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); final List cofactorMonos = new ArrayList<>(); cofactorMonos.add(new CofactorMonomial(targetM, Polynomial.ONE)); diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/RootsGenerator.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/RootsGenerator.java index 7219770d147..562305621ff 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/RootsGenerator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/RootsGenerator.java @@ -22,7 +22,7 @@ import org.key_project.prover.strategy.costbased.MutableState; import org.key_project.prover.strategy.costbased.termProjection.ProjectionToTerm; import org.key_project.prover.strategy.costbased.termgenerator.TermGenerator; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import static de.uka.ilkd.key.logic.equality.IrrelevantTermLabelsProperty.IRRELEVANT_TERM_LABELS_PROPERTY; @@ -90,7 +90,7 @@ public Iterator generate(RuleApp app, PosInOccurrence pos, Goal goal, } private Iterator emptyIterator() { - return ImmutableSLList.nil().iterator(); + return ImmutableList.nil().iterator(); } private Iterator toIterator(Term res) { @@ -98,7 +98,7 @@ private Iterator toIterator(Term res) { tb.ff())) { return emptyIterator(); } - return ImmutableSLList.nil().prepend(res).iterator(); + return ImmutableList.nil().prepend(res).iterator(); } private Term breakDownEq(Term p_var, BigInteger lit, int pow) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/TriggeredInstantiations.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/TriggeredInstantiations.java index 68bfc51171a..0c5e81bc76d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/TriggeredInstantiations.java +++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/TriggeredInstantiations.java @@ -36,7 +36,6 @@ import org.key_project.util.collection.DefaultImmutableMap; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; public class TriggeredInstantiations implements TermGenerator { @@ -125,10 +124,10 @@ public Iterator generate(RuleApp app, PosInOccurrenc } else { // at the moment instantiations with more than one // missing taclet variable not supported - return ImmutableSLList.nil().iterator(); + return ImmutableList.nil().iterator(); } } else { - return ImmutableSLList.nil().iterator(); + return ImmutableList.nil().iterator(); } } else { @@ -216,7 +215,7 @@ private HashSet computeInstances(Services services, private ImmutableList instantiateConditions(Services services, TacletApp app, final JTerm middle) { ImmutableList conditions; - conditions = ImmutableSLList.nil(); + conditions = ImmutableList.nil(); for (var singleAvoidCond : app.taclet().getTrigger().avoidConditions()) { conditions = conditions.append( diff --git a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/DefaultTacletTranslator.java b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/DefaultTacletTranslator.java index cebecc710a5..514348f840e 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/DefaultTacletTranslator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/DefaultTacletTranslator.java @@ -22,7 +22,6 @@ import org.key_project.prover.rules.tacletbuilder.TacletGoalTemplate; import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Translates a rewrite taclet to a formula. @@ -164,7 +163,7 @@ public JTerm translate(Taclet taclet, TermServices services) throws IllegalTacle } // translate the replace and add patterns of the taclet. - ImmutableList list = ImmutableSLList.nil(); + ImmutableList list = ImmutableList.nil(); for (TacletGoalTemplate template : taclet.goalTemplates()) { diff --git a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/SkeletonGenerator.java b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/SkeletonGenerator.java index f6480d61668..2355b44c213 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/SkeletonGenerator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/SkeletonGenerator.java @@ -12,7 +12,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; public interface SkeletonGenerator { SkeletonGenerator DEFAULT_TACLET_TRANSLATOR = new DefaultTacletTranslator(); @@ -71,7 +70,7 @@ protected JTerm translate(Sequent s, TermServices services) { * @return A list of all formulae of the semisequent s . */ private ImmutableList getFormulaeOfSemisequent(Semisequent s) { - ImmutableList terms = ImmutableSLList.nil(); + ImmutableList terms = ImmutableList.nil(); for (SequentFormula cf : s) { terms = terms.append((JTerm) cf.formula()); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/DefaultTacletSetTranslation.java b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/DefaultTacletSetTranslation.java index 74d6c5ac8e6..f275e3d6665 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/DefaultTacletSetTranslation.java +++ b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/DefaultTacletSetTranslation.java @@ -25,7 +25,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.java.IOUtil; @@ -42,17 +41,17 @@ public final class DefaultTacletSetTranslation * Translation of the taclets stored in taclets. * */ - private ImmutableList translation = ImmutableSLList.nil(); + private ImmutableList translation = ImmutableList.nil(); /** * Taclets can not be translated because checking the taclet failed. */ - private ImmutableList notTranslated = ImmutableSLList.nil(); + private ImmutableList notTranslated = ImmutableList.nil(); /** * If a instantiation failure occurs the returned information is stored in a String. */ - private final ImmutableList instantiationFailures = ImmutableSLList.nil(); + private final ImmutableList instantiationFailures = ImmutableList.nil(); private ImmutableSet usedFormulaSorts = DefaultImmutableSet.nil(); @@ -95,8 +94,8 @@ public ImmutableList getTranslation(ImmutableSet sorts) { } translate = false; usedSorts.clear(); - notTranslated = ImmutableSLList.nil(); - translation = ImmutableSLList.nil(); + notTranslated = ImmutableList.nil(); + translation = ImmutableList.nil(); ImmutableSet emptySetSort = DefaultImmutableSet.nil(); usedFormulaSorts = (sorts == null ? emptySetSort : sorts); diff --git a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/GenericTranslator.java b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/GenericTranslator.java index 635c66f3868..7f9f9bc1969 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/GenericTranslator.java +++ b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/GenericTranslator.java @@ -24,7 +24,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; class GenericTranslator { @@ -217,7 +216,7 @@ private boolean doInstantiation(GenericSort generic, Sort inst, TacletConditions private ImmutableList instantiateGeneric(JTerm term, Set genericSorts, ImmutableSet instSorts, Taclet t, TacletConditions conditions, int maxGeneric) throws IllegalTacletException { - ImmutableList instantiatedTerms = ImmutableSLList.nil(); + ImmutableList instantiatedTerms = ImmutableList.nil(); if (maxGeneric < genericSorts.size()) { throw new IllegalTacletException("To many different generic sorts. Found: " + genericSorts.size() + " Allowed: " + maxGeneric); diff --git a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/TacletConditions.java b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/TacletConditions.java index 4488832cb7b..859c47c7652 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/TacletConditions.java +++ b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/assumptions/TacletConditions.java @@ -17,7 +17,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.rules.VariableCondition; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * This class is used for wrapping all variable conditions of a taclet in one object. @@ -25,12 +24,12 @@ class TacletConditions { // - private ImmutableList comparisionCondition = ImmutableSLList.nil(); - private ImmutableList typeCondition = ImmutableSLList.nil(); + private ImmutableList comparisionCondition = ImmutableList.nil(); + private ImmutableList typeCondition = ImmutableList.nil(); private ImmutableList abstractInterfaceCondition = - ImmutableSLList.nil(); + ImmutableList.nil(); private ImmutableList arrayComponentCondition = - ImmutableSLList.nil(); + ImmutableList.nil(); diff --git a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/lemma/TacletLoader.java b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/lemma/TacletLoader.java index 0618c9668f2..f7c2e1e9df2 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/lemma/TacletLoader.java +++ b/key.core/src/main/java/de/uka/ilkd/key/taclettranslation/lemma/TacletLoader.java @@ -24,7 +24,6 @@ import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; public abstract class TacletLoader { @@ -82,7 +81,7 @@ protected TacletLoader(ProgressMonitor monitor, ProblemInitializerListener liste public void manageAvailableTaclets(InitConfig initConfig, Taclet tacletToProve) { ImmutableList sysTaclets = initConfig.getTaclets(); - ImmutableList newTaclets = ImmutableSLList.nil(); + ImmutableList newTaclets = ImmutableList.nil(); HashMap> map = initConfig.getTaclet2Builder(); boolean tacletfound = false; for (Taclet taclet : sysTaclets) { @@ -177,7 +176,9 @@ public ImmutableList loadTaclets() throws ProofInputException { ImmutableList listAfter = initConfig.getTaclets(); - return listAfter.take(sizeBefore); + // weigl: This implementation is no good. It assumes that the new Taclets are + // prepended to the Taclet lists. This does have to be the case! + return listAfter.skip(sizeBefore); } @Override diff --git a/key.core/src/main/java/de/uka/ilkd/key/util/HelperClassForTests.java b/key.core/src/main/java/de/uka/ilkd/key/util/HelperClassForTests.java index 46dad6eb07c..e2905b552c3 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/util/HelperClassForTests.java +++ b/key.core/src/main/java/de/uka/ilkd/key/util/HelperClassForTests.java @@ -30,7 +30,6 @@ import de.uka.ilkd.key.strategy.StrategyProperties; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.key_project.util.helper.FindResources; import org.key_project.util.java.CollectionUtil; @@ -51,7 +50,7 @@ public class HelperClassForTests { @Override public RuleCollection getStandardRules() { final var ruleSource = RuleSourceFactory.fromDefaultLocation(ldtFile); - return new RuleCollection(ImmutableList.of(ruleSource), ImmutableSLList.nil()); + return new RuleCollection(ImmutableList.of(ruleSource), ImmutableList.nil()); } }; diff --git a/key.core/src/main/java/de/uka/ilkd/key/util/InfFlowSpec.java b/key.core/src/main/java/de/uka/ilkd/key/util/InfFlowSpec.java index 7d675e3be40..0b8dade9c4d 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/util/InfFlowSpec.java +++ b/key.core/src/main/java/de/uka/ilkd/key/util/InfFlowSpec.java @@ -8,7 +8,6 @@ import de.uka.ilkd.key.logic.JTerm; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** @@ -45,8 +44,8 @@ public InfFlowSpec map(UnaryOperator op) { } private InfFlowSpec() { - this.preExpressions = ImmutableSLList.nil(); - this.postExpressions = ImmutableSLList.nil(); - this.newObjects = ImmutableSLList.nil(); + this.preExpressions = ImmutableList.nil(); + this.postExpressions = ImmutableList.nil(); + this.newObjects = ImmutableList.nil(); } } diff --git a/key.core/src/main/java/de/uka/ilkd/key/util/MiscTools.java b/key.core/src/main/java/de/uka/ilkd/key/util/MiscTools.java index a31c8ed3cb4..87652cef46b 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/util/MiscTools.java +++ b/key.core/src/main/java/de/uka/ilkd/key/util/MiscTools.java @@ -647,7 +647,7 @@ public ImmutableSet getDeclaredPVs() { } public static ImmutableList toTermList(Iterable list, TermBuilder tb) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (var pv : list) { if (pv != null) { JTerm t = tb.var(pv); @@ -676,7 +676,7 @@ public static String toString(InputStream is) throws IOException { public static ImmutableList filterOutDuplicates(ImmutableList localIns, ImmutableList localOuts) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (JTerm localIn : localIns) { if (!localOuts.contains(localIn)) { result = result.append(localIn); diff --git a/key.core/src/main/java/de/uka/ilkd/key/util/ProofStarter.java b/key.core/src/main/java/de/uka/ilkd/key/util/ProofStarter.java index b02e9ba865f..14b5376f566 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/util/ProofStarter.java +++ b/key.core/src/main/java/de/uka/ilkd/key/util/ProofStarter.java @@ -29,7 +29,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -70,7 +69,7 @@ public UserProvidedInput(Sequent seq, ProofEnvironment env, @Nullable String pro public UserProvidedInput(JTerm formula, ProofEnvironment env) { this( JavaDLSequentKit.createSuccSequent( - ImmutableSLList.nil().prepend(new SequentFormula(formula))), + ImmutableList.nil().prepend(new SequentFormula(formula))), env); } diff --git a/key.core/src/main/java/de/uka/ilkd/key/util/mergerule/MergeRuleUtils.java b/key.core/src/main/java/de/uka/ilkd/key/util/mergerule/MergeRuleUtils.java index 2fe6a1d92e8..45cdd3f3da0 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/util/mergerule/MergeRuleUtils.java +++ b/key.core/src/main/java/de/uka/ilkd/key/util/mergerule/MergeRuleUtils.java @@ -1071,7 +1071,7 @@ public static SymbolicExecutionStateWithProgCnt sequentToSETriple(Node node, PosInOccurrence pio, Services services) { ImmutableList pathConditionSet = - ImmutableSLList.nil(); + ImmutableList.nil(); pathConditionSet = pathConditionSet.prepend(node.sequent().antecedent().asList()); var selected = pio.subTerm(); @@ -1110,7 +1110,7 @@ public static SymbolicExecutionStateWithProgCnt sequentToSETriple(Node node, */ public static ImmutableList sequentsToSEPairs( Iterable sequentInfos) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (MergePartner sequentInfo : sequentInfos) { final Node node = sequentInfo.getGoal().node(); final Services services = sequentInfo.getGoal().proof().getServices(); @@ -1351,7 +1351,7 @@ private static Pair> anonymizeProgramV TermBuilder tb = services.getTermBuilder(); ImmutableSet freeVars = term.freeVars(); - ImmutableList elementaries = ImmutableSLList.nil(); + ImmutableList elementaries = ImmutableList.nil(); for (LocationVariable loc : getLocationVariables(term, services)) { final String newName = tb.newName(stripIndex(loc.name().toString())); @@ -1505,8 +1505,8 @@ private static JTerm joinConjuctiveElements(final Collection elems, Servi boolean doSplit, String sideProofName, int timeout) throws ProofInputException { return tryToProve(// Sequent to prove - JavaDLSequentKit.createSequent(ImmutableSLList.nil(), - ImmutableSLList.singleton(new SequentFormula(toProve))), + JavaDLSequentKit.createSequent(ImmutableList.nil(), + ImmutableList.singleton(new SequentFormula(toProve))), services, doSplit, sideProofName, timeout); } @@ -1632,7 +1632,7 @@ private static JTerm simplify(Proof parentProof, JTerm term, int timeout) if (openGoals.isEmpty()) { return tb.tt(); } else { - ImmutableList goalImplications = ImmutableSLList.nil(); + ImmutableList goalImplications = ImmutableList.nil(); for (Goal goal : openGoals) { JTerm goalImplication = sequentToFormula(goal.sequent(), services); goalImplications = goalImplications.append(goalImplication); @@ -1654,8 +1654,8 @@ private static JTerm simplify(Proof parentProof, JTerm term, int timeout) private static JTerm sequentToFormula(Sequent sequent, Services services) { TermBuilder tb = services.getTermBuilder(); - ImmutableList negAntecedentForms = ImmutableSLList.nil(); - ImmutableList succedentForms = ImmutableSLList.nil(); + ImmutableList negAntecedentForms = ImmutableList.nil(); + ImmutableList succedentForms = ImmutableList.nil(); // Shift antecedent formulae to the succedent by negation for (SequentFormula sf : sequent.antecedent().asList()) { diff --git a/key.core/src/test/java/de/uka/ilkd/key/logic/TestClashFreeSubst.java b/key.core/src/test/java/de/uka/ilkd/key/logic/TestClashFreeSubst.java index ee60cfb3a18..e255971964e 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/logic/TestClashFreeSubst.java +++ b/key.core/src/test/java/de/uka/ilkd/key/logic/TestClashFreeSubst.java @@ -19,7 +19,7 @@ import org.key_project.logic.op.Operator; import org.key_project.logic.op.QuantifiableVariable; import org.key_project.logic.sort.Sort; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; @@ -150,7 +150,7 @@ public void visit(final Term p_visited) { } subStack.pop(); subStack.push(tb.all( - ImmutableSLList.nil().append(bv), top.sub(0))); + ImmutableList.nil().append(bv), top.sub(0))); return; } } diff --git a/key.core/src/test/java/de/uka/ilkd/key/logic/TestTerm.java b/key.core/src/test/java/de/uka/ilkd/key/logic/TestTerm.java index 7784de7deff..c3992e8b757 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/logic/TestTerm.java +++ b/key.core/src/test/java/de/uka/ilkd/key/logic/TestTerm.java @@ -17,7 +17,7 @@ import org.key_project.logic.op.QuantifiableVariable; import org.key_project.logic.sort.Sort; import org.key_project.util.collection.ImmutableArray; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -106,7 +106,7 @@ public void testFreeVars4() { JTerm t_allxt1 = tb.all(x, t2()); JTerm t_allxt1_andt2 = tf.createTerm(Junctor.AND, t_allxt1, t1()); JTerm t_exw_allxt1_andt2 = - tb.ex(ImmutableSLList.nil().append(w, x), t_allxt1_andt2); + tb.ex(ImmutableList.nil().append(w, x), t_allxt1_andt2); assertTrue(!t_exw_allxt1_andt2.freeVars().contains(w) && !t_exw_allxt1_andt2.freeVars().contains(x)); } diff --git a/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermFactory.java b/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermFactory.java index 80489f2a6ae..20d05b06963 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermFactory.java +++ b/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermFactory.java @@ -17,7 +17,7 @@ import org.key_project.logic.sort.Sort; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableArray; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -146,7 +146,7 @@ public void testConstantTrue() { @Test public void testQuantifierTerm() { - JTerm t_forallx_px = TB.all(ImmutableSLList.nil().append(x), t1()); + JTerm t_forallx_px = TB.all(ImmutableList.nil().append(x), t1()); assertEquals(t_forallx_px, new TermImpl(Quantifier.ALL, new ImmutableArray<>(t1()), new ImmutableArray<>(x), null)); } @@ -221,7 +221,7 @@ public void testSubtermsForLogicVariable() { public void testQuantifierWithNoBoundSubTerms() { JTerm result = null; try { - result = TB.all(ImmutableSLList.nil(), t1()); + result = TB.all(ImmutableList.nil(), t1()); } catch (TermCreationException e) { } assertEquals(result, t1()); diff --git a/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermLabelManager.java b/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermLabelManager.java index 2724eb01899..37648085ca4 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermLabelManager.java +++ b/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermLabelManager.java @@ -36,7 +36,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableArray; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.junit.jupiter.api.Assertions; @@ -612,38 +611,38 @@ protected InitConfig createTestServices(final TermLabelPolicy applicationTermPol Profile profile = new JavaProfile() { @Override protected ImmutableList computeTermLabelConfiguration() { - ImmutableList applicationTermPolicies = ImmutableSLList.nil(); + ImmutableList applicationTermPolicies = ImmutableList.nil(); if (applicationTermPolicy != null) { applicationTermPolicies = applicationTermPolicies.prepend(applicationTermPolicy); } - ImmutableList modalityTermPolicies = ImmutableSLList.nil(); + ImmutableList modalityTermPolicies = ImmutableList.nil(); if (modalityTermPolicy != null) { modalityTermPolicies = modalityTermPolicies.prepend(modalityTermPolicy); } ImmutableList directChildTermLabelPolicies = - ImmutableSLList.nil(); + ImmutableList.nil(); if (directChildPolicy != null) { directChildTermLabelPolicies = directChildTermLabelPolicies.prepend(directChildPolicy); } ImmutableList childAndGrandchildTermLabelPolicies = - ImmutableSLList.nil(); + ImmutableList.nil(); if (childAndGrandchildPolicy != null) { childAndGrandchildTermLabelPolicies = childAndGrandchildTermLabelPolicies.prepend(childAndGrandchildPolicy); } - ImmutableList termLabelUpdates = ImmutableSLList.nil(); + ImmutableList termLabelUpdates = ImmutableList.nil(); if (update != null) { termLabelUpdates = termLabelUpdates.prepend(update); } ImmutableList termLabelRefactorings = - ImmutableSLList.nil(); + ImmutableList.nil(); if (refactoring != null) { termLabelRefactorings = termLabelRefactorings.prepend(refactoring); } - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); result = result.prepend(new TermLabelConfiguration(new Name("ONE"), new LoggingFactory(new Name("ONE")), applicationTermPolicies, modalityTermPolicies, directChildTermLabelPolicies, @@ -678,7 +677,7 @@ protected ImmutableList computeTermLabelConfiguration() private static class LoggingTermLabelRefactoring implements TermLabelRefactoring { private final RefactoringScope scope; - private ImmutableList supportedRuleNames = ImmutableSLList.nil(); + private ImmutableList supportedRuleNames = ImmutableList.nil(); public LoggingTermLabelRefactoring(RefactoringScope scope, String... supportedRules) { this.scope = scope; @@ -723,7 +722,7 @@ public void refactorLabels(TermLabelState state, Services services, private static class LoggingTermLabelUpdate implements TermLabelUpdate { private final TermLabel toAdd; - private ImmutableList supportedRuleNames = ImmutableSLList.nil(); + private ImmutableList supportedRuleNames = ImmutableList.nil(); public LoggingTermLabelUpdate(TermLabel toAdd, String... supportedRules) { this.toAdd = toAdd; @@ -749,7 +748,7 @@ public void updateLabels(TermLabelState state, Services services, } private static class LoggingChildTermLabelPolicy implements ChildTermLabelPolicy { - private ImmutableList supportedRuleNames = ImmutableSLList.nil(); + private ImmutableList supportedRuleNames = ImmutableList.nil(); private final List log = new LinkedList<>(); diff --git a/key.core/src/test/java/de/uka/ilkd/key/logic/TestVariableNamer.java b/key.core/src/test/java/de/uka/ilkd/key/logic/TestVariableNamer.java index 51e85abbd33..886142ac945 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/logic/TestVariableNamer.java +++ b/key.core/src/test/java/de/uka/ilkd/key/logic/TestVariableNamer.java @@ -29,7 +29,7 @@ import org.key_project.logic.PosInTerm; import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.prover.sequent.*; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.Test; @@ -84,8 +84,8 @@ private PosInOccurrence constructPIO(SequentFormula formula) { private Goal constructGoal(SequentFormula containedFormula) { - final var empty = ImmutableSLList.nil(); - final var ante = ImmutableSLList.singleton(containedFormula); + final var empty = ImmutableList.nil(); + final var ante = ImmutableList.singleton(containedFormula); Sequent seq = JavaDLSequentKit.createSequent(ante, empty); Node node = new Node(proof, seq); diff --git a/key.core/src/test/java/de/uka/ilkd/key/parser/TestTacletParser.java b/key.core/src/test/java/de/uka/ilkd/key/parser/TestTacletParser.java index e4d4113b97e..6576e97e5d1 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/parser/TestTacletParser.java +++ b/key.core/src/test/java/de/uka/ilkd/key/parser/TestTacletParser.java @@ -26,7 +26,7 @@ import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -104,13 +104,13 @@ public SequentFormula cf(String s) { } public Sequent sequent(String a, String s) { - var antec = ImmutableSLList.nil(); - var succ = ImmutableSLList.nil(); + var antec = ImmutableList.nil(); + var succ = ImmutableList.nil(); if (a != null) { - antec = ImmutableSLList.singleton(cf(a)); + antec = ImmutableList.singleton(cf(a)); } if (s != null) { - succ = ImmutableSLList.singleton(cf(s)); + succ = ImmutableList.singleton(cf(s)); } return JavaDLSequentKit.createSequent(antec, succ); } @@ -136,11 +136,11 @@ public void testImpLeft() { builder.setName(new Name("imp_left")); builder.addTacletGoalTemplate( new AntecSuccTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), sequent("b0", null))); + ImmutableList.nil(), sequent("b0", null))); builder.addTacletGoalTemplate( new AntecSuccTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), sequent(null, "b"))); + ImmutableList.nil(), sequent(null, "b"))); Taclet impleft = builder.getAntecTaclet(); String impleftString = @@ -156,7 +156,7 @@ public void testImpRight() { builder.setFind(parseFma("b->b0")); builder.addTacletGoalTemplate( new AntecSuccTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), sequent("b", "b0"))); + ImmutableList.nil(), sequent("b", "b0"))); builder.setName(new Name("imp_right")); Taclet impright = builder.getSuccTaclet(); String imprightString = "imp_right{\\find(==> b->b0) \\replacewith(b ==> b0)}"; @@ -170,10 +170,10 @@ public void testCut() { // add(b=>) add(=>b) NoFindTacletBuilder builder = new NoFindTacletBuilder(); builder.addTacletGoalTemplate( - new TacletGoalTemplate(sequent("b", null), ImmutableSLList.nil())); + new TacletGoalTemplate(sequent("b", null), ImmutableList.nil())); builder.addTacletGoalTemplate( - new TacletGoalTemplate(sequent(null, "b"), ImmutableSLList.nil())); + new TacletGoalTemplate(sequent(null, "b"), ImmutableList.nil())); builder.setName(new Name("cut")); Taclet cut = builder.getNoFindTaclet(); @@ -203,7 +203,7 @@ public void testContraposition() { builder.setFind(parseFma("b->b0")); builder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), parseFma("!b0->!b"))); + ImmutableList.nil(), parseFma("!b0->!b"))); builder.setName(new Name("contraposition")); Taclet contraposition = builder.getRewriteTaclet(); String contrapositionString = "contraposition{\\find(b->b0) \\replacewith(!b0 -> !b)}"; @@ -220,7 +220,7 @@ public void testAllRight() { builder.setFind(parseFma("\\forall z; b")); builder.addTacletGoalTemplate( new AntecSuccTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), sequent(null, "{\\subst z; sk}b"))); + ImmutableList.nil(), sequent(null, "{\\subst z; sk}b"))); builder.addVarsNewDependingOn(lookup_schemavar("sk"), lookup_schemavar("b")); builder.setName(new Name("all_right")); Taclet allright = builder.getSuccTaclet(); @@ -239,7 +239,7 @@ public void testAllLeft() { builder.addTacletGoalTemplate( - new TacletGoalTemplate(sequent("{\\subst z; x}b", null), ImmutableSLList.nil())); + new TacletGoalTemplate(sequent("{\\subst z; x}b", null), ImmutableList.nil())); builder.setName(new Name("all_left")); Taclet allleft = builder.getAntecTaclet(); String allleftString = "all_left{\\find(\\forall z; b==>) \\add({\\subst z; x}b==>)}"; @@ -257,7 +257,7 @@ public void testExConjSplit() { builder.addVarsNotFreeIn(lookup_schemavar("z"), lookup_schemavar("b")); builder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), parseFma("b & \\exists z; b0"))); + ImmutableList.nil(), parseFma("b & \\exists z; b0"))); builder.setName(new Name("exists_conj_split")); Taclet exconjsplit = builder.getRewriteTaclet(); String exconjsplitString = @@ -276,7 +276,7 @@ public void testFIdempotent() { builder.setFind(parseTerm("f(f(x))")); builder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), parseTerm("f(x)"))); + ImmutableList.nil(), parseTerm("f(x)"))); builder.setName(new Name("f_idempotent")); Taclet fidempotent = builder.getRewriteTaclet(); String fidempotentString = "f_idempotent{\\find(f(f(x))) \\replacewith(f(x))}"; @@ -291,7 +291,7 @@ public void testMakeInsertEq() { insertbuilder.setFind(parseTerm("x")); insertbuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), parseTerm("x0"))); + ImmutableList.nil(), parseTerm("x0"))); insertbuilder.setName(new Name("insert_eq")); Taclet inserteq = insertbuilder.getTaclet(); @@ -300,7 +300,7 @@ public void testMakeInsertEq() { builder.setFind(parseFma("x=x0")); builder.addTacletGoalTemplate( new TacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil().prepend(inserteq))); + ImmutableList.nil().prepend(inserteq))); builder.setName(new Name("make_insert_eq")); Taclet makeinserteq = builder.getAntecTaclet(); String makeinserteqString = "make_insert_eq" + "{\\find (x = x0 ==>)" diff --git a/key.core/src/test/java/de/uka/ilkd/key/proof/TestGoal.java b/key.core/src/test/java/de/uka/ilkd/key/proof/TestGoal.java index df53833028f..a06a4175f29 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/proof/TestGoal.java +++ b/key.core/src/test/java/de/uka/ilkd/key/proof/TestGoal.java @@ -14,7 +14,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -45,7 +44,7 @@ public void tearDown() { @Test public void testSetBack0() { Sequent seq = JavaDLSequentKit.createSuccSequent( - ImmutableSLList.singleton(new SequentFormula(TacletForTests.parseTerm("A")))); + ImmutableList.singleton(new SequentFormula(TacletForTests.parseTerm("A")))); final InitConfig initConfig = new InitConfig(new Services(AbstractProfile.getDefaultProfile())); @@ -87,7 +86,7 @@ public void testSetBack0() { @Test public void testSetBack1() throws Exception { Sequent seq = JavaDLSequentKit.createSuccSequent( - ImmutableSLList.singleton(new SequentFormula(TacletForTests.parseTerm("A")))); + ImmutableList.singleton(new SequentFormula(TacletForTests.parseTerm("A")))); Node root = new Node(proof, seq); proof.setRoot(root); Goal g = new Goal(root, TacletIndexKit.getKit().createTacletIndex(), diff --git a/key.core/src/test/java/de/uka/ilkd/key/proof/TestProofTree.java b/key.core/src/test/java/de/uka/ilkd/key/proof/TestProofTree.java index f550defe39d..e157a712ece 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/proof/TestProofTree.java +++ b/key.core/src/test/java/de/uka/ilkd/key/proof/TestProofTree.java @@ -19,7 +19,7 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -66,19 +66,19 @@ public void setUp() { JTerm t_b7 = tf.createTerm(Equality.EQUALS, tf.createTerm(b7), tf.createTerm(b7)); Sequent s1 = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(t_b1)), ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(t_b1)), ImmutableList.nil()); Sequent s2 = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(t_b2)), ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(t_b2)), ImmutableList.nil()); Sequent s3 = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(t_b3)), ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(t_b3)), ImmutableList.nil()); Sequent s4 = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(t_b4)), ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(t_b4)), ImmutableList.nil()); Sequent s5 = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(t_b5)), ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(t_b5)), ImmutableList.nil()); Sequent s6 = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(t_b6)), ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(t_b6)), ImmutableList.nil()); Sequent s7 = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(t_b7)), ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(t_b7)), ImmutableList.nil()); p = new Proof("TestProofTree", new InitConfig(new Services(AbstractProfile.getDefaultProfile()))); diff --git a/key.core/src/test/java/de/uka/ilkd/key/proof/TestTacletIndex.java b/key.core/src/test/java/de/uka/ilkd/key/proof/TestTacletIndex.java index 95b2174f7a2..6ffe4a4a479 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/proof/TestTacletIndex.java +++ b/key.core/src/test/java/de/uka/ilkd/key/proof/TestTacletIndex.java @@ -23,7 +23,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -119,7 +118,7 @@ private boolean isRuleIn(ImmutableList l, TacletApp rule) { @Disabled public void disabled_testNonInteractiveIsShownOnlyIfHeuristicIsMissed() { JTerm term_p1 = TacletForTests.parseTerm("p(one, zero)"); - ImmutableList listofHeuristic = ImmutableSLList.nil(); + ImmutableList listofHeuristic = ImmutableList.nil(); listofHeuristic = listofHeuristic.prepend(h3); PosInOccurrence pos = new PosInOccurrence(new SequentFormula(term_p1), PosInTerm.getTopLevel(), true); @@ -137,7 +136,7 @@ public void disabled_testNonInteractiveIsShownOnlyIfHeuristicIsMissed() { assertTrue( isRuleIn( - variante_one.getNoFindTaclet(new IHTacletFilter(true, ImmutableSLList.nil()), null), + variante_one.getNoFindTaclet(new IHTacletFilter(true, ImmutableList.nil()), null), ruleNoFindNonH1H2H3), "Noninteractive nofindrule is not in list, but none of its " + "heuristics is active."); @@ -152,7 +151,7 @@ public void disabled_testNonInteractiveIsShownOnlyIfHeuristicIsMissed() { @Test public void testShownIfHeuristicFits() { Services services = new Services(AbstractProfile.getDefaultProfile()); - ImmutableList listofHeuristic = ImmutableSLList.nil(); + ImmutableList listofHeuristic = ImmutableList.nil(); listofHeuristic = listofHeuristic.prepend(h3).prepend(h2); JTerm term_p1 = TacletForTests.parseTerm("p(one, zero)"); @@ -186,7 +185,7 @@ public void testShownIfHeuristicFits() { @Test public void testNoMatchingFindRule() { Services services = new Services(AbstractProfile.getDefaultProfile()); - ImmutableList listofHeuristic = ImmutableSLList.nil(); + ImmutableList listofHeuristic = ImmutableList.nil(); JTerm term_p2 = TacletForTests.parseTerm("\\forall nat z; p(z, one)").sub(0); @@ -222,7 +221,7 @@ public void testMatchConflictOccurs() { JTerm term_p4 = TacletForTests.parseTerm("p(zero, one)"); - ImmutableList listofHeuristic = ImmutableSLList.nil(); + ImmutableList listofHeuristic = ImmutableList.nil(); PosInOccurrence posAntec = new PosInOccurrence(new SequentFormula(term_p4), PosInTerm.getTopLevel(), true); @@ -241,7 +240,7 @@ public void testNotFreeInYConflict() { JTerm term_p5 = TacletForTests.parseTerm("\\forall nat z; p(f(z), z)"); SequentFormula cfma_p5 = new SequentFormula(term_p5); Sequent seq_p5 = JavaDLSequentKit.createAnteSequent( - ImmutableSLList.singleton(cfma_p5)); + ImmutableList.singleton(cfma_p5)); PosInOccurrence pio_p5 = new PosInOccurrence(cfma_p5, PosInTerm.getTopLevel(), true); RuleAppIndex appIdx = createGoalFor(seq_p5, ruleIdx); @@ -254,7 +253,7 @@ public void testNotFreeInYConflict() { SequentFormula cfma_p6 = new SequentFormula(term_p6); Sequent seq_p6 = JavaDLSequentKit.createAnteSequent( - ImmutableSLList.singleton(cfma_p6)); + ImmutableList.singleton(cfma_p6)); PosInOccurrence pio_p6 = new PosInOccurrence(cfma_p6, PosInTerm.getTopLevel(), true); appIdx = createGoalFor(seq_p6, ruleIdx); diff --git a/key.core/src/test/java/de/uka/ilkd/key/proof/TestTermTacletAppIndex.java b/key.core/src/test/java/de/uka/ilkd/key/proof/TestTermTacletAppIndex.java index c1b5208c2c6..6860c322c91 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/proof/TestTermTacletAppIndex.java +++ b/key.core/src/test/java/de/uka/ilkd/key/proof/TestTermTacletAppIndex.java @@ -23,7 +23,6 @@ import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.LRUCache; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -171,7 +170,7 @@ private PosInOccurrence down( private void checkTermIndex(PosInOccurrence pio, TermTacletAppIndex termIdx) { - ImmutableList listA = ImmutableSLList.nil(); + ImmutableList listA = ImmutableList.nil(); ImmutableList listB = listA.prepend(remove_f.taclet()); ImmutableList listC = listA.prepend(remove_zero.taclet()); @@ -185,7 +184,7 @@ private void checkTermIndex(PosInOccurrence pio, private void checkTermIndex2(PosInOccurrence pio, TermTacletAppIndex termIdx) { - ImmutableList listA = ImmutableSLList.nil(); + ImmutableList listA = ImmutableList.nil(); ImmutableList listB = listA.prepend(remove_f.taclet()); ImmutableList listC = listA.prepend(remove_zero.taclet()); @@ -198,7 +197,7 @@ private void checkTermIndex2(PosInOccurrence pio, private void checkTermIndex3(PosInOccurrence pio, TermTacletAppIndex termIdx) { - ImmutableList listA = ImmutableSLList.nil(); + ImmutableList listA = ImmutableList.nil(); ImmutableList listB = listA.prepend(remove_f.taclet()); ImmutableList listC = listA.prepend(remove_zero.taclet()); ImmutableList listD = listB.prepend(remove_ff.taclet()); diff --git a/key.core/src/test/java/de/uka/ilkd/key/proof/calculus/TestSemisequent.java b/key.core/src/test/java/de/uka/ilkd/key/proof/calculus/TestSemisequent.java index b8e80e7db6d..2ed44c9c93e 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/proof/calculus/TestSemisequent.java +++ b/key.core/src/test/java/de/uka/ilkd/key/proof/calculus/TestSemisequent.java @@ -18,7 +18,6 @@ import org.key_project.prover.sequent.SemisequentChangeInfo; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -244,7 +243,7 @@ public void testListInsert() { Semisequent expected = extract( extract(extract(origin.insertLast(con[4])).insertLast(con[5])).insertLast(con[6])); - ImmutableList insertionList = ImmutableSLList + ImmutableList insertionList = ImmutableList .nil() .prepend(con[0]).prepend(con[1]).prepend(con[6]).prepend(con[5]).prepend(con[4]); Semisequent result = extract(origin.insert(origin.size(), insertionList)); @@ -260,7 +259,7 @@ public void testListInsertInMid() { .insertLast(con[2])); Semisequent expected = extract(extract(extract(origin.insert(2, con[4])).insert(3, con[5])).insert(4, con[6])); - ImmutableList insertionList = ImmutableSLList + ImmutableList insertionList = ImmutableList .nil() .prepend(con[0]).prepend(con[1]).prepend(con[6]).prepend(con[5]).prepend(con[4]); Semisequent result = extract(origin.insert(origin.size() - 1, insertionList)); @@ -273,7 +272,7 @@ public void testListReplace() { // [p,q,r] Semisequent origin = JavaDLSequentKit .createAnteSequent( - ImmutableSLList.nil().prepend(con[0], con[1], con[2])) + ImmutableList.nil().prepend(con[0], con[1], con[2])) .antecedent(); // [p,q,a,b,c] Semisequent expected = JavaDLSequentKit @@ -281,15 +280,15 @@ public void testListReplace() { .antecedent(); // insert: [a,b,c,q,p] ImmutableList insertionList = - ImmutableSLList.nil().prepend(con[4], con[5], con[6], con[1], con[0]); + ImmutableList.nil().prepend(con[4], con[5], con[6], con[1], con[0]); SemisequentChangeInfo result = origin.replace(origin.size() - 1, insertionList); assertEquals( - ImmutableSLList.singleton(con[4]).prepend(con[5]).prepend(con[6]), + ImmutableList.singleton(con[4]).prepend(con[5]).prepend(con[6]), result.addedFormulas(), "SemisequentChangeInfo is corrupt due to wrong added formula list:"); - assertEquals(ImmutableSLList.singleton(con[2]), + assertEquals(ImmutableList.singleton(con[2]), result.removedFormulas(), "SemisequentChangeInfo is corrupt due to wrong removed formula list:"); assertEquals(expected, extract(result), "Both semisequents should be equal."); @@ -308,16 +307,16 @@ public void testListReplaceAddRedundantList() { .insertLast(con[2])); // insert:[a,b,c,r,r,q,p] ImmutableList insertionList = - ImmutableSLList.singleton(con[0]).prepend(con[1]).prepend(con[2]) + ImmutableList.singleton(con[0]).prepend(con[1]).prepend(con[2]) .prepend(con[3]).prepend(con[6]).prepend(con[5]).prepend(con[4]); SemisequentChangeInfo sci = origin.replace(origin.size(), insertionList); assertEquals( - ImmutableSLList.singleton(con[4]).prepend(con[5]).prepend(con[6]) + ImmutableList.singleton(con[4]).prepend(con[5]).prepend(con[6]) .prepend(con[3]), sci.addedFormulas(), "SemisequentChangeInfo is corrupt due to wrong added formula list:"); - assertEquals(ImmutableSLList.nil(), sci.removedFormulas(), + assertEquals(ImmutableList.nil(), sci.removedFormulas(), "SemisequentChangeInfo is corrupt due to wrong removed formula list:"); assertEquals(expected, extract(sci), "Both semisequents should be equal."); } @@ -325,7 +324,7 @@ public void testListReplaceAddRedundantList() { @Test void constructorTest() { var a = JavaDLSequentKit.emptySemisequent(); - var b = JavaDLSequentKit.createAnteSequent(ImmutableSLList.nil()).antecedent(); + var b = JavaDLSequentKit.createAnteSequent(ImmutableList.nil()).antecedent(); assertSame(a, b); } diff --git a/key.core/src/test/java/de/uka/ilkd/key/rule/CreateTacletForTests.java b/key.core/src/test/java/de/uka/ilkd/key/rule/CreateTacletForTests.java index 3067ec7a17f..212b12bc632 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/rule/CreateTacletForTests.java +++ b/key.core/src/test/java/de/uka/ilkd/key/rule/CreateTacletForTests.java @@ -23,7 +23,7 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -141,7 +141,7 @@ public void createNatTaclets() { rwb1.setFind(t_rn); rwb1.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), + ImmutableList.nil(), t_0)); @@ -152,11 +152,11 @@ public void createNatTaclets() { rwbuilder.setFind(t_rnminus1plus1); rwbuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), + ImmutableList.nil(), t_rn)); rwbuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil().prepend(rwb1.getTaclet()), t_0plus1)); + ImmutableList.nil().prepend(rwb1.getTaclet()), t_0plus1)); rwbuilder.setName(new Name("pred-succ-elim")); pluszeroelim = rwbuilder.getRewriteTaclet(); @@ -166,7 +166,7 @@ public void createNatTaclets() { rwbuilder.setFind(tf.createTerm(func_plus, t_rn, t_0)); rwbuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), + ImmutableList.nil(), t_rn)); rwbuilder.setName(new Name("plus-zero-elim")); predsuccelim = rwbuilder.getRewriteTaclet(); @@ -177,7 +177,7 @@ public void createNatTaclets() { rwbuilder.setFind(tf.createTerm(func_plus, t_0, t_rn)); rwbuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), + ImmutableList.nil(), t_rn)); rwbuilder.setName(new Name("zero-plus-elim")); zeropluselim = rwbuilder.getRewriteTaclet(); @@ -204,7 +204,7 @@ public void createNatTaclets() { rwbuilder.setFind(t_rnplus1plusrm); rwbuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), t_rnplusrmplus1)); + ImmutableList.nil(), t_rnplusrmplus1)); rwbuilder.setName(new Name("switch-first-succ")); switchfirstsucc = rwbuilder.getRewriteTaclet(); @@ -218,7 +218,7 @@ public void createNatTaclets() { rwbuilder.setFind(t_rnplus_rmplus1); rwbuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), t_rnplusrmplus1)); + ImmutableList.nil(), t_rnplusrmplus1)); rwbuilder.setName(new Name("switch-second-succ")); switchsecondsucc = rwbuilder.getRewriteTaclet(); @@ -229,7 +229,7 @@ public void createNatTaclets() { rwbuilder.setFind(tf.createTerm(func_eq, t_rnplus1, t_rmplus1)); rwbuilder.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), + ImmutableList.nil(), t_rneqrm)); rwbuilder.setName(new Name("succ-elim")); succelim = rwbuilder.getRewriteTaclet(); @@ -272,11 +272,11 @@ public void setUp() throws IOException { SequentFormula cf = new SequentFormula(t_test1); SequentFormula cf2 = new SequentFormula(t_test1); seq_test1 = - JavaDLSequentKit.createSequent(ImmutableSLList.nil(), ImmutableSLList.singleton(cf)); + JavaDLSequentKit.createSequent(ImmutableList.nil(), ImmutableList.singleton(cf)); seq_test2 = - JavaDLSequentKit.createSequent(ImmutableSLList.singleton(cf), ImmutableSLList.nil()); - seq_test3 = JavaDLSequentKit.createSequent(ImmutableSLList.singleton(cf), - ImmutableSLList.singleton(cf2)); + JavaDLSequentKit.createSequent(ImmutableList.singleton(cf), ImmutableList.nil()); + seq_test3 = JavaDLSequentKit.createSequent(ImmutableList.singleton(cf), + ImmutableList.singleton(cf2)); func_p = new JFunction(new Name("P"), JavaDLTheory.FORMULA, sort1); @@ -304,16 +304,16 @@ public void setUp() throws IOException { JTerm tnat = tf.createTerm(Junctor.IMP, t_eq1, t_eq2); // => (c+d) = ((d -1 +1) +c) -> (c +1)+d = (d+c) +1 - seq_testNat = JavaDLSequentKit.createSequent(ImmutableSLList.nil(), - ImmutableSLList.singleton(new SequentFormula(tnat))); + seq_testNat = JavaDLSequentKit.createSequent(ImmutableList.nil(), + ImmutableList.singleton(new SequentFormula(tnat))); z = new LogicVariable(new Name("z"), sort1); JTerm t_z = tf.createTerm(z); JTerm t_allzpz = services.getTermBuilder().all(z, tf.createTerm(func_p, t_z)); SequentFormula cf3 = new SequentFormula(t_allzpz); - seq_testAll = JavaDLSequentKit.createSequent(ImmutableSLList.nil(), - ImmutableSLList.singleton(cf3)); + seq_testAll = JavaDLSequentKit.createSequent(ImmutableList.nil(), + ImmutableList.singleton(cf3)); diff --git a/key.core/src/test/java/de/uka/ilkd/key/rule/TacletForTests.java b/key.core/src/test/java/de/uka/ilkd/key/rule/TacletForTests.java index 1af03de5017..9e5b3ffd6f9 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/rule/TacletForTests.java +++ b/key.core/src/test/java/de/uka/ilkd/key/rule/TacletForTests.java @@ -30,7 +30,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.rules.RuleSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -67,7 +66,7 @@ private TacletForTests() {} public RuleCollection getStandardRules() { return new RuleCollection( ImmutableList.of(RuleSourceFactory.fromDefaultLocation(ldtFile)), - ImmutableSLList.nil()); + ImmutableList.nil()); } }; diff --git a/key.core/src/test/java/de/uka/ilkd/key/rule/TestApplyTaclet.java b/key.core/src/test/java/de/uka/ilkd/key/rule/TestApplyTaclet.java index dc2573e839e..e61c338a98c 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/rule/TestApplyTaclet.java +++ b/key.core/src/test/java/de/uka/ilkd/key/rule/TestApplyTaclet.java @@ -24,7 +24,6 @@ import org.key_project.prover.sequent.*; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.junit.jupiter.api.AfterEach; @@ -84,10 +83,10 @@ public class TestApplyTaclet { private static ImmutableList parseTermForSemisequent(String t) { if ("".equals(t)) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } SequentFormula cf0 = new SequentFormula(TacletForTests.parseTerm(t)); - return ImmutableSLList.singleton(cf0); + return ImmutableList.singleton(cf0); } @BeforeEach @@ -162,7 +161,7 @@ public void testAddingRule() { assertEquals(seq.succedent().getFirst().formula(), fma.sub(1), "Wrong succedent after imp_right_add"); ImmutableList nfapp = goals.head().indexOfTaclets() - .getNoFindTaclet(new IHTacletFilter(true, ImmutableSLList.nil()), null); + .getNoFindTaclet(new IHTacletFilter(true, ImmutableList.nil()), null); JTerm aimpb = TacletForTests.parseTerm("A -> B"); assertEquals(1, nfapp.size(), "Cut Rule should be inserted to TacletIndex."); assertEquals( @@ -601,7 +600,7 @@ public void testModalityLevel0() { assertEquals(4, rApplist.size(), "Expected four rule applications."); - ImmutableList appList = ImmutableSLList.nil(); + ImmutableList appList = ImmutableList.nil(); for (TacletApp aRApplist : rApplist) { appList = appList.prepend(aRApplist.findIfFormulaInstantiations(goal.sequent(), services)); @@ -633,7 +632,7 @@ public void testModalityLevel1() { assertEquals(3, rApplist.size(), "Expected three rule applications."); - ImmutableList appList = ImmutableSLList.nil(); + ImmutableList appList = ImmutableList.nil(); Iterator appIt = rApplist.iterator(); while (appIt.hasNext()) { appList = @@ -644,7 +643,7 @@ public void testModalityLevel1() { JTerm ifterm = TacletForTests.parseTerm("{i:=0}(f(const)=f(f(const)))"); SequentFormula ifformula = new SequentFormula(ifterm); - ImmutableList ifInsts = ImmutableSLList + ImmutableList ifInsts = ImmutableList .nil() .prepend(new AssumesFormulaInstDirect(ifformula)); appIt = rApplist.iterator(); diff --git a/key.core/src/test/java/de/uka/ilkd/key/rule/TestCollisionResolving.java b/key.core/src/test/java/de/uka/ilkd/key/rule/TestCollisionResolving.java index f59885280e9..03502817a70 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/rule/TestCollisionResolving.java +++ b/key.core/src/test/java/de/uka/ilkd/key/rule/TestCollisionResolving.java @@ -22,7 +22,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.sequent.*; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -223,7 +222,7 @@ public void testNameConflict1() { FindTaclet taclet = (FindTaclet) TacletForTests.getTaclet("TestCollisionResolving_name_conflict").taclet(); final ImmutableList semiseq = - ImmutableSLList + ImmutableList .singleton(new SequentFormula(TacletForTests.parseTerm("\\forall s x; p(x)"))) .append(new SequentFormula(TacletForTests.parseTerm("\\exists s x; p(x)"))); Sequent seq = JavaDLSequentKit.createSuccSequent(semiseq); diff --git a/key.core/src/test/java/de/uka/ilkd/key/rule/TestMatchTaclet.java b/key.core/src/test/java/de/uka/ilkd/key/rule/TestMatchTaclet.java index 9cefe7b356f..87cf73e9aa4 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/rule/TestMatchTaclet.java +++ b/key.core/src/test/java/de/uka/ilkd/key/rule/TestMatchTaclet.java @@ -28,7 +28,7 @@ import org.key_project.prover.rules.instantiation.MatchResultInfo; import org.key_project.prover.sequent.*; import org.key_project.util.collection.DefaultImmutableSet; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -137,8 +137,8 @@ public void testVarOccursInIfAndAddRule() { // therefore no match should be found Sequent seq = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(match.sub(0))), - ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(match.sub(0))), + ImmutableList.nil()); assertEquals(0, NoPosTacletApp.createNoPosTacletApp(if_addrule_conflict) @@ -148,8 +148,8 @@ public void testVarOccursInIfAndAddRule() { // we bind the free variable now a match should be found seq = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(match)), - ImmutableSLList.nil()); + ImmutableList.singleton(new SequentFormula(match)), + ImmutableList.nil()); assertNotEquals(0, NoPosTacletApp.createNoPosTacletApp(if_addrule_conflict) @@ -258,15 +258,15 @@ public void testCloseWithBoundRenaming() { JTerm closeable_one = TacletForTests.parseTerm("\\forall testSort z; p(z)"); JTerm closeable_two = TacletForTests.parseTerm("\\forall testSort y; p(y)"); Sequent seq = JavaDLSequentKit.createSequent( - ImmutableSLList.singleton(new SequentFormula(closeable_one)), - ImmutableSLList.singleton(new SequentFormula(closeable_two))); + ImmutableList.singleton(new SequentFormula(closeable_one)), + ImmutableList.singleton(new SequentFormula(closeable_two))); TacletIndex index = TacletIndexKit.getKit().createTacletIndex(); index.add(close_rule.taclet()); PosInOccurrence pio = new PosInOccurrence(new SequentFormula(closeable_two), PosInTerm.getTopLevel(), false); TacletApp tacletApp = - index.getSuccedentTaclet(pio, new IHTacletFilter(true, ImmutableSLList.nil()), services) + index.getSuccedentTaclet(pio, new IHTacletFilter(true, ImmutableList.nil()), services) .iterator().next(); assertTrue(tacletApp.findIfFormulaInstantiations(seq, services).size() > 0, "Match should be possible(modulo renaming)"); diff --git a/key.core/src/test/java/de/uka/ilkd/key/rule/TestSchemaModalOperators.java b/key.core/src/test/java/de/uka/ilkd/key/rule/TestSchemaModalOperators.java index d6d455f3b59..a80836fc945 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/rule/TestSchemaModalOperators.java +++ b/key.core/src/test/java/de/uka/ilkd/key/rule/TestSchemaModalOperators.java @@ -25,7 +25,6 @@ import org.key_project.prover.sequent.*; import org.key_project.util.collection.DefaultImmutableSet; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.junit.jupiter.api.AfterEach; @@ -51,10 +50,10 @@ public class TestSchemaModalOperators { private static ImmutableList parseTermForSemisequent(String t) { if ("".equals(t)) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } SequentFormula cf0 = new SequentFormula(TacletForTests.parseTerm(t)); - return ImmutableSLList.singleton(cf0); + return ImmutableList.singleton(cf0); } @BeforeEach @@ -145,7 +144,7 @@ public void testSchemaModalities1() { rtb.setFind(find); rtb.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), + ImmutableList.nil(), replace)); RewriteTaclet t = rtb.getRewriteTaclet(); diff --git a/key.core/src/test/java/de/uka/ilkd/key/rule/inst/TestGenericSortInstantiations.java b/key.core/src/test/java/de/uka/ilkd/key/rule/inst/TestGenericSortInstantiations.java index 3781a1b9622..ac64cfc38bd 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/rule/inst/TestGenericSortInstantiations.java +++ b/key.core/src/test/java/de/uka/ilkd/key/rule/inst/TestGenericSortInstantiations.java @@ -181,7 +181,7 @@ public void setUp() { public static ImmutableList sorts( ImmutableList p_conditions) { Iterator it = p_conditions.iterator(); - ImmutableList res = ImmutableSLList.nil(); + ImmutableList res = ImmutableList.nil(); while (it.hasNext()) { res = res.prepend(it.next().getGenericSort()); @@ -202,7 +202,7 @@ public void testGeneric1() { ImmutableList cs; GenericSortInstantiations gsi; - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A4)); Services services = TacletForTests.services(); @@ -217,7 +217,7 @@ public void testGeneric1() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A4), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A2)); @@ -231,7 +231,7 @@ public void testGeneric1() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A4), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A6)); @@ -239,7 +239,7 @@ public void testGeneric1() { assertEquals(DefaultImmutableMap.nilMap().put(G1, JavaDLTheory.ANY), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, B1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, B5)); @@ -256,7 +256,7 @@ public void testGeneric2() { Services services = TacletForTests.services(); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, A2)); @@ -264,7 +264,7 @@ public void testGeneric2() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A1).put(G2, A2), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, B3)); @@ -272,7 +272,7 @@ public void testGeneric2() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A1).put(G2, B3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, B3)); @@ -315,7 +315,7 @@ public void testGeneric2Array() { Services services = TacletForTests.services(); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, A2)); @@ -323,7 +323,7 @@ public void testGeneric2Array() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A1).put(G2, A2), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, D3)); @@ -331,7 +331,7 @@ public void testGeneric2Array() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A1).put(G2, D3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, D3)); @@ -374,7 +374,7 @@ public void testGeneric3() { Services services = TacletForTests.services(); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, A2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G3, A5)); @@ -384,7 +384,7 @@ public void testGeneric3() { DefaultImmutableMap.nilMap().put(G1, A1).put(G2, A2).put(G3, A3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A5)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, A2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G3, A5)); @@ -394,7 +394,7 @@ public void testGeneric3() { DefaultImmutableMap.nilMap().put(G1, A5).put(G2, A2).put(G3, A3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A5)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, A2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G3, A5)); @@ -405,7 +405,7 @@ public void testGeneric3() { .put(G3, A3).put(G4, A1), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A5)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, A2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G3, A5)); @@ -417,7 +417,7 @@ public void testGeneric3() { .put(G3, JavaDLTheory.ANY).put(G4, B1), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, B2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G4, A5)); @@ -436,7 +436,7 @@ public void testGeneric4() { Services services = TacletForTests.services(); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(G1, A4)); gsi = GenericSortInstantiations.create(sorts(cs), cs, services); @@ -449,7 +449,7 @@ public void testGeneric4() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A4), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createIdentityCondition(G1, A2)); @@ -459,7 +459,7 @@ public void testGeneric4() { } catch (GenericSortException e) { } - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1)); cs = cs.prepend(GenericSortCondition.createIdentityCondition(G1, A2)); @@ -469,21 +469,21 @@ public void testGeneric4() { } catch (GenericSortException e) { } - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H2, A3)); gsi = GenericSortInstantiations.create(sorts(cs), cs, services); assertEquals(DefaultImmutableMap.nilMap().put(H2, A3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(H2, A5)); gsi = GenericSortInstantiations.create(sorts(cs), cs, services); assertEquals(DefaultImmutableMap.nilMap().put(H2, A3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H2, A4)); try { @@ -492,21 +492,21 @@ public void testGeneric4() { } catch (GenericSortException e) { } - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H3, A1)); gsi = GenericSortInstantiations.create(sorts(cs), cs, services); assertEquals(DefaultImmutableMap.nilMap().put(H3, A1), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(H3, A1)); gsi = GenericSortInstantiations.create(sorts(cs), cs, services); assertEquals(DefaultImmutableMap.nilMap().put(H3, A1), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H3, A6)); try { @@ -525,7 +525,7 @@ public void testGeneric5() { Services services = TacletForTests.services(); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H1, A4)); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H2, A3)); @@ -533,7 +533,7 @@ public void testGeneric5() { assertEquals(DefaultImmutableMap.nilMap().put(H1, A4).put(H2, A3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(H1, A6)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(H2, A5)); @@ -542,7 +542,7 @@ public void testGeneric5() { DefaultImmutableMap.nilMap().put(H1, JavaDLTheory.ANY).put(H2, A3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H2, A4)); try { gsi = GenericSortInstantiations.create(sorts(cs), cs, services); @@ -551,7 +551,7 @@ public void testGeneric5() { } - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(H1, A2)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(H2, A5)); @@ -559,7 +559,7 @@ public void testGeneric5() { assertEquals(DefaultImmutableMap.nilMap().put(H1, A3).put(H2, A3), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(H1, A2)); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H3, A5)); @@ -567,7 +567,7 @@ public void testGeneric5() { assertEquals(DefaultImmutableMap.nilMap().put(H1, A3).put(H3, A5), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H1, A2)); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H3, A5)); @@ -577,7 +577,7 @@ public void testGeneric5() { } catch (GenericSortException e) { } - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(H4, A6)); try { @@ -596,7 +596,7 @@ public void testGeneric6() { Services services = TacletForTests.services(); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(G1, A4)); cs = cs.prepend(GenericSortCondition.createForceInstantiationCondition(G4, true)); cs = cs.prepend(GenericSortCondition.createForceInstantiationCondition(G3, false)); @@ -613,7 +613,7 @@ public void testGeneric6() { DefaultImmutableMap.nilMap().put(G1, A4).put(G4, A4).put(G3, A4), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createIdentityCondition(G1, A5)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G2, A2)); cs = cs.prepend(GenericSortCondition.createForceInstantiationCondition(G3, false)); @@ -630,7 +630,7 @@ public void testGeneric6() { .put(G3, A3).put(G4, A5), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createForceInstantiationCondition(H3, true)); gsi = GenericSortInstantiations.create(sorts(cs), cs, services); @@ -646,10 +646,10 @@ public void testNullsort() { Services services = TacletForTests.services(); Sort nullSort = new NullSort(services.getJavaInfo().objectSort()); - services.getNamespaces().sorts().add(ImmutableSLList.nil().prepend(A1OBJ) + services.getNamespaces().sorts().add(ImmutableList.nil().prepend(A1OBJ) .prepend(A2OBJ).prepend(A3OBJ).prepend(A4OBJ).prepend(A5OBJ).prepend(A6OBJ)); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1OBJ)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, nullSort)); @@ -663,7 +663,7 @@ public void testNullsort() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A3OBJ), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, nullSort)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, A1OBJ)); @@ -671,7 +671,7 @@ public void testNullsort() { assertEquals(DefaultImmutableMap.nilMap().put(G1, A1OBJ), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, C1)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, nullSort)); @@ -679,7 +679,7 @@ public void testNullsort() { assertEquals(DefaultImmutableMap.nilMap().put(G1, JavaDLTheory.ANY), gsi.getAllInstantiations(), "Instantiations should be equal"); - cs = ImmutableSLList.nil(); + cs = ImmutableList.nil(); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, nullSort)); cs = cs.prepend(GenericSortCondition.createSupersortCondition(G1, C1)); diff --git a/key.core/src/test/java/de/uka/ilkd/key/rule/tacletbuilder/TestTacletBuild.java b/key.core/src/test/java/de/uka/ilkd/key/rule/tacletbuilder/TestTacletBuild.java index ba5068422a3..ea2554e403a 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/rule/tacletbuilder/TestTacletBuild.java +++ b/key.core/src/test/java/de/uka/ilkd/key/rule/tacletbuilder/TestTacletBuild.java @@ -22,7 +22,7 @@ import org.key_project.logic.op.sv.SchemaVariable; import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -63,7 +63,7 @@ public void test0() { sb.setFind(t1); sb.addTacletGoalTemplate( new RewriteTacletGoalTemplate(JavaDLSequentKit.getInstance().getEmptySequent(), - ImmutableSLList.nil(), + ImmutableList.nil(), t2)); boolean thrown = false; try { @@ -86,7 +86,7 @@ public void testUniquenessOfIfAndFindVarSVsInIfAndFind() { NO_SUBTERMS); JTerm t1 = tb.all((QuantifiableVariable) u, A); Sequent seq = - JavaDLSequentKit.createSuccSequent(ImmutableSLList.singleton(new SequentFormula(t1))); + JavaDLSequentKit.createSuccSequent(ImmutableList.singleton(new SequentFormula(t1))); JTerm t2 = tb.ex((QuantifiableVariable) u, A); SuccTacletBuilder sb = new SuccTacletBuilder(); sb.setIfSequent(seq); @@ -109,7 +109,7 @@ public void testUniquenessOfIfAndFindVarSVBothInIf() { JTerm t1 = tb.all((QuantifiableVariable) u, A); JTerm t2 = tb.ex((QuantifiableVariable) u, A); Sequent seq = JavaDLSequentKit - .createSuccSequent(ImmutableSLList.singleton(new SequentFormula(t2)) + .createSuccSequent(ImmutableList.singleton(new SequentFormula(t2)) .prepend(new SequentFormula(t1))); SuccTacletBuilder sb = new SuccTacletBuilder(); sb.setIfSequent(seq); diff --git a/key.core/src/test/java/de/uka/ilkd/key/speclang/ContractFactoryTest.java b/key.core/src/test/java/de/uka/ilkd/key/speclang/ContractFactoryTest.java index 3d4d8a1b957..05d8518082d 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/speclang/ContractFactoryTest.java +++ b/key.core/src/test/java/de/uka/ilkd/key/speclang/ContractFactoryTest.java @@ -21,7 +21,6 @@ import de.uka.ilkd.key.util.HelperClassForTests; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.junit.jupiter.api.BeforeEach; @@ -167,7 +166,7 @@ private JTerm calculateCombinedModifiableWOLabels(String contractStr) JMLSpecFactory jsf = new JMLSpecFactory(services); ImmutableList constructs = preParser.parseClassLevel(contractStr); - ImmutableList signature = ImmutableSLList.nil(); + ImmutableList signature = ImmutableList.nil(); signature = signature.append(javaInfo.getKeYJavaType(PrimitiveType.JAVA_INT)); IProgramMethod pm = javaInfo.getProgramMethod(testClassType, "m", signature, testClassType); diff --git a/key.core/src/test/java/de/uka/ilkd/key/speclang/SetStatementTest.java b/key.core/src/test/java/de/uka/ilkd/key/speclang/SetStatementTest.java index 8c14c283833..4bc49589e78 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/speclang/SetStatementTest.java +++ b/key.core/src/test/java/de/uka/ilkd/key/speclang/SetStatementTest.java @@ -24,7 +24,6 @@ import de.uka.ilkd.key.util.HelperClassForTests; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -86,7 +85,7 @@ public synchronized void setUp() { .context(Context.inClass(testClassType, false, services.getTermBuilder())) .selfVar(selfVar) .parameters( - ImmutableSLList.nil().append(ghostLocal, normalLocal)); + ImmutableList.nil().append(ghostLocal, normalLocal)); } @Test diff --git a/key.core/src/test/java/de/uka/ilkd/key/speclang/jml/TestJMLTranslator.java b/key.core/src/test/java/de/uka/ilkd/key/speclang/jml/TestJMLTranslator.java index b8421f4e694..df9e740e275 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/speclang/jml/TestJMLTranslator.java +++ b/key.core/src/test/java/de/uka/ilkd/key/speclang/jml/TestJMLTranslator.java @@ -25,7 +25,6 @@ import org.key_project.logic.op.Operator; import org.key_project.logic.op.QuantifiableVariable; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -153,7 +152,7 @@ public void testSumParsing() { public void testParenExpression() { ProgramElementName classPEN = new ProgramElementName("o"); LocationVariable var = new LocationVariable(classPEN, testClassType); - jmlIO.parameters(ImmutableSLList.singleton(var)).parseExpression("(o.i)"); + jmlIO.parameters(ImmutableList.singleton(var)).parseExpression("(o.i)"); } @Test @@ -168,7 +167,7 @@ public void testPrimitiveField() { public void testSimpleQuery() { ProgramVariable selfVar = buildSelfVarAsProgVar(); IProgramMethod getOne = javaInfo.getProgramMethod(testClassType, "getOne", - ImmutableSLList.nil(), testClassType); + ImmutableList.nil(), testClassType); JTerm result = jmlIO.parseExpression("this.getOne()"); assertNotNull(result); assertTrue(termContains(result, selfVar)); @@ -319,7 +318,7 @@ public void testOld() { public void testResultVar() { LocationVariable excVar = buildExcVar(); - ImmutableList signature = ImmutableSLList.nil(); + ImmutableList signature = ImmutableList.nil(); IProgramMethod pm = javaInfo.getProgramMethod(testClassType, "getOne", signature, testClassType); @@ -367,7 +366,7 @@ public void testHexLiteral() { @Test public void testComplexQueryResolving1() { - ImmutableList signature = ImmutableSLList.nil(); + ImmutableList signature = ImmutableList.nil(); signature = signature.append(javaInfo.getKeYJavaType(PrimitiveType.JAVA_INT)); IProgramMethod pm = javaInfo.getProgramMethod(testClassType, "m", signature, testClassType); @@ -382,7 +381,7 @@ public void testComplexQueryResolving1() { @Test public void testComplexQueryResolving2() { - ImmutableList signature = ImmutableSLList.nil(); + ImmutableList signature = ImmutableList.nil(); signature = signature.append(javaInfo.getKeYJavaType(PrimitiveType.JAVA_LONG)); IProgramMethod pm = javaInfo.getProgramMethod(testClassType, "m", signature, testClassType); @@ -397,7 +396,7 @@ public void testComplexQueryResolving2() { @Test public void testComplexQueryResolving3() { - ImmutableList signature = ImmutableSLList.nil(); + ImmutableList signature = ImmutableList.nil(); signature = signature.append(javaInfo.getKeYJavaType(PrimitiveType.JAVA_INT)); IProgramMethod pm = javaInfo.getProgramMethod(testClassType, "m", signature, testClassType); @@ -412,7 +411,7 @@ public void testComplexQueryResolving3() { @Test public void testStaticQueryResolving() { - ImmutableList signature = ImmutableSLList.nil(); + ImmutableList signature = ImmutableList.nil(); IProgramMethod pm = javaInfo.getProgramMethod(testClassType, "staticMethod", signature, testClassType); diff --git a/key.core/src/test/java/de/uka/ilkd/key/speclang/njml/ExpressionTranslatorTest.java b/key.core/src/test/java/de/uka/ilkd/key/speclang/njml/ExpressionTranslatorTest.java index e8e0530784d..bd877307577 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/speclang/njml/ExpressionTranslatorTest.java +++ b/key.core/src/test/java/de/uka/ilkd/key/speclang/njml/ExpressionTranslatorTest.java @@ -13,7 +13,7 @@ import de.uka.ilkd.key.logic.op.LocationVariable; import de.uka.ilkd.key.rule.TacletForTests; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.antlr.v4.runtime.CommonTokenStream; import org.junit.jupiter.api.Assertions; @@ -55,7 +55,7 @@ public void parseAndInterpret(String expr) { JmlParser.ExpressionContext ctx = parser.expressionEOF().expression(); Assertions.assertEquals(0, parser.getNumberOfSyntaxErrors()); Translator et = new Translator(services, kjt, self, SpecMathMode.defaultMode(), - ImmutableSLList.nil(), result, exc, new HashMap<>(), new HashMap<>()); + ImmutableList.nil(), result, exc, new HashMap<>(), new HashMap<>()); LOGGER.debug("{}", ctx.accept(et)); } } diff --git a/key.core/src/test/java/de/uka/ilkd/key/util/TestSearchNodePreorderIterator.java b/key.core/src/test/java/de/uka/ilkd/key/util/TestSearchNodePreorderIterator.java index 81580c0f114..21b38140525 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/util/TestSearchNodePreorderIterator.java +++ b/key.core/src/test/java/de/uka/ilkd/key/util/TestSearchNodePreorderIterator.java @@ -11,7 +11,6 @@ import de.uka.ilkd.key.proof.init.InitConfig; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.Test; @@ -111,7 +110,7 @@ public void testEmptyRoot() { protected void assertRoot(Node root) { // List children NodePreorderIterator iter = new NodePreorderIterator(root); - ImmutableList childList = ImmutableSLList.nil(); + ImmutableList childList = ImmutableList.nil(); while (iter.hasNext()) { Node next = iter.next(); childList = childList.append(next); @@ -119,7 +118,7 @@ protected void assertRoot(Node root) { // Test each child while (!childList.isEmpty()) { assertPreorder(childList.head(), childList); - childList = childList.take(1); + childList = childList.tail(); } } @@ -135,7 +134,7 @@ protected void assertPreorder(Node start, ImmutableList expectedChildList) while (iter.hasNext()) { Node previous = iter.next(); assertEquals(previous, expectedChildList.head()); - expectedChildList = expectedChildList.take(1); // Remove head + expectedChildList = expectedChildList.tail(); // Remove head } assertTrue(expectedChildList.isEmpty(), "Child list still contains " + expectedChildList.size() + " elements."); diff --git a/key.core/src/test/java/de/uka/ilkd/key/util/TestSearchNodeReversePreorderIterator.java b/key.core/src/test/java/de/uka/ilkd/key/util/TestSearchNodeReversePreorderIterator.java index 6b0a5ac5cfc..3540d566737 100644 --- a/key.core/src/test/java/de/uka/ilkd/key/util/TestSearchNodeReversePreorderIterator.java +++ b/key.core/src/test/java/de/uka/ilkd/key/util/TestSearchNodeReversePreorderIterator.java @@ -11,7 +11,6 @@ import de.uka.ilkd.key.proof.init.InitConfig; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.Test; @@ -110,7 +109,7 @@ public void testEmptyRoot() { */ protected void assertRoot(Node root) { NodePreorderIterator iter = new NodePreorderIterator(root); - ImmutableList reverseList = ImmutableSLList.nil(); + ImmutableList reverseList = ImmutableList.nil(); while (iter.hasNext()) { Node next = iter.next(); reverseList = reverseList.prepend(next); @@ -131,7 +130,7 @@ protected void assertReversePreorder(Node start, ImmutableList expectedRev while (reverseIter.hasPrevious()) { Node previous = reverseIter.previous(); assertEquals(previous, expectedReverseList.head()); - expectedReverseList = expectedReverseList.take(1); // Remove head + expectedReverseList = expectedReverseList.tail(); // Remove head } assertTrue(expectedReverseList.isEmpty(), "Reverse still contains " + expectedReverseList.size() + " elements."); diff --git a/key.ncore.calculus/src/main/java/org/key_project/prover/indexing/FormulaTagManager.java b/key.ncore.calculus/src/main/java/org/key_project/prover/indexing/FormulaTagManager.java index dab030d35cc..9149b9d2ccc 100644 --- a/key.ncore.calculus/src/main/java/org/key_project/prover/indexing/FormulaTagManager.java +++ b/key.ncore.calculus/src/main/java/org/key_project/prover/indexing/FormulaTagManager.java @@ -10,7 +10,6 @@ import org.key_project.prover.proof.ProofGoal; import org.key_project.prover.sequent.*; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -267,7 +266,7 @@ public String toString() { public final long age; public FormulaInfo(PosInOccurrence pio, long age) { - this(pio, ImmutableSLList.nil(), age); + this(pio, ImmutableList.nil(), age); } private FormulaInfo(PosInOccurrence pio, ImmutableList modifications, diff --git a/key.ncore.calculus/src/main/java/org/key_project/prover/rules/TacletExecutor.java b/key.ncore.calculus/src/main/java/org/key_project/prover/rules/TacletExecutor.java index f1b8ce98fba..6ce8fa1b738 100644 --- a/key.ncore.calculus/src/main/java/org/key_project/prover/rules/TacletExecutor.java +++ b/key.ncore.calculus/src/main/java/org/key_project/prover/rules/TacletExecutor.java @@ -15,7 +15,6 @@ import org.key_project.prover.rules.instantiation.SVInstantiations; import org.key_project.prover.sequent.*; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.jspecify.annotations.NonNull; @@ -75,7 +74,7 @@ protected ImmutableList checkAssumesGoals(Goal p_goal, } if (res == null) { - res = ImmutableSLList.nil(); + res = ImmutableList.nil(); for (int j = 0; j < p_numberOfNewGoals + 1; j++) { // noinspection unchecked res = res.prepend( @@ -106,7 +105,7 @@ protected ImmutableList checkAssumesGoals(Goal p_goal, } if (res == null) { - res = ImmutableSLList.nil(); + res = ImmutableList.nil(); for (int j = 0; j < p_numberOfNewGoals; j++) { // noinspection unchecked res = res.prepend(SequentChangeInfo.createSequentChangeInfo(p_goal.sequent())); @@ -325,7 +324,7 @@ protected abstract Term syntacticalReplace(Term term, protected ImmutableList instantiateSemisequent(Semisequent semi, PosInOccurrence applicationPosInOccurrence, MatchResultInfo matchCond, Goal goal, App tacletApp, LogicServices services, Object... instantiationInfo) { - ImmutableList replacements = ImmutableSLList.nil(); + ImmutableList replacements = ImmutableList.nil(); for (final SequentFormula sf : semi) { replacements = replacements.append(instantiateReplacement(sf, services, diff --git a/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/Semisequent.java b/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/Semisequent.java index 88b152e1c46..1c0c36b5064 100644 --- a/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/Semisequent.java +++ b/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/Semisequent.java @@ -6,7 +6,6 @@ import java.util.Iterator; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -29,12 +28,12 @@ protected Semisequent(ImmutableList seqList) { /// used by inner class Empty protected Semisequent() { - seqList = ImmutableSLList.nil(); + seqList = ImmutableList.nil(); } /// creates a new [Semisequent] with the [Semisequent] elements in seqList private Semisequent(SequentFormula seqFormula) { - this(ImmutableSLList.singleton(seqFormula)); + this(ImmutableList.singleton(seqFormula)); } /// inserts an element at a specified index performing redundancy checks, this may result in @@ -117,7 +116,7 @@ protected SemisequentChangeInfo insertAndRemoveRedundancyHelper(int idx, final var orig = semiCI.getFormulaList(); pos = Math.min(idx, orig.size()); - searchList = semiCI.getFormulaList().take(pos).prepend(sequentFormula); + searchList = semiCI.getFormulaList().skip(pos).prepend(sequentFormula); while (pos > 0) { --pos; @@ -182,7 +181,7 @@ public SequentFormula get(int idx) { if (idx < 0 || idx >= seqList.size()) { throw new IndexOutOfBoundsException(); } - return seqList.take(idx).head(); + return seqList.get(idx); } /// @return the first [SequentFormula] of this [Semisequent] diff --git a/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/SemisequentChangeInfo.java b/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/SemisequentChangeInfo.java index 6cb691ae14d..2d79fe61abd 100644 --- a/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/SemisequentChangeInfo.java +++ b/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/SemisequentChangeInfo.java @@ -4,20 +4,19 @@ package org.key_project.prover.sequent; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; public class SemisequentChangeInfo { /// contains the added formulas to the semisequent - private ImmutableList added = ImmutableSLList.nil(); + private ImmutableList added = ImmutableList.nil(); /// contains the removed formulas from the semisequent - private ImmutableList removed = ImmutableSLList.nil(); + private ImmutableList removed = ImmutableList.nil(); /// contains the modified formulas from the semisequent - private ImmutableList modified = ImmutableSLList.nil(); + private ImmutableList modified = ImmutableList.nil(); /// stores the redundance free formula list of the semisequent - private ImmutableList modifiedSemisequent = ImmutableSLList.nil(); + private ImmutableList modifiedSemisequent = ImmutableList.nil(); /// contains formulas that have been tried to add, but which have been rejected due to already /// existing formulas in the sequent subsuming these formulas - private ImmutableList rejected = ImmutableSLList.nil(); + private ImmutableList rejected = ImmutableList.nil(); /// private int lastFormulaIndex = -1; diff --git a/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/Sequent.java b/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/Sequent.java index 232064588ad..1669d04b41b 100644 --- a/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/Sequent.java +++ b/key.ncore.calculus/src/main/java/org/key_project/prover/sequent/Sequent.java @@ -8,7 +8,6 @@ import org.key_project.logic.SyntaxElement; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; @@ -419,7 +418,7 @@ public boolean isEmpty() { @Override public @NonNull Iterator iterator() { - return ImmutableSLList.nil().iterator(); + return ImmutableList.nil().iterator(); } } diff --git a/key.ncore.calculus/src/main/java/org/key_project/prover/strategy/costbased/feature/instantiator/BackTrackingManager.java b/key.ncore.calculus/src/main/java/org/key_project/prover/strategy/costbased/feature/instantiator/BackTrackingManager.java index 3f036e3ae60..61b66075a56 100644 --- a/key.ncore.calculus/src/main/java/org/key_project/prover/strategy/costbased/feature/instantiator/BackTrackingManager.java +++ b/key.ncore.calculus/src/main/java/org/key_project/prover/strategy/costbased/feature/instantiator/BackTrackingManager.java @@ -8,7 +8,7 @@ import java.util.Iterator; import org.key_project.prover.rules.RuleApp; -import org.key_project.util.collection.ImmutableSLList; +import org.key_project.util.collection.ImmutableList; import org.jspecify.annotations.Nullable; @@ -148,7 +148,7 @@ private void addChoicePoint(ChoicePoint cp) { } private void cancelChoicePoint() { - pushChoices(ImmutableSLList.nil().iterator(), null); + pushChoices(ImmutableList.nil().iterator(), null); } diff --git a/key.ncore.calculus/src/main/java/org/key_project/prover/strategy/costbased/termgenerator/SubtermGenerator.java b/key.ncore.calculus/src/main/java/org/key_project/prover/strategy/costbased/termgenerator/SubtermGenerator.java index 2439a197f05..10ee268ba4a 100644 --- a/key.ncore.calculus/src/main/java/org/key_project/prover/strategy/costbased/termgenerator/SubtermGenerator.java +++ b/key.ncore.calculus/src/main/java/org/key_project/prover/strategy/costbased/termgenerator/SubtermGenerator.java @@ -15,7 +15,6 @@ import org.key_project.prover.strategy.costbased.termProjection.ProjectionToTerm; import org.key_project.prover.strategy.costbased.termfeature.TermFeature; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.NonNull; @@ -78,7 +77,7 @@ abstract static class SubIterator implements Iterator { protected final LogicServices services; protected SubIterator(Term t, MutableState mState, LogicServices services) { - termStack = ImmutableSLList.nil().prepend(t); + termStack = ImmutableList.nil().prepend(t); this.mState = mState; this.services = services; } diff --git a/key.ui/examples/standard_key/pred_log/count.key.proof b/key.ui/examples/standard_key/pred_log/count.key.proof index 2a195cd2ec2..6ef3c4d5b01 100644 --- a/key.ui/examples/standard_key/pred_log/count.key.proof +++ b/key.ui/examples/standard_key/pred_log/count.key.proof @@ -89,12 +89,12 @@ } \proof { -(keyLog "0" (keyUser "bubel" ) (keyVersion "2adca9ec049c92ef6637857798b152e80f8dc971")) +(keyLog "0" (keyUser "weigl" ) (keyVersion "818f1480eb586a735ccec080221b21748cbbb435")) -(autoModeTime "3") +(autoModeTime "11") (branch "dummy ID" -(rule "impRight" (formula "1") (newnames "heapAtPre,savedHeapAtPre,arg0AtPre,arg1AtPre,heapAtPre,savedHeapAtPre,arg0AtPre,arg1AtPre,heapAtPre,savedHeapAtPre,arg0AtPre,heapAtPre,savedHeapAtPre,vAtPre")) +(rule "impRight" (formula "1") (newnames "heapAtPre,savedHeapAtPre,arg0AtPre,heapAtPre,savedHeapAtPre,arg0AtPre,arg1AtPre,heapAtPre,savedHeapAtPre,arg0AtPre,arg1AtPre,heapAtPre,savedHeapAtPre,vAtPre")) (rule "andLeft" (formula "1")) (rule "polySimp_addComm0" (formula "1") (term "0,1,0")) (rule "nnf_imp2or" (formula "1") (term "0")) diff --git a/key.ui/examples/standard_key/pred_log/equalities2.key.proof b/key.ui/examples/standard_key/pred_log/equalities2.key.proof index 72416fe4660..d532d0aee8c 100644 --- a/key.ui/examples/standard_key/pred_log/equalities2.key.proof +++ b/key.ui/examples/standard_key/pred_log/equalities2.key.proof @@ -86,12 +86,12 @@ } \proof { -(keyLog "0" (keyUser "bubel" ) (keyVersion "2adca9ec049c92ef6637857798b152e80f8dc971")) +(keyLog "0" (keyUser "weigl" ) (keyVersion "818f1480eb586a735ccec080221b21748cbbb435")) -(autoModeTime "3") +(autoModeTime "13") (branch "dummy ID" -(rule "impRight" (formula "1") (newnames "heapAtPre,savedHeapAtPre,arg0AtPre,heapAtPre,savedHeapAtPre,arg0AtPre,arg1AtPre,heapAtPre,savedHeapAtPre,arg0AtPre,arg1AtPre,heapAtPre,savedHeapAtPre,vAtPre")) +(rule "impRight" (formula "1") (newnames "heapAtPre,savedHeapAtPre,arg0AtPre,arg1AtPre,heapAtPre,savedHeapAtPre,arg0AtPre,arg1AtPre,heapAtPre,savedHeapAtPre,arg0AtPre,heapAtPre,savedHeapAtPre,vAtPre")) (rule "andLeft" (formula "1")) (rule "eqSymm" (formula "1")) (rule "polySimp_homoEq" (formula "2")) diff --git a/key.ui/src/main/java/de/uka/ilkd/key/gui/InvariantConfigurator.java b/key.ui/src/main/java/de/uka/ilkd/key/gui/InvariantConfigurator.java index 936266bea56..78adabf075a 100644 --- a/key.ui/src/main/java/de/uka/ilkd/key/gui/InvariantConfigurator.java +++ b/key.ui/src/main/java/de/uka/ilkd/key/gui/InvariantConfigurator.java @@ -31,7 +31,6 @@ import org.key_project.logic.sort.Sort; import org.key_project.prover.rules.RuleAbortException; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import static java.lang.String.format; @@ -1007,10 +1006,10 @@ protected ImmutableList parseInfFlowSpec(LocationVariable heap) { // TODO: allow more than one term JTerm newObjects = parser.parseExpression(newObjectsAsString); - return ImmutableSLList.nil() - .append(new InfFlowSpec(ImmutableSLList.nil().append(preExps), - ImmutableSLList.nil().append(postExps), - ImmutableSLList.nil().append(newObjects))); + return ImmutableList.nil() + .append(new InfFlowSpec(ImmutableList.nil().append(preExps), + ImmutableList.nil().append(postExps), + ImmutableList.nil().append(newObjects))); } protected JTerm parseVariant() { diff --git a/key.ui/src/main/java/de/uka/ilkd/key/gui/actions/useractions/RunStrategyOnNodeUserAction.java b/key.ui/src/main/java/de/uka/ilkd/key/gui/actions/useractions/RunStrategyOnNodeUserAction.java index 9e7eeea57b2..6c3ebe3d212 100644 --- a/key.ui/src/main/java/de/uka/ilkd/key/gui/actions/useractions/RunStrategyOnNodeUserAction.java +++ b/key.ui/src/main/java/de/uka/ilkd/key/gui/actions/useractions/RunStrategyOnNodeUserAction.java @@ -9,7 +9,6 @@ import de.uka.ilkd.key.proof.Proof; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * User action to start auto mode on a specific goal. @@ -58,7 +57,7 @@ protected void apply() { // which implements the functionality. // No functionality is allowed in this method body! mediator.getUI().getProofControl().startAutoMode(r.getSelectedProof(), - ImmutableSLList.nil().prepend(invokedGoal)); + ImmutableList.nil().prepend(invokedGoal)); } } } diff --git a/key.ui/src/main/java/de/uka/ilkd/key/gui/mergerule/MergePartnerSelectionDialog.java b/key.ui/src/main/java/de/uka/ilkd/key/gui/mergerule/MergePartnerSelectionDialog.java index c0b39df75f6..e1638727f27 100644 --- a/key.ui/src/main/java/de/uka/ilkd/key/gui/mergerule/MergePartnerSelectionDialog.java +++ b/key.ui/src/main/java/de/uka/ilkd/key/gui/mergerule/MergePartnerSelectionDialog.java @@ -30,7 +30,6 @@ import org.key_project.prover.sequent.*; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.Pair; /** @@ -327,7 +326,7 @@ public MergePartnerSelectionDialog(Goal mergeGoal, * @return All chosen merge partners. */ public ImmutableList getChosenCandidates() { - ImmutableSLList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (chosenGoals != null) { return result.append(chosenGoals); @@ -433,7 +432,7 @@ private static boolean checkProvability(Sequent seq, JTerm formulaToProve, Servi final TermBuilder tb = services.getTermBuilder(); Sequent toProve = JavaDLSequentKit.createSequent(seq.antecedent().asList(), - ImmutableSLList.singleton(new SequentFormula(formulaToProve))); + ImmutableList.singleton(new SequentFormula(formulaToProve))); for (SequentFormula succedentFormula : seq.succedent()) { final JTerm formula = (JTerm) succedentFormula.formula(); @@ -451,7 +450,7 @@ private static boolean checkProvability(Sequent seq, JTerm formulaToProve, Servi * @return An ImmutableList consisting of the elements in it. */ private ImmutableList immutableListFromIterabe(Iterable it) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (T t : it) { result = result.prepend(t); } diff --git a/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/CurrentGoalViewMenu.java b/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/CurrentGoalViewMenu.java index 305c2934dfc..105fdbc5e11 100644 --- a/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/CurrentGoalViewMenu.java +++ b/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/CurrentGoalViewMenu.java @@ -42,7 +42,6 @@ import org.key_project.prover.rules.tacletbuilder.TacletGoalTemplate; import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.java.StringUtil; import org.jspecify.annotations.NonNull; @@ -120,7 +119,7 @@ private static ImmutableList removeIntroduceAxiomTaclet( ImmutableList list) { return list.stream() .filter(app -> !app.rule().name().toString().equals(INTRODUCE_AXIOM_TACLET_NAME)) - .collect(ImmutableSLList.toImmutableList()); + .collect(ImmutableList.collector()); } /** @@ -130,7 +129,7 @@ private static ImmutableList removeIntroduceAxiomTaclet( * @return list without RewriteTaclets */ public static ImmutableList removeRewrites(ImmutableList list) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (TacletApp tacletApp : list) { Taclet taclet = tacletApp.taclet(); @@ -323,7 +322,7 @@ private void createFocussedAutoModeMenu() { */ public static ImmutableList sort(ImmutableList finds, TacletAppComparator comp) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); List list = new ArrayList<>(finds.size()); diff --git a/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/DragNDropInstantiator.java b/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/DragNDropInstantiator.java index b3e6ea2f90a..9586611c00b 100644 --- a/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/DragNDropInstantiator.java +++ b/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/DragNDropInstantiator.java @@ -34,7 +34,6 @@ import org.key_project.prover.sequent.PosInOccurrence; import org.key_project.prover.sequent.Sequent; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** *

@@ -184,7 +183,7 @@ private ImmutableList getAllApplicableApps(final PosInSequent sour final Sequent sequent = seqView.getMediator().getSelectedGoal().sequent(); - ImmutableList applicableApps = ImmutableSLList.nil(); + ImmutableList applicableApps = ImmutableList.nil(); if (targetPos.isSequent()) { // collects all applicable taclets at the source position // which have an addrule section @@ -220,7 +219,7 @@ private ImmutableList getAllApplicableApps(final PosInSequent sour private ImmutableList getDirectionDependentApps(final PosInSequent sourcePos, final PosInSequent targetPos, final Services services, final Sequent sequent) { - ImmutableList applicableApps = ImmutableSLList.nil(); + ImmutableList applicableApps = ImmutableList.nil(); // all applicable taclets where the drag source has been interpreted // as // the find part and the drop position as the one of the @@ -286,10 +285,10 @@ private ImmutableList getApplicableTaclets(PosInSequent findPos, TacletFilter filter, Services services) { if (findPos == null || findPos.isSequent()) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } - ImmutableList allTacletsAtFindPosition = ImmutableSLList.nil(); + ImmutableList allTacletsAtFindPosition = ImmutableList.nil(); KeYMediator r = seqView.getMediator(); // if in replaceWithMode only apps that contain at least one replacewith @@ -318,7 +317,7 @@ private ImmutableList getApplicableTaclets(PosInSequent findPos, private ImmutableList addPositionInformation(ImmutableList tacletApps, PosInOccurrence findPos, Services services) { - ImmutableList applicableApps = ImmutableSLList.nil(); + ImmutableList applicableApps = ImmutableList.nil(); for (TacletApp tacletApp : tacletApps) { TacletApp app = tacletApp; if (app instanceof NoPosTacletApp) { @@ -349,7 +348,7 @@ private ImmutableList addPositionInformation(ImmutableList completeIfInstantiations(ImmutableList apps, Sequent seq, PosInOccurrence assumesPIO, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); final ImmutableList assumesFormulaInstantiations; @@ -361,7 +360,7 @@ private ImmutableList completeIfInstantiations(ImmutableListnil() + assumesFormulaInstantiations = ImmutableList.nil() .prepend(assumesInstantiationInSeq); } @@ -377,7 +376,7 @@ private ImmutableList completeIfInstantiations(ImmutableList completeIfInstantiations(ImmutableList completeInstantiations(ImmutableList apps, PosInOccurrence missingSVPIO, Services services) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); if (missingSVPIO == null) { - return ImmutableSLList.nil(); + return ImmutableList.nil(); } for (PosTacletApp app1 : apps) { diff --git a/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/SequentView.java b/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/SequentView.java index ac3779a9475..085d680d160 100644 --- a/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/SequentView.java +++ b/key.ui/src/main/java/de/uka/ilkd/key/gui/nodeviews/SequentView.java @@ -36,7 +36,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; @@ -761,7 +760,7 @@ protected void updateHeatmapSFHighlights(int max_age, boolean newest) { for (int j = 0; j < max_age && j < sortedArray.length; ++j) { if (sortedArray[j].equals(entry)) { Color color = computeColorForAge(max_age, j); - ImmutableSLList list = (ImmutableSLList) ImmutableSLList + ImmutableList list = (ImmutableList) ImmutableList .nil().prepend(0).append(i); Range r = ipt.rangeForPath(list); // Off-by-one: siehe updateUpdateHighlights bzw in InnerNodeView. @@ -780,7 +779,7 @@ protected void updateHeatmapSFHighlights(int max_age, boolean newest) { form, max_age + 2); if (age < max_age) { Color color = computeColorForAge(max_age, age); - ImmutableSLList list = (ImmutableSLList) ImmutableSLList + ImmutableList list = (ImmutableList) ImmutableList .nil().prepend(0).append(i); Range r = ipt.rangeForPath(list); // Off-by-one: siehe updateUpdateHighlights bzw in InnerNodeView. rangeForPath diff --git a/key.ui/src/main/java/de/uka/ilkd/key/gui/originlabels/OriginTermLabelVisualizer.java b/key.ui/src/main/java/de/uka/ilkd/key/gui/originlabels/OriginTermLabelVisualizer.java index 85aab39670a..f1388f05bf9 100644 --- a/key.ui/src/main/java/de/uka/ilkd/key/gui/originlabels/OriginTermLabelVisualizer.java +++ b/key.ui/src/main/java/de/uka/ilkd/key/gui/originlabels/OriginTermLabelVisualizer.java @@ -36,7 +36,6 @@ import org.key_project.prover.sequent.Sequent; import org.key_project.prover.sequent.SequentFormula; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import bibliothek.gui.dock.common.DefaultSingleCDockable; @@ -503,7 +502,7 @@ private void highlightInView(PosInOccurrence pio) { private ImmutableList getPosTablePath( PosInOccurrence pos) { if (pos == null) { - return ImmutableSLList.nil().prepend(0); + return ImmutableList.nil().prepend(0); } InitialPositionTable posTable = view.posTable; diff --git a/key.ui/src/main/java/de/uka/ilkd/key/ui/ConsoleUserInterfaceControl.java b/key.ui/src/main/java/de/uka/ilkd/key/ui/ConsoleUserInterfaceControl.java index 4b33d65c79b..799d093575c 100644 --- a/key.ui/src/main/java/de/uka/ilkd/key/ui/ConsoleUserInterfaceControl.java +++ b/key.ui/src/main/java/de/uka/ilkd/key/ui/ConsoleUserInterfaceControl.java @@ -43,7 +43,6 @@ import org.key_project.prover.engine.TaskStartedInfo; import org.key_project.prover.engine.TaskStartedInfo.TaskKind; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.key_project.util.collection.ImmutableSet; import org.slf4j.Logger; @@ -59,7 +58,7 @@ public class ConsoleUserInterfaceControl extends AbstractMediatorUserInterfaceCo private static final String PROGRESS_MARK = ">"; // Substitute for TaskTree (GUI) to facilitate side proofs in console mode - ImmutableList proofStack = ImmutableSLList.nil(); + ImmutableList proofStack = ImmutableList.nil(); final KeYMediator mediator; diff --git a/key.util/src/main/java/org/key_project/util/collection/DefaultImmutableSet.java b/key.util/src/main/java/org/key_project/util/collection/DefaultImmutableSet.java index 59829d7ee4d..441c88e0819 100644 --- a/key.util/src/main/java/org/key_project/util/collection/DefaultImmutableSet.java +++ b/key.util/src/main/java/org/key_project/util/collection/DefaultImmutableSet.java @@ -40,7 +40,7 @@ public class DefaultImmutableSet implements Immutabl } protected DefaultImmutableSet() { - elementList = ImmutableSLList.nil(); + elementList = ImmutableList.nil(); } /** @@ -49,7 +49,7 @@ protected DefaultImmutableSet() { * @param element of type the new Set contains */ private DefaultImmutableSet(T element) { - elementList = (ImmutableSLList.nil()).prepend(element); + elementList = (ImmutableList.nil()).prepend(element); } /** @@ -155,7 +155,7 @@ public ImmutableSet intersect(ImmutableSet set) { return (ImmutableSet) set; } - ImmutableList intersectElements = ImmutableSLList.nil(); + ImmutableList intersectElements = ImmutableList.nil(); for (T el : set) { if (contains(el)) { intersectElements = intersectElements.prepend(el); @@ -353,7 +353,7 @@ public boolean contains(@Nullable Object obj) { /** @return Iterator of the set */ @Override public Iterator iterator() { - return ImmutableSLList.nil().iterator(); + return ImmutableList.nil().iterator(); } /** @return true iff this set is subset of set s */ diff --git a/key.util/src/main/java/org/key_project/util/collection/ImmutableArray.java b/key.util/src/main/java/org/key_project/util/collection/ImmutableArray.java index 70936b13073..534995d9d25 100644 --- a/key.util/src/main/java/org/key_project/util/collection/ImmutableArray.java +++ b/key.util/src/main/java/org/key_project/util/collection/ImmutableArray.java @@ -15,9 +15,6 @@ public class ImmutableArray implements java.lang.Iterable, java.io.Serializable { - - private static final long serialVersionUID = -9041545065066866250L; - private final S[] content; /** @@ -206,7 +203,7 @@ public void remove() { * @return This element converted to an {@link ImmutableList}. */ public ImmutableList toImmutableList() { - ImmutableList ret = ImmutableSLList.nil(); + ImmutableList ret = ImmutableList.nil(); for (S s : this) { ret = ret.prepend(s); } diff --git a/key.util/src/main/java/org/key_project/util/collection/ImmutableList.java b/key.util/src/main/java/org/key_project/util/collection/ImmutableList.java index 8fb6d4e5f86..9b80d4e2ce7 100644 --- a/key.util/src/main/java/org/key_project/util/collection/ImmutableList.java +++ b/key.util/src/main/java/org/key_project/util/collection/ImmutableList.java @@ -3,10 +3,12 @@ * SPDX-License-Identifier: GPL-2.0-only */ package org.key_project.util.collection; +import java.lang.reflect.Array; import java.util.*; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collector; +import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; @@ -15,6 +17,7 @@ /** * List interface to be implemented by non-destructive lists */ +@SuppressWarnings("unchecked") public interface ImmutableList extends Iterable, java.io.Serializable { @@ -31,68 +34,58 @@ public interface ImmutableList }, ImmutableList::fromList); } - /** - * Creates an ImmutableList from a List. - * - * @param list a List. - * @return an ImmutableList containing the same elements as the specified list. - */ + /// Creates an [ImmutableList] from an [Iterable]. + /// This method is not recommended to use as space overhead is required. + /// + /// @param list a List. + /// @return an ImmutableList containing the same elements as the specified list. + /// @see #fromList(List) + /// @see #fromArray(Object[]) static ImmutableList fromList(Iterable list) { - ImmutableList result = ImmutableSLList.nil(); + // Short-cuts, iterables are often lists, if so use them and try to avoid copy. + if (list instanceof ImmutableList ilist) { + return (ImmutableList) ilist; + } - for (T el : list) { - result = result.append(el); + if (list instanceof List ilist) { + return fromList((List) ilist); } - return result; + List seq = new ArrayList<>(64); + for (var t : list) { + seq.add(t); + } + return fromList(seq); } - /** - * Return an empty immutable list. - * - * @return empty immutable list. - * @param the entry type of the list. - */ - static ImmutableList of() { - return ImmutableSLList.nil(); + static ImmutableList fromList(List list) { + return new ImmutableListList<>(list); } - /** - * Return a singleton immutable list. - * - * @param e1 the element to put into the list - * @return singleton immutable list. - * @param the entry type of the list. - */ - static ImmutableList of(T e1) { - return ImmutableSLList.singleton(e1); + static ImmutableList fromArray(T[] array) { + return new ImmutableListArray<>(array); } + /** - * Return an immutable list with two elements. - * The iteration order is: e1 then e2 + * Return an empty immutable list. * - * @param e1 the element to put into the list - * @param e2 the element to put into the list - * @return (e1, e2) as immutable list * @param the entry type of the list. + * @return empty immutable list. */ - static ImmutableList of(T e1, T e2) { - return ImmutableSLList.singleton(e2).prepend(e1); + static ImmutableList of() { + return nil(); } /** - * Return an immutable list with three elements. - * The iteration order is: e1 then e2 then e3 + * Return a singleton immutable list. * * @param e1 the element to put into the list - * @param e2 the element to put into the list - * @param e3 the element to put into the list - * @return (e1, e2, e3) as immutable list * @param the entry type of the list. + * @return singleton immutable list. */ - static ImmutableList of(T e1, T e2, T e3) { - return ImmutableSLList.singleton(e3).prepend(e2).prepend(e1); + static ImmutableList of(T e1) { + return singleton(e1); } /** @@ -100,126 +93,166 @@ public interface ImmutableList * The iteration order is the order of the arguments * * @param es the elements to put into the list - * @return (e1, e2, e3, ...) as immutable list * @param the entry type of the list. + * @return (e1, e2, e3, ...) as immutable list */ static ImmutableList of(T... es) { - ImmutableList result = ImmutableSLList.nil(); - for (int i = es.length - 1; i >= 0; i--) { - result = result.prepend(es[i]); + if (es.length == 0) { + return of(); } - return result; + return new ImmutableListArray<>(es); + + /* + * ImmutableList result = nil(); + * for (int i = es.length - 1; i >= 0; i--) { + * result = result.prepend(es[i]); + * } + * return result; + */ } /** - * prepends element to the list (non-destructive) - * - * @param element the head of the created list - * @return IList with the new element as head and this list as tail + * the empty list */ - ImmutableList prepend(T element); + static ImmutableList nil() { + return (ImmutableSLList) ImmutableSLList.NIL.NIL; + } - /** - * prepends a whole list (non-destructive) - * - * @param list the list to be prepended - * @return IList list++this - */ + static ImmutableList singleton(T obj) { + return new ImmutableSLList.Cons<>(obj, nil()); + } - ImmutableList prepend(ImmutableList list); + static String toString(ImmutableList seq) { + return seq.stream().map(Objects::toString).collect(Collectors.joining(", ", "[", "]")); + } - /** - * prepends an immutable list in reverse order, i.e., [4,5,6].prepend([1,2,3]) will be - * [3,2,1,4,5,6] (more efficient than {@link ImmutableList#prepend(ImmutableList)}) - * - * @return reverse(collection)++this - */ - ImmutableList prependReverse(ImmutableList collection); + default ImmutableList prepend(T element) { + return new ImmutableListConcat<>(ImmutableList.singleton(element), this); + } - /** - * prepends an iterable collection in reverse order, i.e., [4,5,6].prepend([1,2,3]) will be - * [3,2,1,4,5,6] - * - * @return reverse(collection)++this - */ - ImmutableList prependReverse(Iterable collection); + default ImmutableList prepend(ImmutableList list) { + return new ImmutableListConcat<>(list, this); + } - /** - * prepends array (O(n)) - * - * @param array the array of the elements to be prepended - * @return IList the new list - */ - ImmutableList prepend(@SuppressWarnings("unchecked") T... array); + default ImmutableList prependReverse(ImmutableList collection) { + return new ImmutableListConcat<>(collection.reverse(), this); + } - /** - * appends element to the list (non-destructive) - * - * @param element to be added at the end - * @return IList with the new element at the end - */ - ImmutableList append(T element); + default ImmutableList prependReverse(Iterable collection) { + return new ImmutableListConcat<>(ImmutableList.fromList(collection).reverse(), this); + } - /** - * appends a whole list (non-destructive) - * - * @param list the list to be appended - * @return IList this++list - */ - ImmutableList append(ImmutableList list); + default ImmutableList prepend(T... array) { + return new ImmutableListConcat<>(ImmutableList.fromArray(array), this); + } - /** - * appends an iterable collection - */ - ImmutableList append(Iterable collection); + default ImmutableList append(T element) { + return new ImmutableListConcat<>(this, of(element)); + } - /** - * appends element at end (non-destructive) (O(n)) - * - * @param array the array to be appended - * @return IList the new list - */ - ImmutableList append(@SuppressWarnings("unchecked") T... array); + default ImmutableList append(ImmutableList list) { + return new ImmutableListConcat<>(this, ImmutableList.fromList(list)); + } + + default ImmutableList append(Iterable collection) { + return new ImmutableListConcat<>(this, ImmutableList.fromList(collection)); + } + + default ImmutableList append(T... array) { + return new ImmutableListConcat<>(this, ImmutableList.fromArray(array)); + } /** * @return the first element in list */ - T head(); + default T head() { + return get(0); + } /** * return true if predicate is fullfilled for at least one element + *

+ * The default implementation is based on the {@link #stream()} functionality * * @param predicate the predicate * @return true if predicate is fullfilled for at least one element + * @see #stream() + * @see #spliterator() + * */ - boolean exists(Predicate predicate); + default boolean exists(Predicate predicate) { + return stream().anyMatch(predicate); + } - /** - * @return IList tail of list - */ + /// Returns the list without its head element. + /// + /// @see #skip(int) + default ImmutableList tail() { + return skip(1); + } - ImmutableList tail(); + /// Returns the list without the first `n` element. + /// Default implementation takes O(1) and avoids copying the underlying data structure. + /// + /// For any integer `k`, the following must hold: + /// ``` + /// concat( seq.take(k), seq.skip(k) ) == seq + /// ``` + /// + /// @see ImmutableListSubList(int) + default ImmutableList skip(int n) { + return new ImmutableListSubList<>(this, n); + } - /** - * @return IList this list without the first n elements - */ - ImmutableList take(int n); + /// Returns a non-nullable list of the first `n` elements. + /// Default implementation takes O(1) and avoids copying the underlying data structure. + /// + /// @see #skip(int) + /// @see ImmutableListSubList + default ImmutableList take(int n) { + if (n == 0) { + return nil(); + } + return new ImmutableListSubList<>(this, 0, n); + } /** * Reverses this list */ - ImmutableList reverse(); + default ImmutableList reverse() { + return new ImmutableListReverse<>(this); + } /** + * Returns an {@link Iterator} walking through the elements by + * increasing position. The default implementation uses + * an iterator based {@link #get(int)} and {@link #size()}. + * * @return Iterator of this list */ @Override - Iterator iterator(); + default Iterator iterator() { + return new Iterator<>() { + int cursor = 0; + + @Override + public boolean hasNext() { + return cursor < size(); + } + + @Override + public T next() { + return get(cursor++); + } + }; + } /** * @return boolean is true iff. obj is in List */ - boolean contains(@Nullable Object obj); + default boolean contains(@Nullable Object obj) { + return exists(it -> Objects.equals(obj, it)); + } /** * @return int representing number of elements in list @@ -247,21 +280,49 @@ public interface ImmutableList */ ImmutableList removeAll(T obj); - /** - * Convert the list to a Java array (O(n)) - */ - S[] toArray(S[] array); + /// Convert the list to a Java array (O(n)) based on the {@link #iterator()} implementation. + /// If you can convert faster, feel free to override. + /// + /// @see #iterator() + @SuppressWarnings("unchecked") + default S[] toArray(S[] array) { + S[] result; + if (array.length < size()) { + Class arrayClass = array.getClass(); + assert arrayClass.isArray() + : "@AssumeAssertion(nullness): This has indeed a component type"; + result = (S[]) Array.newInstance(arrayClass.getComponentType(), size()); + } else { + result = array; + } - /** - * Convert the list to a Java array (O(n)) - */ - S[] toArray(Class type); + int pos = 0; + for (var item : this) { + result[pos++] = (S) item; + } + return result; + } + + /// Convert the list to a Java array (O(n)) of the given class `type`. + /// + /// @see #iterator() + default S[] toArray(Class type) { + S[] result = (S[]) Array.newInstance(type, size()); + int pos = 0; + for (var head : this) { + // Somehow the nullness checker needs this cast to be explicit. + result[pos++] = (S) type.cast(head); + } + return result; + } /** * A stream object for this collection. * * @return a non-null stream object + * @see #spliterator() + * @see #iterator() */ default Stream stream() { return StreamSupport.stream(this.spliterator(), false); @@ -287,7 +348,6 @@ default List toList() { * @param predicate a non-interfering, stateless * predicate to apply to each element to determine if it * should be included - * * @return the filtered list */ default ImmutableList filter(Predicate predicate) { @@ -347,9 +407,9 @@ default ImmutableList stripPrefix(ImmutableList prefix) { * * @return last element of this list */ - default T last() { + default T last() throws NoSuchElementException { if (isEmpty()) { - throw new IllegalStateException("last() called on empty list"); + throw new NoSuchElementException("last() called on empty list"); } ImmutableList remainder = this; while (!remainder.tail().isEmpty()) { @@ -365,11 +425,21 @@ default T last() { * * @param idx the 0-based index of the element * @return the element at index idx. - * @throws IndexOutOfBoundsException if idx is less than 0 or at - * least {@link #size()}. - */ - default T get(int idx) { - return take(idx).head(); + * @throws IndexOutOfBoundsException if idx is less than 0 or at least {@link #size()}. + */ + T get(int idx); + + /// compares two {@link ImmutableList} content-wise + static boolean equals(ImmutableList seq1, ImmutableList seq2) { + final var size = seq1.size(); + if (size == seq2.size()) { + for (int i = 0; i < size; i++) { + if (!Objects.equals(seq1.get(i), seq2.get(i))) { + return false; + } + } + return true; + } + return false; } - } diff --git a/key.util/src/main/java/org/key_project/util/collection/ImmutableListArray.java b/key.util/src/main/java/org/key_project/util/collection/ImmutableListArray.java new file mode 100644 index 00000000000..ee1dfecac60 --- /dev/null +++ b/key.util/src/main/java/org/key_project/util/collection/ImmutableListArray.java @@ -0,0 +1,176 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import org.jspecify.annotations.Nullable; + +/** + * + * @author Alexander Weigl + * @version 1 (25.04.26) + */ +final class ImmutableListArray implements ImmutableList { + private final T[] data; + + public ImmutableListArray(T[] data) { + this.data = data; + } + + @Override + public T head() { + try { + return data[0]; + } catch (ArrayIndexOutOfBoundsException e) { + throw new NoSuchElementException("head() called on empty list"); + } + } + + @Override + public boolean exists(Predicate predicate) { + for (var datum : data) { + if (predicate.test(datum)) { + return true; + } + } + return false; + } + + @Override + public Iterator iterator() { + return new Iterator<>() { + int pos = 0; + + @Override + public boolean hasNext() { + return pos < data.length; + } + + @Override + public T next() { + return data[pos++]; + } + }; + } + + @Override + public int size() { + return data.length; + } + + @Override + public boolean isEmpty() { + return data.length == 0; + } + + @SuppressWarnings("unchecked") + @Override + public ImmutableList removeFirst(T obj) { + int pos = -1; + for (int i = 0; i < data.length; i++) { + var datum = data[i]; + if (Objects.equals(obj, datum)) { + pos = i; + break; + } + } + + if (pos != -1) { + if (size() == 1) { + // spare all the stupid copying + return ImmutableList.nil(); + } + + T[] newData = (T[]) new Object[data.length - 1]; + System.arraycopy(data, 0, newData, 0, pos); + System.arraycopy(data, pos + 1, newData, pos, data.length - pos - 1); + return new ImmutableListArray<>(newData); + } + + return this; + } + + @Override + public ImmutableList removeAll(T obj) { + return stream().filter(it -> !Objects.equals(it, obj)).collect(ImmutableList.collector()); + } + + @SuppressWarnings({ "unchecked", "argument.type.incompatible" }) + @Override + public S[] toArray(S[] array) { + if (array.length == size()) { + System.arraycopy(data, 0, array, 0, data.length); + return array; + } else { + return (S[]) toArray(array.getClass().getComponentType()); + } + } + + @SuppressWarnings("unchecked") + @Override + public S[] toArray(Class type) { + return toArray((S[]) Array.newInstance(type, size())); + } + + @Override + public Stream stream() { + return Arrays.stream(data); + } + + @Override + public ImmutableList filter(Predicate predicate) { + return stream().filter(predicate).collect(ImmutableList.collector()); + } + + @SuppressWarnings("unchecked") + @Override + public ImmutableList map(Function function) { + var newData = (R[]) new Object[size()]; + for (var i = 0; i < data.length; i++) { + newData[i] = function.apply(data[i]); + } + return new ImmutableListArray<>(newData); + } + + @Override + public T last() { + try { + return data[data.length - 1]; + } catch (ArrayIndexOutOfBoundsException e) { + throw new NoSuchElementException("last() called on empty list"); + } + } + + @Override + public T get(int idx) { + if (idx < 0 || idx >= size()) { + throw new IndexOutOfBoundsException(); + } + return data[idx]; + } + + @Override + public boolean equals(Object o) { + if (o instanceof ImmutableListArray that) { + return Arrays.equals(data, that.data); + } + if (o instanceof ImmutableList that) { + return ImmutableList.equals(this, that); + } + return false; + } + + @Override + public int hashCode() { + return Arrays.hashCode(data); + } +} diff --git a/key.util/src/main/java/org/key_project/util/collection/ImmutableListConcat.java b/key.util/src/main/java/org/key_project/util/collection/ImmutableListConcat.java new file mode 100644 index 00000000000..36c45364037 --- /dev/null +++ b/key.util/src/main/java/org/key_project/util/collection/ImmutableListConcat.java @@ -0,0 +1,100 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.util.Objects; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import org.jspecify.annotations.Nullable; + +/** + * + * @author Alexander Weigl + * @version 1 (25.04.26) + */ +final class ImmutableListConcat + implements ImmutableList { + private final ImmutableList left; + private final ImmutableList right; + + ImmutableListConcat(ImmutableList left, ImmutableList right) { + this.left = left; + this.right = right; + } + + @Override + public boolean exists(Predicate predicate) { + return left.exists(predicate) || right.exists(predicate); + } + + @Override + public int size() { + return left.size() + right.size(); + } + + @Override + public boolean isEmpty() { + return left.isEmpty() && right.isEmpty(); + } + + @Override + public ImmutableList removeFirst(T obj) { + if (left.isEmpty() && right.isEmpty()) { + return ImmutableList.nil(); + } + + if (left.isEmpty()) { + return right.removeFirst(obj); + } + + if (right.isEmpty()) { + return left.removeFirst(obj); + } + + if (left.exists((it) -> Objects.equals(obj, it))) { + return new ImmutableListConcat<>(left.removeFirst(obj), right); + } else { + return new ImmutableListConcat<>(left, right.removeFirst(obj)); + } + } + + @Override + public ImmutableList removeAll(T obj) { + return new ImmutableListConcat<>(left.removeAll(obj), right.removeAll(obj)); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) + return true; + if (obj instanceof ImmutableList other) { + return ImmutableList.equals(this, other); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(left, right); + } + + @Override + public String toString() { + return stream().map(Objects::toString).collect(Collectors.joining(", ")); + } + + @Override + public T get(int idx) { + if (idx < 0 || idx >= size()) { + throw new IndexOutOfBoundsException("Index: " + idx + ", Size: " + size()); + } + + if (idx < left.size()) { + return left.get(idx); + } + + return right.get(idx - left.size()); + } +} diff --git a/key.util/src/main/java/org/key_project/util/collection/ImmutableListList.java b/key.util/src/main/java/org/key_project/util/collection/ImmutableListList.java new file mode 100644 index 00000000000..ea3b10d667b --- /dev/null +++ b/key.util/src/main/java/org/key_project/util/collection/ImmutableListList.java @@ -0,0 +1,124 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import org.jspecify.annotations.Nullable; + +/** + * + * @author Alexander Weigl + * @version 1 (25.04.26) + */ +@SuppressWarnings("unchecked") +final class ImmutableListList implements ImmutableList { + private final List data; + + public ImmutableListList(Collection data) { + this.data = Collections.unmodifiableList(new ArrayList<>(data)); + } + + @Override + public T head() { + return data.getFirst(); + } + + @Override + public boolean exists(Predicate predicate) { + for (var datum : data) { + if (predicate.test(datum)) { + return true; + } + } + return false; + } + + @Override + public Iterator iterator() { + return data.iterator(); + } + + @Override + public int size() { + return data.size(); + } + + @Override + public boolean isEmpty() { + return data.isEmpty(); + } + + @Override + public ImmutableList removeFirst(T obj) { + int pos = -1; + for (int i = 0; i < data.size(); i++) { + var datum = data.get(i); + if (Objects.equals(obj, datum)) { + pos = i; + break; + } + } + + if (pos != -1) { + var newData = new ArrayList<>(data); + newData.remove(pos); + return new ImmutableListList<>(newData); + } + + return this; + } + + @Override + public ImmutableList removeAll(T obj) { + return stream().filter(it -> !Objects.equals(it, obj)).collect(ImmutableList.collector()); + } + + @Override + public Stream stream() { + return data.stream(); + } + + @Override + public ImmutableList filter(Predicate predicate) { + return ImmutableList.super.filter(predicate); + } + + @Override + public T last() { + return data.getLast(); + } + + @Override + public T get(int idx) { + if (idx < 0 || idx >= data.size()) { + throw new IndexOutOfBoundsException("Given index out of bounds."); + } + return data.get(idx); + } + + + @Override + public boolean equals(Object o) { + if (o instanceof ImmutableListList that) { + return Objects.equals(data, that.data); + } + if (o instanceof ImmutableList that) { + return ImmutableList.equals(this, that); + } + return false; + } + + @Override + public int hashCode() { + return data.hashCode(); + } + + @Override + public String toString() { + return ImmutableList.toString(this); + } +} diff --git a/key.util/src/main/java/org/key_project/util/collection/ImmutableListReverse.java b/key.util/src/main/java/org/key_project/util/collection/ImmutableListReverse.java new file mode 100644 index 00000000000..90076d4bc5a --- /dev/null +++ b/key.util/src/main/java/org/key_project/util/collection/ImmutableListReverse.java @@ -0,0 +1,91 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.util.Objects; +import java.util.function.Predicate; + +import org.jspecify.annotations.Nullable; + +/** + * + * @author Alexander Weigl + * @version 1 (25.04.26) + */ +final class ImmutableListReverse implements ImmutableList { + private final ImmutableList inner; + + ImmutableListReverse(ImmutableList inner) { + this.inner = inner; + } + + @Override + public T head() { + return inner.last(); + } + + @Override + public boolean exists(Predicate predicate) { + return inner.exists(predicate); + } + + @Override + public ImmutableList reverse() { + return inner; + } + + @Override + public int size() { + return inner.size(); + } + + @Override + public boolean isEmpty() { + return inner.isEmpty(); + } + + @Override + public ImmutableList removeFirst(T obj) { + // TODO this is hard to implement + return new ImmutableListReverse<>(inner.removeFirst(obj)); + } + + @Override + public ImmutableList removeAll(T obj) { + return new ImmutableListReverse<>(inner.removeAll(obj)); + } + + @Override + public T get(int idx) { + if (idx < 0 || idx >= size()) { + throw new IndexOutOfBoundsException("Index: " + idx + ", Size: " + size()); + } + return inner.get(size() - 1 - idx); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) + return true; + if (obj instanceof ImmutableListReverse other) + return Objects.equals(this.inner, other.inner); + + if (obj instanceof ImmutableList other) + return ImmutableList.equals(this, other); + + return false; + + } + + @Override + public int hashCode() { + return Objects.hash(inner); + } + + @Override + public String toString() { + return ImmutableList.toString(this); + } + +} diff --git a/key.util/src/main/java/org/key_project/util/collection/ImmutableListSubList.java b/key.util/src/main/java/org/key_project/util/collection/ImmutableListSubList.java new file mode 100644 index 00000000000..3c48284c79b --- /dev/null +++ b/key.util/src/main/java/org/key_project/util/collection/ImmutableListSubList.java @@ -0,0 +1,120 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Objects; + +import org.jspecify.annotations.Nullable; + +/** + * + * @author Alexander Weigl + * @version 1 (25.04.26) + */ +final class ImmutableListSubList + implements ImmutableList { + + private final ImmutableList list; + private final int start; + private final int end; + + public ImmutableListSubList(ImmutableList ts, int startInclusive) { + this(ts, startInclusive, ts.size()); + } + + ImmutableListSubList(ImmutableList list, int start, int end) { + if (end > list.size()) { + throw new IllegalArgumentException("The 'end' is larger than the size of the list"); + } + + if (start < 0) { + throw new IllegalArgumentException( + "The 'start' needs to be positive. Negative indices are not allowed."); + } + + if (start > end) { + throw new IllegalArgumentException( + "The 'start' is larger than the given 'end' of the list"); + } + this.list = list; + this.start = start; + this.end = end; + } + + @Override + public Iterator iterator() { + return new Iterator<>() { + int pos = start; + + @Override + public boolean hasNext() { + return pos < end; + } + + @Override + public T next() { + return list.get(pos++); + } + }; + } + + @Override + public int size() { + return end - start; + } + + @Override + public boolean isEmpty() { + return size() == 0; + } + + @Override + public ImmutableList removeFirst(T obj) { + var list = new ArrayList(); + for (var t : this) { + if (!Objects.equals(t, obj)) { + list.add(t); + } + } + return ImmutableList.fromList(list); + } + + @Override + public ImmutableList removeAll(T obj) { + return stream().filter(it -> Objects.equals(obj, it)).collect(ImmutableList.collector()); + } + + @Override + public T get(int idx) { + var realIdx = start + idx; + if (0 <= realIdx && realIdx < end) { + return list.get(realIdx); + } + throw new IndexOutOfBoundsException(); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) + return true; + if (obj instanceof ImmutableList other) { + return ImmutableList.equals(this, other); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(list, start, end); + } + + @Override + public String toString() { + return ImmutableList.toString(this); + } + + +} diff --git a/key.util/src/main/java/org/key_project/util/collection/ImmutableSLList.java b/key.util/src/main/java/org/key_project/util/collection/ImmutableSLList.java index 7e68856d7b1..f821f5478f3 100644 --- a/key.util/src/main/java/org/key_project/util/collection/ImmutableSLList.java +++ b/key.util/src/main/java/org/key_project/util/collection/ImmutableSLList.java @@ -3,13 +3,8 @@ * SPDX-License-Identifier: GPL-2.0-only */ package org.key_project.util.collection; -import java.lang.reflect.Array; import java.util.*; -import java.util.function.BiConsumer; -import java.util.function.BinaryOperator; -import java.util.function.Function; -import java.util.function.Predicate; -import java.util.function.Supplier; +import java.util.function.*; import java.util.stream.Collector; import org.key_project.util.Strings; @@ -22,7 +17,7 @@ /** * Simple implementation of a non-destructive (unmodifiable) list. The list implementation allows * list sharing of sublists. - * + *

* The costs of the different operations are O(1) for prepending one element, O(m) for prepending a * list with m elements, O(n) for appending an element to this list(size n) O(n) for appending a * list with m elements to this list (size n) head() has O(1) tail has O(1) size has O(1) ATTENTION @@ -30,22 +25,8 @@ * and head with amortized O(1). This will be done later (if necessary). */ @SuppressWarnings({ "unchecked" }) -public abstract class ImmutableSLList implements ImmutableList { - - /** - * generated serial id - */ - private static final long serialVersionUID = 8717813038177120287L; - private static final Logger log = LoggerFactory.getLogger(ImmutableSLList.NIL.class); - - /** the empty list */ - public static ImmutableSLList nil() { - return (ImmutableSLList) NIL.NIL; - } - - public static ImmutableSLList singleton(T obj) { - return new Cons<>(obj, nil()); - } +abstract class ImmutableSLList implements ImmutableList { + private static final Logger log = LoggerFactory.getLogger(ImmutableSLList.class); /** * Reverses this list (O(N)) @@ -57,7 +38,7 @@ public ImmutableList reverse() { } ImmutableList rest = this; - ImmutableList rev = nil(); + ImmutableList rev = ImmutableList.nil(); while (!rest.isEmpty()) { rev = rev.prepend(rest.head()); rest = rest.tail(); @@ -65,45 +46,6 @@ public ImmutableList reverse() { return rev; } - /** - * Convert the list to a Java array (O(n)) - */ - @Override - public S[] toArray(S[] array) { - S[] result; - if (array.length < size()) { - Class arrayClass = array.getClass(); - assert arrayClass.isArray() - : "@AssumeAssertion(nullness): This has indeed a component type"; - result = (S[]) Array.newInstance(arrayClass.getComponentType(), size()); - } else { - result = array; - } - ImmutableList rest = this; - for (int i = 0, sz = size(); i < sz; i++) { - result[i] = (S) rest.head(); - rest = rest.tail(); - } - return result; - } - - /** - * Convert the list to a Java array (O(n)) - */ - @Override - public S[] toArray(Class type) { - S[] result = (S[]) Array.newInstance(type, size()); - ImmutableList rest = this; - for (int i = 0, sz = size(); i < sz; i++) { - // @ assert !rest.isEmpty(); - T head = rest.head(); - // Somehow the nullness checker needs this cast to be explicit. - result[i] = (S) type.cast(head); - rest = rest.tail(); - } - return result; - } - /** * prepends array (O(n)) @@ -152,14 +94,19 @@ public ImmutableList prependReverse(Iterable collection) { } - /** - * first n elements of the list are truncated - * - * @param n an int specifying the number of elements to be truncated - * @return IList this list without the first n elements - */ @Override public ImmutableList take(int n) { + List seq = new ArrayList<>(Math.min(size(), n)); + ImmutableList list = this; + for (int i = 0; i < seq.size(); i++) { + seq.add(list.head()); + list = tail(); + } + return ImmutableList.fromList(seq); + } + + @Override + public ImmutableList skip(int n) { if (n < 0 || n > size()) { throw new IndexOutOfBoundsException( "Unable to take " + n + " elements from list " + this); @@ -175,18 +122,24 @@ public ImmutableList take(int n) { } - private static class Cons extends ImmutableSLList { + static class Cons extends ImmutableSLList { /** * */ private static final long serialVersionUID = 2377644880764534935L; - /** the first element */ + /** + * the first element + */ private final S element; - /** reference to the next element (equiv.to the tail of list) */ - private final ImmutableSLList cons; - /** size of the list */ + /** + * reference to the next element (equiv.to the tail of list) + */ + private final ImmutableList cons; + /** + * size of the list + */ private final int size; /** @@ -196,7 +149,7 @@ private static class Cons extends ImmutableSLList */ Cons(S element) { this.element = element; - cons = nil(); + cons = ImmutableList.nil(); size = 1; } @@ -206,7 +159,7 @@ private static class Cons extends ImmutableSLList * @param element a stored in the head element of the list * @param cons tail of the list */ - Cons(S element, ImmutableSLList cons) { + Cons(S element, ImmutableList cons) { this.element = element; this.cons = cons; size = cons.size() + 1; @@ -321,16 +274,20 @@ public ImmutableList append(ImmutableList list) { */ @Override public ImmutableList append(S... array) { - return ((ImmutableList) nil()).prepend(array).prepend(this); + return ImmutableList.nil().prepend(array).prepend(this); } - /** @return first element in list */ + /** + * @return first element in list + */ @Override public S head() { return element; } - /** @return IList tail of the list */ + /** + * @return IList tail of the list + */ @Override public ImmutableList tail() { return cons; @@ -356,19 +313,25 @@ public int hashCode() { } - /** @return iterator through list */ + /** + * @return iterator through list + */ @Override public Iterator iterator() { return new SLListIterator<>(this); } - /** @return int the number of elements in list */ + /** + * @return int the number of elements in list + */ @Override public int size() { return size; } - /** @return boolean true iff. obj in list */ + /** + * @return boolean true iff. obj in list + */ @Override public boolean contains(@Nullable Object obj) { ImmutableList list = this; @@ -383,7 +346,9 @@ public boolean contains(@Nullable Object obj) { return false; } - /** @return true iff the list is empty */ + /** + * @return true iff the list is empty + */ @Override public boolean isEmpty() { return false; @@ -442,40 +407,50 @@ public ImmutableList removeAll(S obj) { return unmodifiedTail.prepend(res, i - unmodifiedTail.size()); } + @Override + public S get(int idx) { + return skip(idx).head(); + } + @Override - public boolean equals(@Nullable Object o) { - if (!(o instanceof ImmutableList)) { - return false; - } - final ImmutableList o1 = (ImmutableList) o; - if (o1.size() != size()) { - return false; - } + public final boolean equals(@Nullable Object o) { + if (this == o) + return true; - final Iterator p = iterator(); - final Iterator q = o1.iterator(); - while (p.hasNext()) { - S ep = p.next(); - S eq = q.next(); - if ((ep == null && eq != null) || (ep != null && !ep.equals(eq))) { + if (o instanceof ImmutableList other) { + if (other.size() != size()) { return false; } + + final Iterator p = iterator(); + final Iterator q = other.iterator(); + while (p.hasNext()) { + var ep = p.next(); + var eq = q.next(); + if (!Objects.equals(ep, eq)) { + return false; + } + } + return true; } - return true; + return false; } - @Override public String toString() { return Strings.formatAsList(this, "[", ",", "]"); } } - /** iterates through a none destructive list */ + /** + * iterates through a none destructive list + */ private static class SLListIterator implements Iterator { - /** the list of remaining elements */ + /** + * the list of remaining elements + */ private ImmutableList list; /** @@ -487,7 +462,9 @@ public SLListIterator(ImmutableList list) { this.list = list; } - /** @return next element in list */ + /** + * @return next element in list + */ @Override public T next() { // TODO Perhaps add a RT and throw NuSuchElement to make type checker happy. @@ -517,7 +494,7 @@ public void remove() { } - private static class NIL extends ImmutableSLList { + static class NIL extends ImmutableSLList { final static ImmutableList NIL = new NIL<>(); @@ -536,7 +513,7 @@ private NIL() { * replaced by the singleton. */ private Object readResolve() throws java.io.ObjectStreamException { - return nil(); + return ImmutableList.nil(); } @Override @@ -546,7 +523,12 @@ public int size() { @Override public boolean equals(@Nullable Object o) { - return o instanceof NIL; + if (o == this) + return true; + if (o instanceof ImmutableList other) { + return other.size() == size(); + } + return false; } @Override @@ -612,9 +594,7 @@ public Iterator iterator() { @Override public S head() { - NoSuchElementException ex = new NoSuchElementException(); - log.error("head on NIL!", ex); - throw ex; + throw new NoSuchElementException("No element in NIL()"); } @Override @@ -627,6 +607,11 @@ public ImmutableList removeAll(S obj) { return this; } + @Override + public S get(int idx) { + throw new NoSuchElementException("No element in NIL()"); + } + @Override public ImmutableList removeFirst(S obj) { return this; @@ -637,15 +622,20 @@ public String toString() { return "[]"; } - /** iterates through the a none destructive NIL list */ + /** + * iterates through the a none destructive NIL list + */ private class SLNilListIterator implements Iterator { /** * creates the NIL list iterator */ - public SLNilListIterator() {} + public SLNilListIterator() { + } - /** @return next element in list */ + /** + * @return next element in list + */ @Override public S next() { throw new NoSuchElementException(); @@ -698,7 +688,7 @@ public BinaryOperator> combiner() { @Override public Function, ImmutableList> finisher() { - return list -> ImmutableSLList.nil().append(list); + return list -> ImmutableList.nil().append(list); } @Override diff --git a/key.util/src/main/java/org/key_project/util/collection/Immutables.java b/key.util/src/main/java/org/key_project/util/collection/Immutables.java index ac07e84a9b2..87c3a28102c 100644 --- a/key.util/src/main/java/org/key_project/util/collection/Immutables.java +++ b/key.util/src/main/java/org/key_project/util/collection/Immutables.java @@ -79,7 +79,7 @@ private Immutables() { return list; } - ImmutableList> stack = ImmutableSLList.nil(); + ImmutableList> stack = ImmutableList.nil(); while (!list.isEmpty()) { stack = stack.prepend(list); @@ -87,7 +87,7 @@ private Immutables() { } HashSet alreadySeen = new HashSet<>(); - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); while (!stack.isEmpty()) { ImmutableList top = stack.head(); @@ -165,7 +165,7 @@ private Immutables() { */ public static ImmutableList createListFrom( Iterable iterable) { - ImmutableList result = ImmutableSLList.nil(); + ImmutableList result = ImmutableList.nil(); for (T t : iterable) { result = result.prepend(t); } @@ -186,17 +186,20 @@ private Immutables() { */ public static ImmutableList filter(ImmutableList ts, Predicate predicate) { + return ts.stream().filter(predicate).collect(ImmutableList.collector()); // This must be a loop. A tail recursive implementation is not optimised // by the compiler and quickly leads to a stack overlow. - ImmutableList acc = ImmutableSLList.nil(); - while (!ts.isEmpty()) { - T hd = ts.head(); - if (predicate.test(hd)) { - acc = acc.prepend(hd); - } - ts = ts.tail(); - } - return acc.reverse(); + /* + * ImmutableList acc = ImmutableList.nil(); + * while (!ts.isEmpty()) { + * T hd = ts.head(); + * if (predicate.test(hd)) { + * acc = acc.prepend(hd); + * } + * ts = ts.tail(); + * } + * return acc.reverse(); + */ } /** @@ -210,14 +213,17 @@ private Immutables() { */ public static ImmutableList map( ImmutableList ts, Function function) { - // This must be a loop. A tail recursive implementation is not optimised - // by the compiler and quickly leads to a stack overflow. - ImmutableList acc = ImmutableSLList.nil(); - while (!ts.isEmpty()) { - T hd = ts.head(); - acc = acc.prepend(function.apply(hd)); - ts = ts.tail(); - } - return acc.reverse(); + return ts.stream().map(function).collect(ImmutableList.collector()); + /* + * // This must be a loop. A tail recursive implementation is not optimised + * // by the compiler and quickly leads to a stack overflow. + * ImmutableList acc = ImmutableList.nil(); + * while (!ts.isEmpty()) { + * T hd = ts.head(); + * acc = acc.prepend(function.apply(hd)); + * ts = ts.tail(); + * } + * return acc.reverse(); + */ } } diff --git a/key.util/src/test/java/org/key_project/util/collection/ImmutableListArrayTest.java b/key.util/src/test/java/org/key_project/util/collection/ImmutableListArrayTest.java new file mode 100644 index 00000000000..15c6605efdd --- /dev/null +++ b/key.util/src/test/java/org/key_project/util/collection/ImmutableListArrayTest.java @@ -0,0 +1,242 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.util.NoSuchElementException; +import java.util.stream.IntStream; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * + * @author Alexander Weigl + * @version 1 (16.05.26) + */ +class ImmutableListArrayTest { + private final ImmutableListArray list123 = + (ImmutableListArray) ImmutableList.of(1, 2, 3); + private final ImmutableListArray listEmpty = new ImmutableListArray<>(new Integer[0]); + private final ImmutableListArray listVeryLong = + (ImmutableListArray) ImmutableList.of(create(1024)); + private final ImmutableListArray list10 = + (ImmutableListArray) ImmutableList.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + + public static Integer[] create(int i) { + return IntStream.range(1, i + 1).boxed().toArray(Integer[]::new); + } + + + @Test + void size() { + assertThat(list123.size()).isEqualTo(3); + assertThat(listEmpty.size()).isEqualTo(0); + assertThat(listVeryLong.size()).isEqualTo(1024); + assertThat(list10.size()).isEqualTo(10); + } + + @Test + void head() { + assertThat(list123.head()).isEqualTo(1); + assertThat(listVeryLong.head()).isEqualTo(1); + assertThat(list10.head()).isEqualTo(1); + + Assertions.assertThrows(NoSuchElementException.class, + () -> assertThat(listEmpty.head()).isEqualTo(-1)); + } + + + @Test + void last() { + assertThat(list123.last()).isEqualTo(3); + assertThat(listVeryLong.last()).isEqualTo(1024); + assertThat(list10.last()).isEqualTo(10); + + Assertions.assertThrows(NoSuchElementException.class, + () -> assertThat(listEmpty.last()).isEqualTo(-1)); + } + + + @Test + void exists() { + assertThat(list123.exists(a -> a == -1)).isEqualTo(false); + assertThat(listVeryLong.exists(a -> a == -1)).isEqualTo(false); + assertThat(list10.exists(a -> a == -1)).isEqualTo(false); + + assertThat(listEmpty.exists(a -> true)).isEqualTo(false); + + assertThat(list123.exists(a -> a == 1)).isEqualTo(true); + assertThat(listVeryLong.exists(a -> a == 1023)).isEqualTo(true); + assertThat(list10.exists(a -> a == 5)).isEqualTo(true); + } + + + @Test + void toArray() { + assertThat(list123.toArray(new Integer[0])) + .isEqualTo(create(3)); + + assertThat(listVeryLong.toArray(new Integer[0])) + .isEqualTo(create(1024)); + + assertThat(list10.toArray(new Integer[0])) + .isEqualTo(create(10)); + + assertThat(listEmpty.toArray(new Integer[0])) + .isEqualTo(new Integer[0]); + + assertThat(list123.toArray(Integer.class)) + .isEqualTo(create(3)); + + assertThat(listVeryLong.toArray(Integer.class)) + .isEqualTo(create(1024)); + + assertThat(list10.toArray(Integer.class)) + .isEqualTo(create(10)); + + assertThat(list10.toArray(new Integer[10])) + .isEqualTo(create(10)); + + assertThat(listEmpty.toArray(Integer.class)) + .isEqualTo(new Integer[0]); + } + + @Test + void stream() { + assertThat(listEmpty.stream().toList()).isEmpty(); + + assertThat(list123.stream().toList()) + .isNotEmpty() + .containsExactly(create(3)); + + assertThat(listVeryLong.stream().toList()) + .isNotEmpty() + .containsExactly(create(1024)); + + assertThat(list10.stream().toList()) + .isNotEmpty() + .containsExactly(create(10)); + } + + + @Test + void isEmpty() { + assertThat(listEmpty.isEmpty()).isTrue(); + assertThat(list123.isEmpty()).isFalse(); + assertThat(listVeryLong.isEmpty()).isFalse(); + assertThat(list10.isEmpty()).isFalse(); + } + + @Test + void removeFirst() { + removeFirst(listEmpty); + removeFirst(list123); + removeFirst(list10); + removeFirst(listVeryLong); + + assertThat(listEmpty.removeFirst(0)) + .isEqualTo(listEmpty); + + assertThat(list123.removeFirst(1)) + .containsExactly(2, 3); + + assertThat(list123.removeFirst(1).removeFirst(3)) + .containsExactly(2); + + assertThat(list123.removeFirst(1).removeFirst(3).removeFirst(2)) + .isEmpty(); + } + + void removeFirst(ImmutableList seq) { + while (!seq.isEmpty()) { + int pivot = seq.get(seq.size() / 2); + seq = seq.removeFirst(pivot); + assertThat(seq).doesNotContain(pivot); + } + } + + @Test + void removeAll() { + removeAll(listEmpty); + removeAll(listVeryLong); + removeAll(list123); + removeAll(list10); + + assertThat(listEmpty.removeFirst(0)) + .isEqualTo(listEmpty); + + + assertThat( + new ImmutableListArray<>( + new Integer[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }) + .removeAll(0)) + .isEqualTo(listEmpty) + .isEmpty(); + } + + void removeAll(ImmutableList seq) { + while (!seq.isEmpty()) { + int pivot = seq.get(seq.size() / 2); + seq = seq.removeAll(pivot); + assertThat(seq).doesNotContain(pivot); + } + } + + + @Test + void testToArray() { + } + + @Test + void iterator() { + assertThat(listEmpty).doesNotContain(0); + + assertThat(list123) + .isNotEmpty() + .containsExactly(create(3)); + + assertThat(listVeryLong) + .isNotEmpty() + .containsExactly(create(1024)); + + assertThat(list10) + .isNotEmpty() + .containsExactly(create(10)); + } + + @Test + void filter() { + assertThat(listEmpty.filter((a) -> true)).isEmpty(); + assertThat(listEmpty.filter((a) -> false)).isEmpty(); + + + assertThat(list10.filter((a) -> false)).isEmpty(); + assertThat(list10.filter((a) -> true)) + .isEqualTo(list10); + } + + @Test + void map() { + assertThat(list123.map((a) -> a + 1)) + .containsExactly(2, 3, 4); + + assertThat(listEmpty.map((a) -> a + 1)) + .isEmpty(); + } + + @Test + void get() { + for (int i = 0; i < list10.size(); i++) { + assertThat(list10.get(i)).isEqualTo(i + 1); + } + + Assertions.assertThrows(IndexOutOfBoundsException.class, () -> list10.get(list10.size())); + + Assertions.assertThrows(IndexOutOfBoundsException.class, () -> list10.get(-1)); + + Assertions.assertThrows(IndexOutOfBoundsException.class, () -> listEmpty.get(0)); + } +} diff --git a/key.util/src/test/java/org/key_project/util/collection/ImmutableListConcatTest.java b/key.util/src/test/java/org/key_project/util/collection/ImmutableListConcatTest.java new file mode 100644 index 00000000000..5887f135528 --- /dev/null +++ b/key.util/src/test/java/org/key_project/util/collection/ImmutableListConcatTest.java @@ -0,0 +1,112 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.util.List; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * + * @author Alexander Weigl + * @version 1 (16.05.26) + */ +class ImmutableListConcatTest { + private final ImmutableListConcat data = new ImmutableListConcat<>( + new ImmutableListArray<>(ImmutableListArrayTest.create(5)), + new ImmutableListList<>(ImmutableListListTest.createList(5))); + private final ImmutableListConcat listEmpty = new ImmutableListConcat<>( + new ImmutableListArray<>(new Integer[0]), new ImmutableListList<>(List.of())); + private final ImmutableListConcat listEmptyEmpty = new ImmutableListConcat<>( + listEmpty, listEmpty); + private final ImmutableList list123 = new ImmutableListList(List.of(1, 2, 3)); + private final ImmutableListConcat listFirstEmpty123 = + new ImmutableListConcat<>(listEmptyEmpty, list123); + + + @Test + void get() { + assertThat(list123.get(0)).isEqualTo(1); + assertThat(list123.get(1)).isEqualTo(2); + assertThat(list123.get(2)).isEqualTo(3); + + Assertions.assertThrows(IndexOutOfBoundsException.class, + () -> listEmpty.get(0)); + + Assertions.assertThrows(IndexOutOfBoundsException.class, + () -> listEmptyEmpty.get(0)); + + Assertions.assertThrows(IndexOutOfBoundsException.class, + () -> list123.get(4)); + } + + @Test + void exists() { + assertThat(data.exists((i) -> i == 1)).isTrue(); + assertThat(data.exists((i) -> i == 5)).isTrue(); + assertThat(data.exists((i) -> i == 10)).isFalse(); + assertThat(data.exists((i) -> i == 0)).isFalse(); + + assertThat(listEmpty.exists((i) -> true)).isFalse(); + assertThat(listEmptyEmpty.exists((i) -> true)).isFalse(); + } + + @Test + void testEquals() { + assertThat(listEmptyEmpty).isEqualTo(listEmpty); + assertThat(listFirstEmpty123).isEqualTo(list123); + assertThat(list123).isEqualTo(listFirstEmpty123); + } + + @Test + void size() { + assertThat(data.size()).isEqualTo(10); + assertThat(listEmpty.size()).isEqualTo(0); + assertThat(listEmptyEmpty.size()).isEqualTo(0); + } + + @Test + void isEmpty() { + assertThat(data.isEmpty()).isFalse(); + assertThat(listEmpty.isEmpty()).isTrue(); + assertThat(listEmptyEmpty.isEmpty()).isTrue(); + } + + @Test + void removeFirst() { + System.out.println(data); + assertThat(data) + .containsExactly(1, 2, 3, 4, 5, 1, 2, 3, 4, 5); + + assertThat(data.removeFirst(1)) + .containsExactly(2, 3, 4, 5, 1, 2, 3, 4, 5); + + assertThat(data.removeFirst(1).removeFirst(1)) + .containsExactly(2, 3, 4, 5, 2, 3, 4, 5); + + assertThat(listFirstEmpty123.removeFirst(1)) + .containsExactly(2, 3); + + assertThat(listFirstEmpty123.removeFirst(1).removeFirst(3)) + .containsExactly(2); + + + assertThat(listEmpty.removeFirst(0)).isEqualTo(listEmpty); + assertThat(listEmptyEmpty.removeFirst(0)).isEqualTo(listEmpty); + } + + @Test + void removeAll() { + assertThat(data.removeAll(1)) + .containsExactly(2, 3, 4, 5, 2, 3, 4, 5); + + } + + @Test + void iterator() { + } +} diff --git a/key.util/src/test/java/org/key_project/util/collection/ImmutableListListTest.java b/key.util/src/test/java/org/key_project/util/collection/ImmutableListListTest.java new file mode 100644 index 00000000000..e6c1a2b174a --- /dev/null +++ b/key.util/src/test/java/org/key_project/util/collection/ImmutableListListTest.java @@ -0,0 +1,251 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.util.Collections; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.stream.IntStream; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.key_project.util.collection.ImmutableListArrayTest.create; + +/** + * + * @author Alexander Weigl + * @version 1 (16.05.26) + */ +class ImmutableListListTest { + private final ImmutableListList list123 = new ImmutableListList<>(createList(3)); + private final ImmutableListList listEmpty = + new ImmutableListList<>(Collections.emptyList()); + private final ImmutableListList listVeryLong = + new ImmutableListList<>(createList(1024)); + private final ImmutableListList list10 = new ImmutableListList<>(createList(10)); + + public static List createList(int i) { + return IntStream.range(1, i + 1).boxed().toList(); + } + + @Test + void content() { + assertThat(list123).containsExactly(1, 2, 3); + assertThat(list10).containsExactly(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + } + + @Test + void size() { + assertThat(list123.size()).isEqualTo(3); + assertThat(listEmpty.size()).isEqualTo(0); + assertThat(listVeryLong.size()).isEqualTo(1024); + assertThat(list10.size()).isEqualTo(10); + } + + @Test + void head() { + assertThat(list123.head()).isEqualTo(1); + assertThat(listVeryLong.head()).isEqualTo(1); + assertThat(list10.head()).isEqualTo(1); + + Assertions.assertThrows(NoSuchElementException.class, + () -> assertThat(listEmpty.head()).isEqualTo(-1)); + } + + + @Test + void last() { + assertThat(list123.last()).isEqualTo(3); + assertThat(listVeryLong.last()).isEqualTo(1024); + assertThat(list10.last()).isEqualTo(10); + + Assertions.assertThrows(NoSuchElementException.class, + () -> assertThat(listEmpty.last()).isEqualTo(-1)); + } + + + @Test + void exists() { + assertThat(list123.exists(a -> a == -1)).isEqualTo(false); + assertThat(listVeryLong.exists(a -> a == -1)).isEqualTo(false); + assertThat(list10.exists(a -> a == -1)).isEqualTo(false); + + assertThat(listEmpty.exists(a -> true)).isEqualTo(false); + + assertThat(list123.exists(a -> a == 1)).isEqualTo(true); + assertThat(listVeryLong.exists(a -> a == 1023)).isEqualTo(true); + assertThat(list10.exists(a -> a == 5)).isEqualTo(true); + } + + + @Test + void toArray() { + Integer[] array = list123.toArray(new Integer[0]); + Integer[] array2 = create(3); + + assertThat(array).isEqualTo(array2); + + assertThat(listVeryLong.toArray(new Integer[0])) + .isEqualTo(create(1024)); + + assertThat(list10.toArray(new Integer[0])) + .isEqualTo(create(10)); + + assertThat(listEmpty.toArray(new Integer[0])) + .isEqualTo(new Integer[0]); + + assertThat(list123.toArray(Integer.class)) + .isEqualTo(create(3)); + + assertThat(listVeryLong.toArray(Integer.class)) + .isEqualTo(create(1024)); + + assertThat(list10.toArray(Integer.class)) + .isEqualTo(create(10)); + + assertThat(list10.toArray(new Integer[10])) + .isEqualTo(create(10)); + + assertThat(listEmpty.toArray(Integer.class)) + .isEqualTo(new Integer[0]); + } + + @Test + void stream() { + assertThat(listEmpty.stream().toList()).isEmpty(); + + assertThat(list123.stream().toList()) + .isNotEmpty() + .containsExactly(create(3)); + + assertThat(listVeryLong.stream().toList()) + .isNotEmpty() + .containsExactly(create(1024)); + + assertThat(list10.stream().toList()) + .isNotEmpty() + .containsExactly(create(10)); + } + + + @Test + void isEmpty() { + assertThat(listEmpty.isEmpty()).isTrue(); + assertThat(list123.isEmpty()).isFalse(); + assertThat(listVeryLong.isEmpty()).isFalse(); + assertThat(list10.isEmpty()).isFalse(); + } + + @Test + void removeFirst() { + removeFirst(listEmpty); + removeFirst(list123); + removeFirst(list10); + removeFirst(listVeryLong); + + assertThat(listEmpty.removeFirst(0)) + .isEqualTo(listEmpty); + + assertThat(list123.removeFirst(1)) + .containsExactly(2, 3); + + assertThat(list123.removeFirst(1).removeFirst(3)) + .containsExactly(2); + + assertThat(list123.removeFirst(1).removeFirst(3).removeFirst(2)) + .isEmpty(); + } + + void removeFirst(ImmutableList seq) { + while (!seq.isEmpty()) { + int pivot = seq.get(seq.size() / 2); + seq = seq.removeFirst(pivot); + assertThat(seq).doesNotContain(pivot); + } + } + + @Test + void removeAll() { + removeAll(listEmpty); + removeAll(listVeryLong); + removeAll(list123); + removeAll(list10); + + assertThat(listEmpty.removeFirst(0)) + .isEqualTo(listEmpty); + + + assertThat( + new ImmutableListArray<>( + new Integer[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }) + .removeAll(0)) + .isEqualTo(listEmpty) + .isEmpty(); + } + + void removeAll(ImmutableList seq) { + while (!seq.isEmpty()) { + int pivot = seq.get(seq.size() / 2); + seq = seq.removeAll(pivot); + assertThat(seq).doesNotContain(pivot); + } + } + + + @Test + void testToArray() { + } + + @Test + void iterator() { + assertThat(listEmpty).doesNotContain(0); + + assertThat(list123) + .isNotEmpty() + .containsExactly(create(3)); + + assertThat(listVeryLong) + .isNotEmpty() + .containsExactly(create(1024)); + + assertThat(list10) + .isNotEmpty() + .containsExactly(create(10)); + } + + @Test + void filter() { + assertThat(listEmpty.filter((a) -> true)).isEmpty(); + assertThat(listEmpty.filter((a) -> false)).isEmpty(); + + + assertThat(list10.filter((a) -> false)).isEmpty(); + assertThat(list10.filter((a) -> true)) + .isEqualTo(list10); + } + + @Test + void map() { + assertThat(list123.map((a) -> a + 1)) + .containsExactly(2, 3, 4); + + assertThat(listEmpty.map((a) -> a + 1)) + .isEmpty(); + } + + @Test + void get() { + for (int i = 0; i < list10.size(); i++) { + assertThat(list10.get(i)).isEqualTo(i + 1); + } + + Assertions.assertThrows(IndexOutOfBoundsException.class, () -> list10.get(list10.size())); + + Assertions.assertThrows(IndexOutOfBoundsException.class, () -> list10.get(-1)); + + Assertions.assertThrows(IndexOutOfBoundsException.class, () -> listEmpty.get(0)); + } +} diff --git a/key.util/src/test/java/org/key_project/util/collection/ImmutableListReverseTest.java b/key.util/src/test/java/org/key_project/util/collection/ImmutableListReverseTest.java new file mode 100644 index 00000000000..b35e9feddc9 --- /dev/null +++ b/key.util/src/test/java/org/key_project/util/collection/ImmutableListReverseTest.java @@ -0,0 +1,40 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.*; + +/** + * + * @author Alexander Weigl + * @version 1 (16.05.26) + */ +class ImmutableListReverseTest { + private final ImmutableList seq = + new ImmutableListArray<>(ImmutableListArrayTest.create(5)); + + @Test + void reverse() { + assertThat(seq).containsExactly(1, 2, 3, 4, 5); + assertThat(seq.reverse()) + .hasSize(5) + .containsExactly(5, 4, 3, 2, 1); + + assertThat(seq.reverse().reverse()) + .hasSize(5) + .containsExactly(1, 2, 3, 4, 5); + + + assertThat(seq.prepend().reverse().prepend()) + .hasSize(5) + .containsExactly(5, 4, 3, 2, 1); + + assertThat(seq.reverse().take(3).reverse()) + .hasSize(3) + .isEqualTo(seq.skip(2)); + } +} diff --git a/key.util/src/test/java/org/key_project/util/collection/ImmutableListSubListTest.java b/key.util/src/test/java/org/key_project/util/collection/ImmutableListSubListTest.java new file mode 100644 index 00000000000..d02ab213168 --- /dev/null +++ b/key.util/src/test/java/org/key_project/util/collection/ImmutableListSubListTest.java @@ -0,0 +1,41 @@ +/* This file is part of KeY - https://key-project.org + * KeY is licensed under the GNU General Public License Version 2 + * SPDX-License-Identifier: GPL-2.0-only */ +package org.key_project.util.collection; + +import java.util.List; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * + * @author Alexander Weigl + * @version 1 (16.05.26) + */ +class ImmutableListSubListTest { + private final ImmutableList seq = + new ImmutableListArray<>(ImmutableListArrayTest.create(5)); + private final ImmutableListConcat data = new ImmutableListConcat<>( + seq, + new ImmutableListList<>(ImmutableListListTest.createList(5))); + private final ImmutableListConcat listEmpty = new ImmutableListConcat<>( + new ImmutableListArray<>(new Integer[0]), new ImmutableListList<>(List.of())); + + @Test + void test() { + assertThat(data.take(1)).containsExactly(1); + assertThat(data.take(0)).isEqualTo(listEmpty); + + assertThat(data.take(5)) + .hasSize(5) + .containsExactly(1, 2, 3, 4, 5) + .isEqualTo(seq); + + assertThat(data.skip(5)) + .hasSize(5) + .containsExactly(1, 2, 3, 4, 5) + .isEqualTo(seq); + } +} diff --git a/key.util/src/test/java/org/key_project/util/collection/TestImmutables.java b/key.util/src/test/java/org/key_project/util/collection/TestImmutables.java index 621234689d7..5fcc80d704e 100644 --- a/key.util/src/test/java/org/key_project/util/collection/TestImmutables.java +++ b/key.util/src/test/java/org/key_project/util/collection/TestImmutables.java @@ -12,7 +12,7 @@ public class TestImmutables { @Test public void testRemoveDuplicatesLarge() { - ImmutableList l = ImmutableSLList.nil(); + ImmutableList l = ImmutableList.nil(); for (int i = 0; i < 100; i++) { l = l.prepend((i * 2) % 160); } @@ -44,7 +44,7 @@ public void testRemoveDuplicates() { for (int i = 0; i < a.length; i++) { ImmutableList<@Nullable String> l = - ImmutableSLList.<@Nullable String>nil().prepend(a[i]).reverse(); + ImmutableList.<@Nullable String>nil().prepend(a[i]).reverse(); assertFalse(Immutables.isDuplicateFree(l)); @@ -60,7 +60,7 @@ public void testRemoveDuplicates() { @Test public void testRemoveDuplicatesIdentical() { String[] a = { "a", "b", "c", "d", "e" }; - ImmutableList l = ImmutableSLList.nil().prepend(a); + ImmutableList l = ImmutableList.nil().prepend(a); ImmutableList cleaned = Immutables.removeDuplicates(l); @@ -75,7 +75,7 @@ public void testIsDuplicateFree() { for (@Nullable String[] strings : a) { ImmutableList<@Nullable String> l = - ImmutableSLList.<@Nullable String>nil().prepend(strings); + ImmutableList.<@Nullable String>nil().prepend(strings); assertTrue(Immutables.isDuplicateFree(l)); } @@ -86,7 +86,7 @@ public void testIsDuplicateFree() { for (@Nullable String[] strings : b) { ImmutableList<@Nullable String> l = - ImmutableSLList.<@Nullable String>nil().prepend(strings); + ImmutableList.<@Nullable String>nil().prepend(strings); assertFalse(Immutables.isDuplicateFree(l)); } @@ -139,7 +139,7 @@ public void testUnion() { @Test public void testEqualityEmpty() { ImmutableSet s1 = DefaultImmutableSet.nil(); - ImmutableSet s2 = DefaultImmutableSet.fromImmutableList(ImmutableSLList.nil()); + ImmutableSet s2 = DefaultImmutableSet.fromImmutableList(ImmutableList.nil()); assertEquals(0, s1.size()); assertEquals(0, s2.size()); @@ -180,7 +180,7 @@ public void testFilter() { public void testFilterStackoverflow() { // With the original tail recursive implementation, this would give // an overflow --> made it a loop. - ImmutableList l = ImmutableSLList.nil(); + ImmutableList l = ImmutableList.nil(); for (int i = 0; i < 1_000_000; i++) { l = l.prepend(i); } @@ -200,7 +200,7 @@ public void testMap() { public void testMapStackoverflow() { // With the original tail recursive implementation, this would give // an overflow --> made it a loop. - ImmutableList l = ImmutableSLList.nil(); + ImmutableList l = ImmutableList.nil(); for (int i = 0; i < 1_000_000; i++) { l = l.prepend(i); } @@ -213,7 +213,7 @@ public void testMapStackoverflow() { public void testExistsStackoverflow() { // With a tail recursive implementation, this would give // an overflow --> it is a loop. - ImmutableList l = ImmutableSLList.nil(); + ImmutableList l = ImmutableList.nil(); for (int i = 0; i < 1_000_000; i++) { l = l.prepend(i); } diff --git a/key.util/src/test/java/org/key_project/util/testcase/collection/TestLeftistHeapOfInteger.java b/key.util/src/test/java/org/key_project/util/testcase/collection/TestLeftistHeapOfInteger.java index bb5a03f8942..6512a8ee16b 100644 --- a/key.util/src/test/java/org/key_project/util/testcase/collection/TestLeftistHeapOfInteger.java +++ b/key.util/src/test/java/org/key_project/util/testcase/collection/TestLeftistHeapOfInteger.java @@ -11,7 +11,6 @@ import org.key_project.util.collection.ImmutableHeap; import org.key_project.util.collection.ImmutableLeftistHeap; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -29,9 +28,9 @@ public class TestLeftistHeapOfInteger { @BeforeEach public void setUp() { - a = ImmutableSLList.nil().prepend(13).prepend(20).prepend(5).prepend(7).prepend(16) + a = ImmutableList.nil().prepend(13).prepend(20).prepend(5).prepend(7).prepend(16) .prepend(60).prepend(20).prepend(-34); - b = ImmutableSLList.nil().prepend(-1000).prepend(1000).prepend(8); + b = ImmutableList.nil().prepend(-1000).prepend(1000).prepend(8); } @Test @@ -102,7 +101,7 @@ private void checkHeap(ImmutableList elements, ImmutableHeap h assertTrue(equals(h.sortedIterator(), elements.iterator()), "Unsorted heap iterator does not return the right elements"); - ImmutableList list = ImmutableSLList.nil(); + ImmutableList list = ImmutableList.nil(); lastElement = null; while (!h.isEmpty()) { @@ -131,8 +130,8 @@ private ImmutableHeap removeAll(ImmutableHeap h, Iterator h = ImmutableLeftistHeap.nilHeap(); - h = h.insert(ImmutableSLList.nil().iterator()); - checkHeap(ImmutableSLList.nil(), h); + h = h.insert(ImmutableList.nil().iterator()); + checkHeap(ImmutableList.nil(), h); assertTrue(h.isEmpty() && h.size() == 0, "Empty heap should be empty"); h = h.insert(a.iterator()); @@ -141,7 +140,7 @@ public void testInsertIterator() { h = h.insert(a.iterator()); checkHeap(a.prepend(a), h); - h = h.insert(ImmutableSLList.nil().iterator()); + h = h.insert(ImmutableList.nil().iterator()); checkHeap(a.prepend(a), h); h = h.insert(h.iterator()); @@ -174,7 +173,7 @@ public void testRemoveAll() { ImmutableHeap h = ImmutableLeftistHeap.nilHeap(); // Test removal of all elements (from empty heap) - checkHeap(ImmutableSLList.nil(), removeAll(h, a.iterator())); + checkHeap(ImmutableList.nil(), removeAll(h, a.iterator())); h = h.insert(a.iterator()); checkHeap(a, h); @@ -183,7 +182,7 @@ public void testRemoveAll() { checkHeap(a.removeAll(a.head()), h.removeAll(a.head())); // Test removal of all elements - checkHeap(ImmutableSLList.nil(), removeAll(h, a.iterator())); + checkHeap(ImmutableList.nil(), removeAll(h, a.iterator())); // Test removal of non-existing elements assertSame(h, removeAll(h, b.iterator()), "Heap should not be different"); @@ -192,7 +191,7 @@ public void testRemoveAll() { @Test public void testLargeHeap() { ImmutableHeap h = ImmutableLeftistHeap.nilHeap(); - ImmutableList l = ImmutableSLList.nil(); + ImmutableList l = ImmutableList.nil(); int i = 1000; while (i-- != 0) { diff --git a/key.util/src/test/java/org/key_project/util/testcase/collection/TestSLListOfString.java b/key.util/src/test/java/org/key_project/util/testcase/collection/TestSLListOfString.java index 9d031839399..011cb48161d 100644 --- a/key.util/src/test/java/org/key_project/util/testcase/collection/TestSLListOfString.java +++ b/key.util/src/test/java/org/key_project/util/testcase/collection/TestSLListOfString.java @@ -7,7 +7,6 @@ import java.util.Objects; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; @@ -37,14 +36,14 @@ public class TestSLListOfString { @BeforeEach public void setUp() { - a = ImmutableSLList.nil().prepend("C").prepend("B").prepend("A"); - a1 = ImmutableSLList.nil().prepend("C").prepend("B").prepend("A"); - b = ImmutableSLList.nil().prepend("B").prepend("A"); - c = ImmutableSLList.nil().prepend("D").prepend("C").prepend("B").prepend("A"); - d = ImmutableSLList.nil().prepend("A").prepend("B").prepend("A"); - e = ImmutableSLList.<@Nullable String>nil().prepend((String) null).prepend("B") + a = ImmutableList.nil().prepend("C").prepend("B").prepend("A"); + a1 = ImmutableList.nil().prepend("C").prepend("B").prepend("A"); + b = ImmutableList.nil().prepend("B").prepend("A"); + c = ImmutableList.nil().prepend("D").prepend("C").prepend("B").prepend("A"); + d = ImmutableList.nil().prepend("A").prepend("B").prepend("A"); + e = ImmutableList.<@Nullable String>nil().prepend((String) null).prepend("B") .prepend("A"); - e1 = ImmutableSLList.<@Nullable String>nil().prepend((String) null).prepend("B") + e1 = ImmutableList.<@Nullable String>nil().prepend((String) null).prepend("B") .prepend("A"); } @@ -53,7 +52,7 @@ public void setUp() { public void testPrepend() { @SuppressWarnings("unchecked") ImmutableList[] newList = new ImmutableList[str.length + 1]; - newList[0] = ImmutableSLList.nil(); + newList[0] = ImmutableList.nil(); for (int i = 1; i < str.length + 1; i++) { newList[i] = newList[i - 1].prepend(str[i - 1]); @@ -91,7 +90,7 @@ public void testPrepend() { public void testAppend() { @SuppressWarnings("unchecked") ImmutableList[] newList = new ImmutableList[str.length + 1]; - newList[0] = ImmutableSLList.nil(); + newList[0] = ImmutableList.nil(); for (int i = 1; i < str.length + 1; i++) { newList[i] = newList[i - 1].append(str[i - 1]); @@ -130,7 +129,7 @@ public void testAppend() { public void testHeadTail() { @SuppressWarnings("unchecked") ImmutableList[] newList = new ImmutableList[str.length + 1]; - newList[0] = ImmutableSLList.nil(); + newList[0] = ImmutableList.nil(); for (int i = 1; i < str.length + 1; i++) { newList[i] = newList[i - 1].prepend(str[i - 1]); @@ -145,7 +144,7 @@ public void testHeadTail() { // tests contains @Test public void testContains() { - ImmutableList newList = ImmutableSLList.nil(); + ImmutableList newList = ImmutableList.nil(); for (int i = 1; i < str.length + 1; i++) { newList = newList.append(str[i - 1]); @@ -160,7 +159,7 @@ public void testContains() { // tests removeAll @Test public void testRemoveAll() { - ImmutableList newList = ImmutableSLList.nil(); + ImmutableList newList = ImmutableList.nil(); newList = newList.append(str[0]); for (int i = 1; i < str.length + 1; i++) { @@ -174,7 +173,7 @@ public void testRemoveAll() { @Test public void testRemoveFirst() { - ImmutableList newList = ImmutableSLList.nil(); + ImmutableList newList = ImmutableList.nil(); newList = newList.prepend(str[0]); for (int i = 1; i < str.length + 1; i++) { @@ -211,7 +210,7 @@ public void testEquals() { @Test public void testToString() { - ImmutableList newList = ImmutableSLList.nil(); + ImmutableList newList = ImmutableList.nil(); for (String aStr : str) { newList = newList.append(aStr); } @@ -221,7 +220,7 @@ public void testToString() { public static void performanceTest(int n) { LOGGER.info("Performance Test for " + n + " elements"); - ImmutableList newList = ImmutableSLList.nil(); + ImmutableList newList = ImmutableList.nil(); LOGGER.info("Create list with prepend."); long start = System.currentTimeMillis(); for (int i = 0; i < n; i++) { @@ -245,7 +244,7 @@ public static void performanceTest(int n) { public static void main(String[] args) { - ImmutableList newList = ImmutableSLList.nil(); + ImmutableList newList = ImmutableList.nil(); newList.prepend("a"); performanceTest(10); diff --git a/keyext.slicing/src/main/java/org/key_project/slicing/analysis/AnalysisResults.java b/keyext.slicing/src/main/java/org/key_project/slicing/analysis/AnalysisResults.java index d2503482f34..4235bdf3614 100644 --- a/keyext.slicing/src/main/java/org/key_project/slicing/analysis/AnalysisResults.java +++ b/keyext.slicing/src/main/java/org/key_project/slicing/analysis/AnalysisResults.java @@ -25,7 +25,6 @@ import org.key_project.slicing.graph.GraphNode; import org.key_project.slicing.util.ExecutionTime; import org.key_project.util.collection.ImmutableList; -import org.key_project.util.collection.ImmutableSLList; /** * Results of the dependency analysis algorithm. @@ -166,7 +165,7 @@ public Sequent reduceSequent(Node node) { private ImmutableList reduce(ImmutableList semi, Node node, boolean antec) { - ImmutableList semiList = ImmutableSLList.nil(); + ImmutableList semiList = ImmutableList.nil(); for (SequentFormula sf : semi) { var graphNode = dependencyGraph.getGraphNode(node.proof(), node.getBranchLocation(), new PosInOccurrence(sf, PosInTerm.getTopLevel(), antec));