- * This class provides static methods to compute proof references. A proof reference is a source
- * code member used during proof like methods, instance or class variables or operation contracts.
- *
- *
- * A found proof reference is an instance of {@link IProofReference}.
- *
- *
- * Proof references are computed for each {@link Node} separately based on the applied rule.
- * Instances of {@link IProofReferencesAnalyst} are used to implement the rule specific extraction
- * of such references.
- *
- *
- * This functionality is used by the Eclipse Projects like Visual DbC.
- *
- *
- * @author Martin Hentschel
- * @see IProofReference
- * @see IProofReferencesAnalyst
- */
-public final class ProofReferenceUtil {
- /**
- * The default {@link IProofReferencesAnalyst}s.
- */
- public static final ImmutableList DEFAULT_ANALYSTS =
- ImmutableList.nil().append(
- new MethodBodyExpandProofReferencesAnalyst(), new MethodCallProofReferencesAnalyst(),
- new ContractProofReferencesAnalyst(), new ProgramVariableReferencesAnalyst(),
- new ClassAxiomAndInvariantProofReferencesAnalyst());
-
- /**
- * Forbid instances.
- */
- private ProofReferenceUtil() {
- }
-
- /**
- *
- * Computes all proof references in the given {@link Proof} by iterating over all {@link Node}s
- * in breath first order.
- *
- *
- * Changes during computation of the proof tree are not detected and should be avoided.
- * Otherwise it is possible that the result is wrong.
- *
- *
- * @param proof The {@link Proof} to compute its references.
- * @return The found {@link IProofReference}s.
- */
- public static LinkedHashSet> computeProofReferences(Proof proof) {
- return computeProofReferences(proof, DEFAULT_ANALYSTS);
- }
-
- /**
- *
- * Computes all proof references in the given {@link Proof} by iterating over all {@link Node}s
- * in breath first order.
- *
- *
- * Changes during computation of the proof tree are not detected and should be avoided.
- * Otherwise it is possible that the result is wrong.
- *
- *
- * @param proof The {@link Proof} to compute its references.
- * @param analysts The {@link IProofReferencesAnalyst} to use.
- * @return The found {@link IProofReference}s.
- */
- public static LinkedHashSet> computeProofReferences(Proof proof,
- ImmutableList analysts) {
- if (proof != null) {
- Services services = proof.getServices();
- ReferenceAnalaystProofVisitor visitor =
- new ReferenceAnalaystProofVisitor(services, analysts);
- proof.breadthFirstSearch(proof.root(), visitor);
- return visitor.getResult();
- } else {
- return new LinkedHashSet<>();
- }
- }
-
- /**
- * Utility class used by {@link ProofReferenceUtil}.
- *
- * @author Martin Hentschel
- */
- private static class ReferenceAnalaystProofVisitor implements ProofVisitor {
- /**
- * The {@link Services} to use.
- */
- private final Services services;
-
- /**
- * The {@link IProofReferencesAnalyst}s to use.
- */
- private final ImmutableList analysts;
-
- /**
- * The result.
- */
- private final LinkedHashSet> result =
- new LinkedHashSet<>();
-
- /**
- * Constructor.
- *
- * @param services The {@link Services} to use.
- * @param analysts The {@link IProofReferencesAnalyst}s to use.
- */
- public ReferenceAnalaystProofVisitor(Services services,
- ImmutableList analysts) {
- this.services = services;
- this.analysts = analysts;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void visit(Proof proof, Node visitedNode) {
- merge(result, computeProofReferences(visitedNode, services, analysts));
- }
-
- /**
- * Returns the result.
- *
- * @return The result.
- */
- public LinkedHashSet> getResult() {
- return result;
- }
- }
-
- /**
- * Computes the {@link IProofReference} of the given {@link Node}.
- *
- * @param node The {@link Node} to compute its {@link IProofReference}s.
- * @param services The {@link Services} to use.
- * @return The found {@link IProofReference}s.
- */
- public static LinkedHashSet> computeProofReferences(Node node,
- Services services) {
- return computeProofReferences(node, services, DEFAULT_ANALYSTS);
- }
-
- /**
- * Computes the {@link IProofReference} of the given {@link Node}.
- *
- * @param node The {@link Node} to compute its {@link IProofReference}s.
- * @param services The {@link Services} to use.
- * @param analysts The {@link IProofReferencesAnalyst} to use.
- * @return The found {@link IProofReference}s.
- */
- public static LinkedHashSet> computeProofReferences(Node node,
- Services services, ImmutableList analysts) {
- LinkedHashSet> result = new LinkedHashSet<>();
- if (node != null && analysts != null) {
- for (IProofReferencesAnalyst analyst : analysts) {
- LinkedHashSet> analystResult =
- analyst.computeReferences(node, services);
- if (analystResult != null) {
- merge(result, analystResult);
- }
- }
- }
- return result;
- }
-
- /**
- * Merges the {@link IProofReference}s to add into the target.
- *
- * @param target The target to add to.
- * @param toAdd The {@link IProofReference}s to add.
- */
- public static void merge(LinkedHashSet> target,
- LinkedHashSet> toAdd) {
- for (IProofReference> reference : toAdd) {
- merge(target, reference);
- }
- }
-
- /**
- * Merges the {@link IProofReference} into the target:
- *
- * @param target The target to add to.
- * @param reference The {@link IProofReference} to add.
- */
- public static void merge(LinkedHashSet> target,
- final IProofReference> reference) {
- if (!target.add(reference)) {
- // Reference exists before, so merge nodes of both references.
- IProofReference> existingFirst =
- CollectionUtil.search(target, element -> element.equals(reference));
- existingFirst.addNodes(reference.getNodes());
- }
- }
-}
diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ClassAxiomAndInvariantProofReferencesAnalyst.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ClassAxiomAndInvariantProofReferencesAnalyst.java
deleted file mode 100644
index 6624776c239..00000000000
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ClassAxiomAndInvariantProofReferencesAnalyst.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.analyst;
-
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
-import de.uka.ilkd.key.logic.op.IObserverFunction;
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof.init.ProofOblInput;
-import de.uka.ilkd.key.proof_references.reference.DefaultProofReference;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.rule.PosTacletApp;
-import de.uka.ilkd.key.rule.Taclet;
-import de.uka.ilkd.key.speclang.ClassAxiom;
-import de.uka.ilkd.key.speclang.ClassInvariant;
-import de.uka.ilkd.key.speclang.PartialInvAxiom;
-import de.uka.ilkd.key.util.MiscTools;
-
-import org.key_project.logic.Name;
-import org.key_project.logic.sort.Sort;
-import org.key_project.util.collection.DefaultImmutableSet;
-import org.key_project.util.collection.ImmutableSet;
-import org.key_project.util.collection.Pair;
-
-/**
- * Extracts used {@link ClassAxiom} and {@link ClassInvariant}s.
- *
- * @author Martin Hentschel
- */
-public class ClassAxiomAndInvariantProofReferencesAnalyst implements IProofReferencesAnalyst {
- /**
- * {@inheritDoc}
- */
- @Override
- public LinkedHashSet> computeReferences(Node node, Services services) {
- String name = MiscTools.getRuleName(node);
- if (name != null
- && (name.toLowerCase().contains("axiom_for")
- || name.toLowerCase().contains("represents_clause_for"))
- && node.getAppliedRuleApp() instanceof PosTacletApp) {
- // Get KeYJavaType which provides the proof obligation because only for its ClassAxioms
- // are taclets generated and used during proof.
- KeYJavaType proofKjt = findProofsKeYJavaType(services);
- if (proofKjt != null) {
- // Get applied taclet name
- Name tacletName = ((PosTacletApp) node.getAppliedRuleApp()).taclet().name();
- // Search ClassAxiom which provides the applied taclet
- ImmutableSet axioms =
- services.getSpecificationRepository().getClassAxioms(proofKjt);
- ClassAxiom found = null;
- Iterator axiomsIterator = axioms.iterator();
- while (found == null && axiomsIterator.hasNext()) {
- ClassAxiom ca = axiomsIterator.next();
- ImmutableSet> toLimit = DefaultImmutableSet.nil();
- ImmutableSet taclets = ca.getTaclets(toLimit, services);
- Iterator tacletIterator = taclets.iterator();
- while (found == null && tacletIterator.hasNext()) {
- Taclet t = tacletIterator.next();
- if (t.name().equals(tacletName)) {
- found = ca;
- }
- }
- }
- if (found instanceof PartialInvAxiom axiom) {
- // Invariant was applied
- DefaultProofReference reference =
- new DefaultProofReference<>(IProofReference.USE_INVARIANT,
- node, axiom.getInv());
- LinkedHashSet> result =
- new LinkedHashSet<>();
- result.add(reference);
- return result;
- } else if (found != null) {
- // ClassAxiom was applied
- DefaultProofReference reference =
- new DefaultProofReference<>(IProofReference.USE_AXIOM, node,
- found);
- LinkedHashSet> result =
- new LinkedHashSet<>();
- result.add(reference);
- return result;
- } else {
- throw new IllegalStateException("ClassAxiom for taclet \"" + name
- + "\" was not found applied in node \"" + node.serialNr() + "\".");
- }
- } else {
- return null; // Proof might be disposed.
- }
- } else {
- return null;
- }
- }
-
- /**
- * Returns the {@link KeYJavaType} which provides the proof obligation of the current proof.
- *
- * @param services The {@link Services} to use.
- * @return The {@link KeYJavaType} which provides the proof obligation or {@code null} if it was
- * not possible to compute it.
- */
- protected KeYJavaType findProofsKeYJavaType(Services services) {
- ProofOblInput problem =
- services.getSpecificationRepository().getProofOblInput(services.getProof());
- if (problem != null) {
- KeYJavaType type = problem.getContainerType();
- if (type == null) {
- throw new IllegalStateException("Problem \"" + problem + "\" is not supported.");
- }
- return type;
- } else {
- return null; // Proof might be disposed.
- }
- }
-}
diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ContractProofReferencesAnalyst.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ContractProofReferencesAnalyst.java
deleted file mode 100644
index 6345d9615c1..00000000000
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ContractProofReferencesAnalyst.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.analyst;
-
-import java.util.LinkedHashSet;
-
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof_references.reference.DefaultProofReference;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.rule.AbstractContractRuleApp;
-import de.uka.ilkd.key.speclang.Contract;
-
-/**
- * Extracts used contracts.
- *
- * @author Martin Hentschel
- */
-public class ContractProofReferencesAnalyst implements IProofReferencesAnalyst {
- /**
- * {@inheritDoc}
- */
- @Override
- public LinkedHashSet> computeReferences(Node node, Services services) {
- if (node.getAppliedRuleApp() instanceof AbstractContractRuleApp contractRuleApp) {
- DefaultProofReference reference = new DefaultProofReference<>(
- IProofReference.USE_CONTRACT, node, contractRuleApp.getInstantiation());
- LinkedHashSet> result = new LinkedHashSet<>();
- result.add(reference);
- return result;
- } else {
- return null;
- }
- }
-}
diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/IProofReferencesAnalyst.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/IProofReferencesAnalyst.java
deleted file mode 100644
index 652233b3dea..00000000000
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/IProofReferencesAnalyst.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.analyst;
-
-import java.util.LinkedHashSet;
-
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof_references.ProofReferenceUtil;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-
-/**
- *
- * Instances of this class are used to compute {@link IProofReference} for a given {@link Node}
- * based on the applied rule. Each instance of this class has the knowledge to extract the
- * references for a single rule or a group of similar rules.
- *
- *
- * The complete extraction is done via static methods of {@link ProofReferenceUtil}.
- *
- *
- * @author Martin Hentschel
- * @see ProofReferenceUtil
- * @see IProofReference
- */
-public interface IProofReferencesAnalyst {
- /**
- * Computes the {@link IProofReference} for the given {@link Node} which can be {@code null} or
- * an empty set if the applied rule is not supported by this {@link IProofReferencesAnalyst}.
- *
- * @param node The {@link Node} to compute its {@link IProofReference}s.
- * @param services The {@link Services} to use.
- * @return The found {@link IProofReference} or {@code null}/empty set if the applied rule is
- * not supported.
- */
- LinkedHashSet> computeReferences(Node node, Services services);
-}
diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodBodyExpandProofReferencesAnalyst.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodBodyExpandProofReferencesAnalyst.java
deleted file mode 100644
index 9b8e27e7f1e..00000000000
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodBodyExpandProofReferencesAnalyst.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.analyst;
-
-import java.util.LinkedHashSet;
-
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.java.ast.statement.MethodBodyStatement;
-import de.uka.ilkd.key.logic.op.IProgramMethod;
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof.NodeInfo;
-import de.uka.ilkd.key.proof_references.reference.DefaultProofReference;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-
-/**
- * Extracts inlined methods.
- *
- * @author Martin Hentschel
- */
-public class MethodBodyExpandProofReferencesAnalyst implements IProofReferencesAnalyst {
- /**
- * {@inheritDoc}
- */
- @Override
- public LinkedHashSet> computeReferences(Node node, Services services) {
- if (node.getAppliedRuleApp() != null && node.getNodeInfo() != null) {
- NodeInfo info = node.getNodeInfo();
- if (info.getActiveStatement() instanceof MethodBodyStatement mbs) {
- IProgramMethod pm = mbs.getProgramMethod(services);
- DefaultProofReference reference =
- new DefaultProofReference<>(IProofReference.INLINE_METHOD, node,
- pm);
- LinkedHashSet> result = new LinkedHashSet<>();
- result.add(reference);
- return result;
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
-}
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
deleted file mode 100644
index f2eca312174..00000000000
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.analyst;
-
-import java.util.LinkedHashSet;
-
-import de.uka.ilkd.key.java.JavaTools;
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.java.ast.ProgramElement;
-import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
-import de.uka.ilkd.key.java.ast.expression.Assignment;
-import de.uka.ilkd.key.java.ast.reference.ExecutionContext;
-import de.uka.ilkd.key.java.ast.reference.MethodReference;
-import de.uka.ilkd.key.java.ast.reference.TypeRef;
-import de.uka.ilkd.key.logic.JTerm;
-import de.uka.ilkd.key.logic.JavaBlock;
-import de.uka.ilkd.key.logic.ProgramElementName;
-import de.uka.ilkd.key.logic.TermBuilder;
-import de.uka.ilkd.key.logic.op.IProgramMethod;
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof.NodeInfo;
-import de.uka.ilkd.key.proof_references.ProofReferenceUtil;
-import de.uka.ilkd.key.proof_references.reference.DefaultProofReference;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.rule.PosTacletApp;
-import de.uka.ilkd.key.util.MiscTools;
-
-import org.key_project.logic.Name;
-import org.key_project.logic.op.sv.SchemaVariable;
-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.ImmutableList;
-
-/**
- * Extracts called methods.
- *
- * @author Martin Hentschel
- */
-public class MethodCallProofReferencesAnalyst implements IProofReferencesAnalyst {
- /**
- * {@inheritDoc}
- */
- @Override
- public LinkedHashSet> computeReferences(Node node, Services services) {
- String name = MiscTools.getRuleName(node);
- if (name != null && name.toLowerCase().contains("methodcall")) {
- NodeInfo info = node.getNodeInfo();
- if (info != null) {
- if (info.getActiveStatement() instanceof MethodReference) {
- ExecutionContext context = extractContext(node, services);
- IProofReference reference = createReference(node, services,
- context, (MethodReference) info.getActiveStatement());
- LinkedHashSet> result =
- new LinkedHashSet<>();
- result.add(reference);
- return result;
- } else if (info.getActiveStatement() instanceof Assignment assignment) {
- ExecutionContext context = extractContext(node, services);
- LinkedHashSet> result =
- new LinkedHashSet<>();
- for (int i = 0; i < assignment.getChildCount(); i++) {
- ProgramElement child = assignment.getChildAt(i);
- if (child instanceof MethodReference) {
- IProofReference reference =
- createReference(node, services, context, (MethodReference) child);
- ProofReferenceUtil.merge(result, reference);
- }
- }
- return result;
- } else {
- return null;
- }
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
-
- /**
- * Extracts the {@link ExecutionContext}.
- *
- * @param node The {@link Node} to extract {@link ExecutionContext} from.
- * @param services The {@link Services} to use.
- * @return The found {@link ExecutionContext} or {@code null} if not available.
- */
- protected ExecutionContext extractContext(Node node, Services services) {
- RuleApp app = node.getAppliedRuleApp();
- PosInOccurrence pio = app.posInOccurrence();
- JavaBlock jb = TermBuilder.goBelowUpdates((JTerm) pio.subTerm()).javaBlock();
- return JavaTools.getInnermostExecutionContext(jb, services);
- }
-
- /**
- * Creates an {@link IProofReference} to the called {@link IProgramMethod}.
- *
- * @param node
- * The {@link Node} which caused the reference.
- * @param services
- * The {@link Services} to use.
- * @param context
- * The {@link ExecutionContext} to use.
- * @param mr
- * The {@link MethodReference}.
- * @return The created {@link IProofReference}.
- */
- protected IProofReference createReference(Node node, Services services,
- ExecutionContext context, MethodReference mr) {
- if (context != null) {
- KeYJavaType refPrefixType = mr.determineStaticPrefixType(services, context);
- IProgramMethod pm = mr.method(services, refPrefixType, context);
- return new DefaultProofReference<>(IProofReference.CALL_METHOD, node, pm);
- } else {
- if (!(node.getAppliedRuleApp() instanceof PosTacletApp app)) {
- throw new IllegalArgumentException("PosTacletApp expected.");
- }
- if (!"staticMethodCallStaticWithAssignmentViaTypereference"
- .equals(MiscTools.getRuleName(node))) {
- throw new IllegalArgumentException(
- "Rule \"staticMethodCallStaticWithAssignmentViaTypereference\" expected, but is \""
- + MiscTools.getRuleName(node) + "\".");
- }
- SchemaVariable methodSV = app.instantiations().lookupVar(new Name("#mn"));
- SchemaVariable typeSV = app.instantiations().lookupVar(new Name("#t"));
- SchemaVariable argsSV = app.instantiations().lookupVar(new Name("#elist"));
-
- ProgramElementName method =
- (ProgramElementName) app.instantiations().getInstantiation(methodSV);
- TypeRef type = (TypeRef) app.instantiations().getInstantiation(typeSV);
- ImmutableArray> args =
- (ImmutableArray>) app.instantiations().getInstantiation(argsSV);
- if (!args.isEmpty()) {
- throw new IllegalArgumentException("Empty argument list expected.");
- }
- IProgramMethod pm = services.getJavaInfo().getProgramMethod(type.getKeYJavaType(),
- method.toString(), ImmutableList.nil(), type.getKeYJavaType());
- return new DefaultProofReference<>(IProofReference.CALL_METHOD, node, pm);
- }
- }
-}
diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ProgramVariableReferencesAnalyst.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ProgramVariableReferencesAnalyst.java
deleted file mode 100644
index 3c01ebf7b92..00000000000
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/ProgramVariableReferencesAnalyst.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.analyst;
-
-import java.util.LinkedHashSet;
-
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.java.ast.ExpressionContainer;
-import de.uka.ilkd.key.java.ast.ProgramElement;
-import de.uka.ilkd.key.java.ast.SourceElement;
-import de.uka.ilkd.key.java.ast.expression.operator.CopyAssignment;
-import de.uka.ilkd.key.java.ast.reference.FieldReference;
-import de.uka.ilkd.key.java.ast.reference.ReferencePrefix;
-import de.uka.ilkd.key.java.ast.statement.If;
-import de.uka.ilkd.key.logic.op.IProgramVariable;
-import de.uka.ilkd.key.logic.op.ProgramVariable;
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof_references.ProofReferenceUtil;
-import de.uka.ilkd.key.proof_references.reference.DefaultProofReference;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-
-/**
- * Extracts read and write access to fields ({@link IProgramVariable}) via assignments.
- *
- * @author Martin Hentschel
- */
-public class ProgramVariableReferencesAnalyst implements IProofReferencesAnalyst {
- /**
- * {@inheritDoc}
- */
- @Override
- public LinkedHashSet> computeReferences(Node node, Services services) {
- if (node.getAppliedRuleApp() != null && node.getNodeInfo() != null) {
- SourceElement statement = node.getNodeInfo().getActiveStatement();
- if (statement instanceof CopyAssignment) {
- LinkedHashSet> result = new LinkedHashSet<>();
- listReferences(node, (CopyAssignment) statement,
- services.getJavaInfo().getArrayLength(), result, true);
- return result;
- } else if (statement instanceof If) {
- LinkedHashSet> result = new LinkedHashSet<>();
- listReferences(node, ((If) statement).getExpression(),
- services.getJavaInfo().getArrayLength(), result, false);
- return result;
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
-
- /**
- * Extracts the proof references recursive.
- *
- * @param node The node.
- * @param pe The current {@link ProgramElement}.
- * @param arrayLength The {@link ProgramVariable} used for array length which is ignored.
- * @param toFill The {@link LinkedHashSet} to fill.
- * @param includeExpressionContainer Include {@link ExpressionContainer}?
- */
- protected void listReferences(Node node, ProgramElement pe, ProgramVariable arrayLength,
- LinkedHashSet> toFill, boolean includeExpressionContainer) {
- if (pe instanceof ProgramVariable pv) {
- if (pv.isMember()) {
- DefaultProofReference reference =
- new DefaultProofReference<>(IProofReference.ACCESS, node,
- (ProgramVariable) pe);
- ProofReferenceUtil.merge(toFill, reference);
- }
- } else if (pe instanceof FieldReference fr) {
- ReferencePrefix ref = fr.getReferencePrefix();
- if (ref != null) {
- listReferences(node, ref, arrayLength, toFill, includeExpressionContainer);
- }
- ProgramVariable pv = fr.getProgramVariable();
- if (pv != arrayLength) {
- DefaultProofReference reference =
- new DefaultProofReference<>(IProofReference.ACCESS, node, pv);
- ProofReferenceUtil.merge(toFill, reference);
- }
- } else if (includeExpressionContainer && pe instanceof ExpressionContainer ec) {
- for (int i = ec.getChildCount() - 1; i >= 0; i--) {
- ProgramElement element = ec.getChildAt(i);
- listReferences(node, element, arrayLength, toFill, includeExpressionContainer);
- }
- }
- }
-}
diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/reference/DefaultProofReference.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/reference/DefaultProofReference.java
deleted file mode 100644
index 18fe6e1daf1..00000000000
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/reference/DefaultProofReference.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.reference;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Objects;
-
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof.Proof;
-
-import org.key_project.util.Strings;
-
-/**
- * Default implementation of {@link IProofReference}.
- *
- * @author Martin Hentschel
- */
-public class DefaultProofReference implements IProofReference {
- /**
- * The reference kind as human readable {@link String}.
- */
- private final String kind;
-
- /**
- * The source {@link Proof}.
- */
- private final Proof source;
-
- /**
- * The target source member.
- */
- private final T target;
-
- /**
- * The {@link Node} in which the reference was found.
- */
- private final LinkedHashSet nodes = new LinkedHashSet<>();
-
- /**
- * Constructor
- *
- * @param kind The reference kind as human readable {@link String}.
- * @param node Node to access the source {@link Proof} (or null).
- * @param target The target source member.
- */
- public DefaultProofReference(String kind, Node node, T target) {
- this.kind = kind;
- this.source = node != null ? node.proof() : null;
- this.target = target;
- this.nodes.add(node);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public T getTarget() {
- return target;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public LinkedHashSet getNodes() {
- return nodes;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void addNodes(Collection nodes) {
- this.nodes.addAll(nodes);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getKind() {
- return kind;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Proof getSource() {
- return source;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof IProofReference> other) {
- return Objects.equals(getKind(), other.getKind())
- && Objects.equals(getSource(), other.getSource())
- && Objects.equals(getTarget(), other.getTarget());
- } else {
- return false;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- int result = 17;
- result = 31 * result + (getKind() != null ? getKind().hashCode() : 0);
- result = 31 * result + (getSource() != null ? getSource().hashCode() : 0);
- result = 31 * result + (getTarget() != null ? getTarget().hashCode() : 0);
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(getKind());
- sb.append(" Proof Reference to \"");
- sb.append(getTarget());
- sb.append("\"");
- if (!getNodes().isEmpty()) {
- sb.append(" at node(s) ");
- sb.append(Strings.formatAsList(getNodes(), "", ", ", "", Node::serialNr));
- }
- if (getSource() != null) {
- sb.append(" of proof \"");
- sb.append(getSource());
- sb.append("\"");
- }
- return sb.toString();
- }
-}
diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/reference/IProofReference.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/reference/IProofReference.java
deleted file mode 100644
index 6d10d0ddad4..00000000000
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/reference/IProofReference.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.reference;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-
-import de.uka.ilkd.key.logic.op.IProgramMethod;
-import de.uka.ilkd.key.logic.op.IProgramVariable;
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof.Proof;
-import de.uka.ilkd.key.proof_references.ProofReferenceUtil;
-import de.uka.ilkd.key.proof_references.analyst.IProofReferencesAnalyst;
-import de.uka.ilkd.key.speclang.ClassAxiom;
-import de.uka.ilkd.key.speclang.ClassInvariant;
-import de.uka.ilkd.key.speclang.Contract;
-
-/**
- * A proof reference which points to a source member used during proof. By default, instances are
- * created via {@link IProofReferencesAnalyst}s during reference computation via static methods of
- * {@link ProofReferenceUtil}.
- *
- * @author Martin Hentschel
- * @see ProofReferenceUtil
- * @see IProofReferencesAnalyst
- */
-public interface IProofReference {
- /**
- *
- * A method call which determines the possible implementations of a called method.
- *
- *
- * References of this kind should provide an {@link IProgramMethod} as target
- * ({@link #getTarget()}).
- *
- * The proof step "Use Operation Contract" which approximates a method call via its method
- * contract and also the usage of dependency contracts.
- *
- *
- * References of this kind should provide a {@link Contract} as target ({@link #getTarget()}).
- *
- * References of this kind should provide an {@link ClassAxiom} as target
- * ({@link #getTarget()}).
- *
- */
- String USE_AXIOM = "Use Axiom";
-
- /**
- * Returns the reference kind which is a human readable {@link String}.
- *
- * @return The reference kind as human readable {@link String}.
- */
- String getKind();
-
- /**
- * Returns the {@link Node}s in which the reference was found.
- *
- * @return The {@link Node}s in which the reference was found.
- */
- LinkedHashSet getNodes();
-
- /**
- * Adds the given {@link Node}s to the own {@link Node}s.
- *
- * @param nodes The {@link Node}s to add.
- */
- void addNodes(Collection nodes);
-
- /**
- * Returns the target source member.
- *
- * @return The target source member.
- */
- T getTarget();
-
- /**
- * Returns the source {@link Proof}.
- *
- * @return The source {@link Proof}.
- */
- Proof getSource();
-}
diff --git a/key.core.proof_references/src/main/resources/MANIFEST.MF b/key.core.proof_references/src/main/resources/MANIFEST.MF
deleted file mode 100644
index 10fc211bcb4..00000000000
--- a/key.core.proof_references/src/main/resources/MANIFEST.MF
+++ /dev/null
@@ -1,4 +0,0 @@
-Manifest-Version: 1.0
-Permissions: all-permissions
-Class-Path: key.util.jar ../libs/antlr.jar ../libs/recoderKey.jar key.core.jar
-Codebase: formal.iti.kit.edu
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
deleted file mode 100644
index 1ecfb7533d7..00000000000
--- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/AbstractProofReferenceTestCase.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.testcase;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.function.Predicate;
-
-import de.uka.ilkd.key.control.KeYEnvironment;
-import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
-import de.uka.ilkd.key.logic.op.IObserverFunction;
-import de.uka.ilkd.key.logic.op.IProgramMethod;
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof.Proof;
-import de.uka.ilkd.key.proof_references.ProofReferenceUtil;
-import de.uka.ilkd.key.proof_references.analyst.IProofReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.settings.ChoiceSettings;
-import de.uka.ilkd.key.settings.ProofIndependentSettings;
-import de.uka.ilkd.key.settings.ProofSettings;
-import de.uka.ilkd.key.speclang.ClassAxiom;
-import de.uka.ilkd.key.speclang.Contract;
-import de.uka.ilkd.key.speclang.FunctionalOperationContract;
-import de.uka.ilkd.key.strategy.StrategyProperties;
-import de.uka.ilkd.key.util.HelperClassForTests;
-
-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.ImmutableSet;
-import org.key_project.util.helper.FindResources;
-import org.key_project.util.java.CollectionUtil;
-
-import org.jspecify.annotations.Nullable;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-/**
- * Provides the basic functionality to test the proof reference API.
- *
- * @author Martin Hentschel
- */
-public abstract class AbstractProofReferenceTestCase {
- public static final @Nullable Path TESTCASE_DIRECTORY = FindResources.getTestCasesDirectory();
-
- static {
- assertNotNull(TESTCASE_DIRECTORY, "Could not find test case directory");
- }
-
- /**
- * Executes the test steps of test methods.
- *
- * @param baseDir The base directory which contains test and oracle file.
- * @param javaPathInBaseDir The path to the java file inside the base directory.
- * @param containerTypeName The name of the type which contains the method.
- * @param targetName The target name to search.
- * @param useContracts Use contracts or inline method bodies instead.
- * @param analyst The {@link IProofReferencesAnalyst} to use.
- * @param expectedReferences The expected proof references.
- * @throws Exception Occurred Exception.
- */
- protected void doReferenceFunctionTest(@Nullable Path baseDir, String javaPathInBaseDir,
- String containerTypeName, String targetName, boolean useContracts,
- IProofReferencesAnalyst analyst, ExpectedProofReferences... expectedReferences)
- throws Exception {
- doReferenceFunctionTest(baseDir, javaPathInBaseDir, containerTypeName, targetName,
- useContracts, analyst,
- null, expectedReferences);
- }
-
- /**
- * Executes the test steps of test methods.
- *
- * @param baseDir The base directory which contains test and oracle file.
- * @param javaPathInBaseDir The path to the java file inside the base directory.
- * @param containerTypeName The name of the type which contains the method.
- * @param targetName The target name to search.
- * @param useContracts Use contracts or inline method bodies instead.
- * @param analyst The {@link IProofReferencesAnalyst} to use.
- * @param currentReferenceFilter An optional {@link Predicate} to limit the references to test.
- * @param expectedReferences The expected proof references.
- * @throws Exception Occurred Exception.
- */
- protected void doReferenceFunctionTest(@Nullable Path baseDir, String javaPathInBaseDir,
- String containerTypeName, String targetName, boolean useContracts,
- IProofReferencesAnalyst analyst, Predicate> currentReferenceFilter,
- ExpectedProofReferences... expectedReferences) throws Exception {
- IProofTester tester =
- createReferenceMethodTester(analyst, currentReferenceFilter, expectedReferences);
- doProofFunctionTest(baseDir, javaPathInBaseDir, containerTypeName, targetName, useContracts,
- tester);
- }
-
- /**
- * Executes the test steps of test methods.
- *
- * @param baseDir The base directory which contains test and oracle file.
- * @param javaPathInBaseDir The path to the java file inside the base directory.
- * @param containerTypeName The name of the type which contains the method.
- * @param methodFullName The method name to search.
- * @param useContracts Use contracts or inline method bodies instead.
- * @param analyst The {@link IProofReferencesAnalyst} to use.
- * @param expectedReferences The expected proof references.
- * @throws Exception Occurred Exception.
- */
- protected void doReferenceMethodTest(@Nullable Path baseDir, String javaPathInBaseDir,
- String containerTypeName, String methodFullName, boolean useContracts,
- IProofReferencesAnalyst analyst, ExpectedProofReferences... expectedReferences)
- throws Exception {
- doReferenceMethodTest(baseDir, javaPathInBaseDir, containerTypeName, methodFullName,
- useContracts, analyst, null, expectedReferences);
- }
-
- /**
- * Executes the test steps of test methods.
- *
- * @param baseDir The base directory which contains test and oracle file.
- * @param javaPathInBaseDir The path to the java file inside the base directory.
- * @param containerTypeName The name of the type which contains the method.
- * @param methodFullName The method name to search.
- * @param useContracts Use contracts or inline method bodies instead.
- * @param analyst The {@link IProofReferencesAnalyst} to use.
- * @param currentReferenceFilter An optional {@link Predicate} to limit the references to test.
- * @param expectedReferences The expected proof references.
- * @throws Exception Occurred Exception.
- */
- protected void doReferenceMethodTest(@Nullable Path baseDir, String javaPathInBaseDir,
- String containerTypeName, String methodFullName, boolean useContracts,
- IProofReferencesAnalyst analyst, Predicate> currentReferenceFilter,
- ExpectedProofReferences... expectedReferences) throws Exception {
- IProofTester tester =
- createReferenceMethodTester(analyst, currentReferenceFilter, expectedReferences);
- doProofMethodTest(baseDir, javaPathInBaseDir, containerTypeName, methodFullName,
- useContracts, tester);
- }
-
- /**
- * Creates the {@link IProofTester} used by
- * {@link #doProofFunctionTest(Path, String, String, String, boolean, IProofTester)} and
- * {@link #doProofMethodTest(Path, String, String, String, boolean, IProofTester)}.
- *
- * @param analyst The {@link IProofReferencesAnalyst} to use.
- * @param currentReferenceFilter An optional {@link Predicate} to limit the references to test.
- * @param expectedReferences The expected proof references.
- * @return The created {@link IProofTester}.
- */
- protected IProofTester createReferenceMethodTester(final IProofReferencesAnalyst analyst,
- final Predicate> currentReferenceFilter,
- final ExpectedProofReferences... expectedReferences) {
- return (environment, proof) -> {
- // Compute proof references
- ImmutableList analysts = ImmutableList.nil();
- if (analyst != null) {
- analysts = analysts.append(analyst);
- }
- LinkedHashSet> references =
- ProofReferenceUtil.computeProofReferences(proof, analysts);
- // Filter references
- if (currentReferenceFilter != null) {
- LinkedHashSet> filteredReferences =
- new LinkedHashSet<>();
- for (IProofReference> reference : references) {
- if (currentReferenceFilter.test(reference)) {
- filteredReferences.add(reference);
- }
- }
- references = filteredReferences;
- }
- // Assert proof references
- assertReferences(references, expectedReferences);
- };
- }
-
- /**
- * Extracts all {@link IProofReference}s of the given once which are extracted from the given
- * {@link Node}.
- *
- * @param references The {@link IProofReference}s to search in.
- * @param node The {@link Node} to look for.
- * @return The contained {@link IProofReference}s with the given node.
- */
- protected LinkedHashSet> findReferences(
- LinkedHashSet> references, Node node) {
- LinkedHashSet> result = new LinkedHashSet<>();
- for (IProofReference> reference : references) {
- if (reference.getNodes().contains(node)) {
- result.add(reference);
- }
- }
- return result;
- }
-
- /**
- * Tests the given {@link IProofReference}s.
- *
- * @param expected The expected {@link IProofReference}s.
- * @param current The current {@link IProofReference}s.
- */
- protected void assertReferences(LinkedHashSet> expected,
- LinkedHashSet> current) {
- assertNotNull(current);
- assertNotNull(expected);
- assertEquals(current.size(), expected.size());
- Iterator> expectedIter = expected.iterator();
- Iterator> currentIter = current.iterator();
- while (expectedIter.hasNext() && currentIter.hasNext()) {
- IProofReference> expectedReference = expectedIter.next();
- IProofReference> currentReference = currentIter.next();
- assertEquals(expectedReference.getKind(), currentReference.getKind());
- if (expectedReference.getTarget() instanceof ClassAxiom) {
- assertTrue(currentReference.getTarget() instanceof ClassAxiom);
- assertEquals(expectedReference.getTarget().toString(),
- currentReference.getTarget().toString()); // Instances might be different.
- } else {
- assertEquals(expectedReference.getTarget(), currentReference.getTarget());
- }
- }
- assertFalse(expectedIter.hasNext());
- assertFalse(currentIter.hasNext());
- }
-
- /**
- * Tests the given {@link IProofReference}s.
- *
- * @param current The current {@link IProofReference}s.
- * @param expected The expected {@link ExpectedProofReferences}s.
- */
- protected void assertReferences(LinkedHashSet> current,
- ExpectedProofReferences... expected) {
- assertNotNull(current);
- assertNotNull(expected);
- assertEquals(expected.length, current.size(), "Computed References: " + current);
- int i = 0;
- for (IProofReference> currentReference : current) {
- ExpectedProofReferences expectedReference = expected[i];
- assertEquals(expectedReference.kind(), currentReference.getKind());
- if (expectedReference.target() != null) {
- assertNotNull(currentReference.getTarget());
- assertEquals(expectedReference.target(),
- currentReference.getTarget().toString());
- } else {
- assertNull(currentReference.getTarget());
- }
- i++;
- }
- }
-
- /**
- * Defines the values of an expected proof reference.
- *
- * @param kind The expected kind.
- * @param target The expected target.
- * @author Martin Hentschel
- */
- protected record ExpectedProofReferences(String kind, String target) {
- /**
- * Constructor.
- *
- * @param kind The expected kind.
- * @param target The expected target.
- */
- public ExpectedProofReferences {
- }
-
- /**
- * Returns the expected kind.
- *
- * @return The expected kind.
- */
- @Override
- public String kind() {
- return kind;
- }
-
- /**
- * Returns the expected target.
- *
- * @return The expected target.
- */
- @Override
- public String target() {
- return target;
- }
- }
-
- /**
- * Does some test steps with a {@link Proof}.
- *
- * @param baseDir The base directory which contains test and oracle file.
- * @param javaPathInBaseDir The path to the java file inside the base directory.
- * @param containerTypeName The name of the type which contains the method.
- * @param targetName The target name to search.
- * @param useContracts Use contracts or inline method bodies instead.
- * @param tester The {@link IProofTester} which executes the test steps.
- * @throws Exception Occurred Exception.
- */
- protected void doProofFunctionTest(@Nullable Path baseDir, String javaPathInBaseDir,
- String containerTypeName, final String targetName, boolean useContracts,
- IProofTester tester) throws Exception {
- assertNotNull(tester);
- KeYEnvironment> environment = null;
- Proof proof = null;
- Map originalTacletOptions = null;
- boolean usePrettyPrinting = ProofIndependentSettings.isUsePrettyPrinting();
- try {
- // Disable pretty printing to make tests more robust against different term
- // representations
- ProofIndependentSettings.setUsePrettyPrinting(false);
- // Make sure that required files exists
- if (javaPathInBaseDir.startsWith("/")) {
- javaPathInBaseDir = javaPathInBaseDir.substring(1);
- }
- Path javaFile = baseDir.resolve(javaPathInBaseDir);
- assertTrue(Files.exists(javaFile));
- // Make sure that the correct taclet options are defined.
- originalTacletOptions = HelperClassForTests.setDefaultTacletOptionsForTarget(javaFile,
- containerTypeName, targetName);
- if (!useContracts) {
- // set non modular reasoning
- ChoiceSettings choiceSettings = ProofSettings.DEFAULT_SETTINGS.getChoiceSettings();
- ImmutableSet cs = DefaultImmutableSet.nil();
- cs = cs.add(new Choice("noRestriction", "methodExpansion"));
- choiceSettings.updateWith(cs);
- }
- // Load java file
- environment = KeYEnvironment.load(javaFile, null, null, null);
- // Search type
- KeYJavaType containerKJT =
- environment.getJavaInfo().getTypeByClassName(containerTypeName, null);
- assertNotNull(containerKJT);
- // Search observer function
- ImmutableSet targets =
- environment.getSpecificationRepository().getContractTargets(containerKJT);
- IObserverFunction target =
- CollectionUtil.search(targets, element -> targetName.equals(element.toString()));
- assertNotNull(target);
- // Find first contract.
- ImmutableSet contracts =
- environment.getSpecificationRepository().getContracts(containerKJT, target);
- assertFalse(contracts.isEmpty());
- Contract contract = contracts.iterator().next();
- // Start proof
- proof = environment
- .createProof(contract.createProofObl(environment.getInitConfig(), contract));
- assertNotNull(proof);
- // Start auto mode
- doProofTest(environment, proof, useContracts, tester);
- } finally {
- ProofIndependentSettings.setUsePrettyPrinting(usePrettyPrinting);
- // Restore taclet options
- HelperClassForTests.restoreTacletOptions(originalTacletOptions);
- // Dispose proof and environment
- if (proof != null) {
- proof.dispose();
- }
- if (environment != null) {
- environment.dispose();
- }
- }
- }
-
- /**
- * Does some test steps with a {@link Proof}.
- *
- * @param baseDir The base directory which contains test and oracle file.
- * @param javaPathInBaseDir The path to the java file inside the base directory.
- * @param containerTypeName The name of the type which contains the method.
- * @param methodFullName The method name to search.
- * @param useContracts Use contracts or inline method bodies instead.
- * @param tester The {@link IProofTester} which executes the test steps.
- * @throws Exception Occurred Exception.
- */
- protected void doProofMethodTest(@Nullable Path baseDir, String javaPathInBaseDir,
- String containerTypeName, String methodFullName, boolean useContracts,
- IProofTester tester) throws Exception {
- assertNotNull(tester);
- KeYEnvironment> environment = null;
- Proof proof = null;
- Map originalTacletOptions = null;
- boolean usePrettyPrinting = ProofIndependentSettings.isUsePrettyPrinting();
- try {
- // Disable pretty printing to make tests more robust against different term
- // representations
- ProofIndependentSettings.setUsePrettyPrinting(false);
- // Make sure that required files exists
- if (javaPathInBaseDir.startsWith("/")) {
- javaPathInBaseDir = javaPathInBaseDir.substring(1);
- }
- Path javaFile = baseDir.resolve(javaPathInBaseDir);
- assertTrue(Files.exists(javaFile));
- // Make sure that the correct taclet options are defined.
- originalTacletOptions =
- HelperClassForTests.setDefaultTacletOptions(baseDir, javaPathInBaseDir);
-
- if (!useContracts) {
- // set non modular reasoning
- ChoiceSettings choiceSettings = ProofSettings.DEFAULT_SETTINGS.getChoiceSettings();
- ImmutableSet cs = DefaultImmutableSet.nil();
- cs = cs.add(new Choice("noRestriction", "methodExpansion"));
- choiceSettings.updateWith(cs);
- }
- // Load java file
- environment = KeYEnvironment.load(javaFile, null, null, null);
- // Search method to proof
- IProgramMethod pm = HelperClassForTests.searchProgramMethod(environment.getServices(),
- containerTypeName, methodFullName);
- // Find first contract.
- ImmutableSet operationContracts = environment
- .getSpecificationRepository().getOperationContracts(pm.getContainerType(), pm);
- assertFalse(operationContracts.isEmpty());
- FunctionalOperationContract foc = operationContracts.iterator().next();
- // Start proof
- proof = environment.createProof(foc.createProofObl(environment.getInitConfig(), foc));
- assertNotNull(proof);
- // Start auto mode
- doProofTest(environment, proof, useContracts, tester);
- } finally {
- ProofIndependentSettings.setUsePrettyPrinting(usePrettyPrinting);
- // Restore taclet options
- HelperClassForTests.restoreTacletOptions(originalTacletOptions);
- // Dispose proof and environment
- if (proof != null) {
- proof.dispose();
- }
- if (environment != null) {
- environment.dispose();
- }
- }
- }
-
- /**
- * Does some test steps with a {@link Proof}.
- *
- * @param environment The {@link KeYEnvironment} which provides the {@link Proof}.
- * @param proof The {@link Proof} to test.
- * @param useContracts Use contracts or inline method bodies instead.
- * @param tester The {@link IProofTester} which executes the test steps.
- * @throws Exception Occurred Exception.
- */
- protected void doProofTest(KeYEnvironment> environment, Proof proof, boolean useContracts,
- IProofTester tester) throws Exception {
- // Test parameters
- assertNotNull(environment);
- assertNotNull(proof);
- assertNotNull(tester);
- // Start auto mode
- StrategyProperties sp = new StrategyProperties();
- StrategyProperties.setDefaultStrategyProperties(sp, true, useContracts, false, false, false,
- false);
- proof.getSettings().getStrategySettings().setActiveStrategyProperties(sp);
- proof.getSettings().getStrategySettings().setMaxSteps(1000);
- environment.getProofControl().startAndWaitForAutoMode(proof);
- // Do test
- tester.doTest(environment, proof);
- }
-
- /**
- * Executes some proof steps with on given {@link Proof}.
- *
- * @author Martin Hentschel
- */
- protected interface IProofTester {
- /**
- * Execute the test.
- *
- * @param environment The {@link KeYEnvironment} to test.
- * @param proof The {@link Proof} to test.
- * @throws Exception Occurred Exception.
- */
- void doTest(KeYEnvironment> environment, Proof proof) throws Exception;
- }
-}
diff --git a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/TestKeYTypeUtil.java b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/TestKeYTypeUtil.java
deleted file mode 100644
index 0a812386886..00000000000
--- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/TestKeYTypeUtil.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.testcase;
-
-
-import de.uka.ilkd.key.control.KeYEnvironment;
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
-import de.uka.ilkd.key.util.KeYTypeUtil;
-
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-/**
- * Tests {@link KeYTypeUtil}.
- *
- * @author Martin Hentschel
- */
-public class TestKeYTypeUtil extends AbstractProofReferenceTestCase {
- /**
- * Tests {@link KeYTypeUtil#isInnerType(Services, KeYJavaType)}.
- */
- @Test
- public void testIsInnerType() throws Exception {
- KeYEnvironment> environment = KeYEnvironment.load(
- TESTCASE_DIRECTORY.resolve("proofReferences/InnerAndAnonymousTypeTest"),
- null, null, null);
- try {
- Services services = environment.getServices();
- assertNotNull(services);
- // Get KeYJavaTypes to test
- KeYJavaType typeWithoutPackage =
- KeYTypeUtil.getType(services, "InnerAndAnonymousTypeTest");
- assertNotNull(typeWithoutPackage);
- KeYJavaType typeWithPackage =
- KeYTypeUtil.getType(services, "model.InnerAndAnonymousTypeTest");
- assertNotNull(typeWithPackage);
- KeYJavaType innerTypeWithoutPackage =
- KeYTypeUtil.getType(services, "InnerAndAnonymousTypeTest.IGetter");
- assertNotNull(innerTypeWithoutPackage);
- KeYJavaType innerTypeWithPackage =
- KeYTypeUtil.getType(services, "model.InnerAndAnonymousTypeTest.IGetter");
- assertNotNull(innerTypeWithPackage);
- // Test null
- assertFalse(KeYTypeUtil.isInnerType(services, null));
- assertFalse(KeYTypeUtil.isInnerType(null, typeWithoutPackage));
- assertFalse(KeYTypeUtil.isInnerType(null, null));
- // Test class without package
- assertFalse(KeYTypeUtil.isInnerType(services, typeWithoutPackage));
- // Test class with package
- assertFalse(KeYTypeUtil.isInnerType(services, typeWithPackage));
- // Test inner class without package
- assertTrue(KeYTypeUtil.isInnerType(services, innerTypeWithoutPackage));
- // Test inner class with package
- assertTrue(KeYTypeUtil.isInnerType(services, innerTypeWithPackage));
- } finally {
- environment.dispose();
- }
- }
-
- /**
- * Tests {@link KeYTypeUtil#getParentName(Services, KeYJavaType)}.
- */
- @Test
- public void testGetParentName() throws Exception {
- KeYEnvironment> environment = KeYEnvironment.load(
- TESTCASE_DIRECTORY.resolve("proofReferences/InnerAndAnonymousTypeTest"),
- null, null, null);
- try {
- Services services = environment.getServices();
- assertNotNull(services);
- // Get KeYJavaTypes to test
- KeYJavaType typeWithoutPackage =
- KeYTypeUtil.getType(services, "InnerAndAnonymousTypeTest");
- assertNotNull(typeWithoutPackage);
- KeYJavaType typeWithPackage =
- KeYTypeUtil.getType(services, "model.InnerAndAnonymousTypeTest");
- assertNotNull(typeWithPackage);
- KeYJavaType innerTypeWithoutPackage =
- KeYTypeUtil.getType(services, "InnerAndAnonymousTypeTest.IGetter");
- assertNotNull(innerTypeWithoutPackage);
- KeYJavaType innerTypeWithPackage =
- KeYTypeUtil.getType(services, "model.InnerAndAnonymousTypeTest.IGetter");
- assertNotNull(innerTypeWithPackage);
- // Test null
- assertNull(KeYTypeUtil.getParentName(services, null));
- assertNull(KeYTypeUtil.getParentName(null, typeWithoutPackage));
- assertNull(KeYTypeUtil.getParentName(null, null));
- // Test class without package
- assertNull(KeYTypeUtil.getParentName(services, typeWithoutPackage));
- // Test class with package
- assertEquals("model", KeYTypeUtil.getParentName(services, typeWithPackage));
- // Test inner class without package
- assertEquals("InnerAndAnonymousTypeTest",
- KeYTypeUtil.getParentName(services, innerTypeWithoutPackage));
- // Test inner class with package
- assertEquals("model.InnerAndAnonymousTypeTest",
- KeYTypeUtil.getParentName(services, innerTypeWithPackage));
- } finally {
- environment.dispose();
- }
- }
-
- /**
- * Tests {@link KeYTypeUtil#isType(Services, String)}.
- */
- @Test
- public void testIsType() throws Exception {
- KeYEnvironment> environment = KeYEnvironment.load(
- TESTCASE_DIRECTORY.resolve("proofReferences/InnerAndAnonymousTypeTest"),
- null, null, null);
- try {
- Services services = environment.getServices();
- assertNotNull(services);
- // Test null
- assertFalse(KeYTypeUtil.isType(services, null));
- assertFalse(KeYTypeUtil.isType(null, "InnerAndAnonymousTypeTest"));
- assertFalse(KeYTypeUtil.isType(null, null));
- // Test invalid names
- assertFalse(KeYTypeUtil.isType(services, "Invalid"));
- assertFalse(KeYTypeUtil.isType(services, "model.Invalid"));
- assertFalse(KeYTypeUtil.isType(services, "invalid.Invalid"));
- assertFalse(KeYTypeUtil.isType(services, "InnerAndAnonymousTypeTest.Invalid"));
- assertFalse(KeYTypeUtil.isType(services, "model.InnerAndAnonymousTypeTest.Invalid"));
- // Test class without package
- assertTrue(KeYTypeUtil.isType(services, "InnerAndAnonymousTypeTest"));
- // Test class with package
- assertTrue(KeYTypeUtil.isType(services, "model.InnerAndAnonymousTypeTest"));
- // Test inner class without package
- assertTrue(KeYTypeUtil.isType(services, "InnerAndAnonymousTypeTest.IGetter"));
- // Test inner class with package
- assertTrue(
- KeYTypeUtil.isType(services, "model.InnerAndAnonymousTypeTest.IGetter"));
- } finally {
- environment.dispose();
- }
- }
-
- /**
- * Tests {@link KeYTypeUtil#getType(de.uka.ilkd.key.java.Services, String)}.
- */
- @Test
- public void testGetType() throws Exception {
- KeYEnvironment> environment = KeYEnvironment.load(
- TESTCASE_DIRECTORY.resolve("proofReferences/InnerAndAnonymousTypeTest"),
- null, null, null);
- try {
- Services services = environment.getServices();
- assertNotNull(services);
- // Test null
- assertNull(KeYTypeUtil.getType(services, null));
- assertNull(KeYTypeUtil.getType(null, "InnerAndAnonymousTypeTest"));
- assertNull(KeYTypeUtil.getType(null, null));
- // Test invalid names
- assertNull(KeYTypeUtil.getType(services, "Invalid"));
- assertNull(KeYTypeUtil.getType(services, "model.Invalid"));
- assertNull(KeYTypeUtil.getType(services, "invalid.Invalid"));
- assertNull(KeYTypeUtil.getType(services, "InnerAndAnonymousTypeTest.Invalid"));
- assertNull(
- KeYTypeUtil.getType(services, "model.InnerAndAnonymousTypeTest.Invalid"));
- // Test class without package
- KeYJavaType kjt = KeYTypeUtil.getType(services, "InnerAndAnonymousTypeTest");
- assertEquals("InnerAndAnonymousTypeTest", kjt.getFullName());
- // Test class with package
- kjt = KeYTypeUtil.getType(services, "model.InnerAndAnonymousTypeTest");
- assertEquals("model.InnerAndAnonymousTypeTest", kjt.getFullName());
- // Test inner class without package
- kjt = KeYTypeUtil.getType(services, "InnerAndAnonymousTypeTest.IGetter");
- assertEquals("InnerAndAnonymousTypeTest.IGetter", kjt.getFullName());
- // Test inner class with package
- kjt = KeYTypeUtil.getType(services, "model.InnerAndAnonymousTypeTest.IGetter");
- assertEquals("model.InnerAndAnonymousTypeTest.IGetter", kjt.getFullName());
- } finally {
- environment.dispose();
- }
- }
-}
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
deleted file mode 100644
index a18c903bd53..00000000000
--- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/TestProofReferenceUtil.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.testcase;
-
-import java.nio.file.Path;
-import java.util.LinkedHashSet;
-
-import de.uka.ilkd.key.proof.Node;
-import de.uka.ilkd.key.proof.Proof;
-import de.uka.ilkd.key.proof_references.ProofReferenceUtil;
-import de.uka.ilkd.key.proof_references.analyst.ContractProofReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.analyst.IProofReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.analyst.MethodBodyExpandProofReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-
-import org.key_project.util.collection.ImmutableList;
-
-import org.jspecify.annotations.Nullable;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests for {@link ProofReferenceUtil}.
- *
- * @author Martin Hentschel
- */
-public class TestProofReferenceUtil extends AbstractProofReferenceTestCase {
- /**
- * Tests {@link ProofReferenceUtil#computeProofReferences(Proof, ImmutableList)}
- */
- @Test
- public void testReferenceComputation_ExpandAndContract() throws Exception {
- doAPITest(TESTCASE_DIRECTORY,
- "/proofReferences/UseOperationContractTest/UseOperationContractTest.java",
- "UseOperationContractTest", "main", true,
- ImmutableList.nil().append(
- new MethodBodyExpandProofReferencesAnalyst(), new ContractProofReferencesAnalyst()),
- new ExpectedProofReferences(IProofReference.INLINE_METHOD,
- "UseOperationContractTest::main"),
- new ExpectedProofReferences(IProofReference.USE_CONTRACT,
- "pre: {heap=java.lang.Object::$inv(heap,self)<>}; mby: null; post: {heap=and(and(equals(result_magic42,Z(2(4(#))))<>,java.lang.Object::$inv(heap,self)<>)<>,equals(exc<>,null)<>)}free post: {heap=true, savedHeap=null}; modifiable: {heap=allLocs, savedHeap=null}; hasModifiable: {heap=true, savedHeap=true}; termination: diamond; transaction: false"));
- }
-
- /**
- * Tests {@link ProofReferenceUtil#computeProofReferences(Proof, ImmutableList)}
- */
- @Test
- public void testReferenceComputation_NoAnalysts() throws Exception {
- doAPITest(TESTCASE_DIRECTORY, "/proofReferences/MethodBodyExpand/MethodBodyExpand.java",
- "MethodBodyExpand", "main", false, ImmutableList.nil());
- }
-
- /**
- * Tests {@link ProofReferenceUtil#computeProofReferences(Proof, ImmutableList)}
- */
- @Test
- public void testReferenceComputation_ContractOnly() throws Exception {
- doAPITest(TESTCASE_DIRECTORY, "/proofReferences/MethodBodyExpand/MethodBodyExpand.java",
- "MethodBodyExpand", "main", false, ImmutableList.nil()
- .append(new ContractProofReferencesAnalyst()));
- }
-
- /**
- * Tests {@link ProofReferenceUtil#computeProofReferences(Proof, ImmutableList)}
- */
- @Test
- public void testReferenceComputation_ExpandOnly() throws Exception {
- doAPITest(TESTCASE_DIRECTORY, "/proofReferences/MethodBodyExpand/MethodBodyExpand.java",
- "MethodBodyExpand", "main", false,
- ImmutableList.nil()
- .append(new MethodBodyExpandProofReferencesAnalyst()),
- new ExpectedProofReferences(IProofReference.INLINE_METHOD, "MethodBodyExpand::main"),
- new ExpectedProofReferences(IProofReference.INLINE_METHOD,
- "MethodBodyExpand::magic42"));
- }
-
- /**
- * Tests {@link ProofReferenceUtil#computeProofReferences(Proof)} and
- * {@link ProofReferenceUtil#computeProofReferences(Node)}.
- */
- @Test
- public void testReferenceComputation_DefaultAnalysts() throws Exception {
- doAPITest(TESTCASE_DIRECTORY, "/proofReferences/MethodBodyExpand/MethodBodyExpand.java",
- "MethodBodyExpand", "main", false, null,
- new ExpectedProofReferences(IProofReference.USE_AXIOM,
- "equiv(java.lang.Object::$inv(heap,self),true)"),
- new ExpectedProofReferences(IProofReference.INLINE_METHOD, "MethodBodyExpand::main"),
- new ExpectedProofReferences(IProofReference.CALL_METHOD, "MethodBodyExpand::magic42"),
- new ExpectedProofReferences(IProofReference.INLINE_METHOD,
- "MethodBodyExpand::magic42"));
- }
-
- /**
- * Executes the test steps of test methods.
- *
- * @param baseDir The base directory which contains test and oracle file.
- * @param javaPathInBaseDir The path to the java file inside the base directory.
- * @param containerTypeName The name of the type which contains the method.
- * @param methodFullName The method name to search.
- * @param useContracts Use method contracts or inline method bodies instead?
- * @param analysts The {@link IProofReferencesAnalyst} to use.
- * @param expectedReferences The expected proof references.
- * @throws Exception Occurred Exception.
- */
- protected void doAPITest(@Nullable Path baseDir, String javaPathInBaseDir,
- String containerTypeName,
- String methodFullName, boolean useContracts,
- final ImmutableList analysts,
- final ExpectedProofReferences... expectedReferences) throws Exception {
- IProofTester tester = (environment, proof) -> {
- // Extract and assert proof references
- final LinkedHashSet> references =
- analysts != null ? ProofReferenceUtil.computeProofReferences(proof, analysts)
- : ProofReferenceUtil.computeProofReferences(proof);
- assertReferences(references, expectedReferences);
- // Test references of each node individually
- proof.breadthFirstSearch(proof.root(), (proof1, visitedNode) -> {
- LinkedHashSet> expectedNodeRefs =
- findReferences(references, visitedNode);
- LinkedHashSet> currentNodeRefs = analysts != null
- ? ProofReferenceUtil.computeProofReferences(visitedNode,
- proof1.getServices(), analysts)
- : ProofReferenceUtil.computeProofReferences(visitedNode,
- proof1.getServices());
- assertReferences(expectedNodeRefs, currentNodeRefs);
- });
- };
- doProofMethodTest(baseDir, javaPathInBaseDir, containerTypeName, methodFullName,
- useContracts, tester);
- }
-}
diff --git a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestClassAxiomAndInvariantProofReferencesAnalyst.java b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestClassAxiomAndInvariantProofReferencesAnalyst.java
deleted file mode 100644
index c072c1fa539..00000000000
--- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestClassAxiomAndInvariantProofReferencesAnalyst.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.testcase.analyst;
-
-import de.uka.ilkd.key.proof_references.analyst.ClassAxiomAndInvariantProofReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.proof_references.testcase.AbstractProofReferenceTestCase;
-
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests for {@link ClassAxiomAndInvariantProofReferencesAnalyst}.
- *
- * @author Martin Hentschel
- */
-public class TestClassAxiomAndInvariantProofReferencesAnalyst
- extends AbstractProofReferenceTestCase {
- /**
- * Tests "InvariantInOperationContractOfArgument".
- */
- @Test
- public void testInvariantInOperationContractOfArgument() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/InvariantInOperationContractOfArgument/InvariantInOperationContractOfArgument.java",
- "InvariantInOperationContractOfArgument", "main", false,
- new ClassAxiomAndInvariantProofReferencesAnalyst(),
- element -> IProofReference.USE_INVARIANT.equals(element.getKind()),
- new ExpectedProofReferences(IProofReference.USE_INVARIANT,
- "and(geq(select<[int]>(heap,self,Child::$x),Z(0(#))),leq(select<[int]>(heap,self,Child::$x),Z(0(1(#)))))<>"));
- }
-
- /**
- * Tests "InvariantInOperationContract".
- */
- @Test
- public void testInvariantInOperationContract() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/InvariantInOperationContract/InvariantInOperationContract.java",
- "InvariantInOperationContract", "main", false,
- new ClassAxiomAndInvariantProofReferencesAnalyst(),
- element -> IProofReference.USE_AXIOM.equals(element.getKind()),
- new ExpectedProofReferences(IProofReference.USE_AXIOM,
- "equiv(java.lang.Object::$inv(heap,self),not(equals(Child::select(heap,self,InvariantInOperationContract::$child),null))<>)"));
- }
-
- /**
- * Tests "NestedInvariantInOperationContract".
- */
- @Test
- public void testNestedInvariantInOperationContract() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/NestedInvariantInOperationContract/NestedInvariantInOperationContract.java",
- "NestedInvariantInOperationContract", "main", false,
- new ClassAxiomAndInvariantProofReferencesAnalyst(),
- element -> IProofReference.USE_AXIOM.equals(element.getKind()),
- new ExpectedProofReferences(IProofReference.USE_AXIOM,
- "equiv(java.lang.Object::$inv(heap,self),not(equals(ChildContainer::select(heap,self,NestedInvariantInOperationContract::$cc),null))<>)"));
- }
-
- /**
- * Tests "ModelFieldTest#doubleX".
- */
- @Test
- public void testModelFieldTest_doubleX() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ModelFieldTest/ModelFieldTest.java", "test.ModelFieldTest", "doubleX",
- false, new ClassAxiomAndInvariantProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.USE_AXIOM,
- "equiv(java.lang.Object::$inv(heap,self),true)"),
- new ExpectedProofReferences(IProofReference.USE_AXIOM,
- "equals(test.ModelFieldTest::$f(heap,self),mul(Z(2(#)),select<[int]>(heap,self,test.ModelFieldTest::$x)))"));
- }
-
- /**
- * Tests "ModelFieldTest#test.ModelFieldTest::$f".
- */
- @Test
- public void testModelFieldTest_f() throws Exception {
- doReferenceFunctionTest(TESTCASE_DIRECTORY,
- "/proofReferences/ModelFieldTest/ModelFieldTest.java", "test.ModelFieldTest",
- "test.ModelFieldTest::$f", false, new ClassAxiomAndInvariantProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.USE_AXIOM,
- "equiv(java.lang.Object::$inv(heap,self),true)"),
- new ExpectedProofReferences(IProofReference.USE_AXIOM,
- "equals(test.ModelFieldTest::$f(heap,self),mul(Z(2(#)),select<[int]>(heap,self,test.ModelFieldTest::$x)))"));
- }
-
- /**
- * Tests "AccessibleTest".
- */
- public void testAccessibleTest() throws Exception {
- doReferenceFunctionTest(TESTCASE_DIRECTORY,
- "/proofReferences/AccessibleTest/AccessibleTest.java", "test.B",
- "java.lang.Object::$inv", false, new ClassAxiomAndInvariantProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.USE_AXIOM,
- "equiv(java.lang.Object::$inv(heap,self),java.lang.Object::$inv(heap,test.AccessibleTest::select(heap,self,test.B::$c)))"));
- }
-}
diff --git a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestContractProofReferencesAnalyst.java b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestContractProofReferencesAnalyst.java
deleted file mode 100644
index 6e38cb1600f..00000000000
--- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestContractProofReferencesAnalyst.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.testcase.analyst;
-
-import de.uka.ilkd.key.proof_references.analyst.ContractProofReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.proof_references.testcase.AbstractProofReferenceTestCase;
-
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests for {@link ContractProofReferencesAnalyst}.
- *
- * @author Martin Hentschel
- */
-public class TestContractProofReferencesAnalyst extends AbstractProofReferenceTestCase {
- /**
- * Tests "UseOperationContractTest".
- */
- @Test
- public void testUseOperationContracts() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/UseOperationContractTest/UseOperationContractTest.java",
- "UseOperationContractTest", "main", true, new ContractProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.USE_CONTRACT,
- "pre: {heap=java.lang.Object::$inv(heap,self)<>}; mby: null; post: {heap=and(and(equals(result_magic42,Z(2(4(#))))<>,java.lang.Object::$inv(heap,self)<>)<>,equals(exc<>,null)<>)}free post: {heap=true, savedHeap=null}; modifiable: {heap=allLocs, savedHeap=null}; hasModifiable: {heap=true, savedHeap=true}; termination: diamond; transaction: false"));
- }
-}
diff --git a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestMethodBodyExpandProofReferencesAnalyst.java b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestMethodBodyExpandProofReferencesAnalyst.java
deleted file mode 100644
index 39762ced385..00000000000
--- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestMethodBodyExpandProofReferencesAnalyst.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.testcase.analyst;
-
-import de.uka.ilkd.key.proof_references.analyst.MethodBodyExpandProofReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.proof_references.testcase.AbstractProofReferenceTestCase;
-
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests for {@link MethodBodyExpandProofReferencesAnalyst}.
- *
- * @author Martin Hentschel
- */
-public class TestMethodBodyExpandProofReferencesAnalyst extends AbstractProofReferenceTestCase {
- /**
- * Tests "MethodBodyExpand".
- */
- @Test
- public void testMethodBodyExpand() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/MethodBodyExpand/MethodBodyExpand.java", "MethodBodyExpand", "main",
- false, new MethodBodyExpandProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.INLINE_METHOD, "MethodBodyExpand::main"),
- new ExpectedProofReferences(IProofReference.INLINE_METHOD,
- "MethodBodyExpand::magic42"));
- }
-}
diff --git a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestMethodCallProofReferencesAnalyst.java b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestMethodCallProofReferencesAnalyst.java
deleted file mode 100644
index 68c598bdc6f..00000000000
--- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestMethodCallProofReferencesAnalyst.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.testcase.analyst;
-
-import de.uka.ilkd.key.proof_references.analyst.MethodCallProofReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.proof_references.testcase.AbstractProofReferenceTestCase;
-
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests for {@link MethodCallProofReferencesAnalyst}.
- *
- * @author Martin Hentschel
- */
-public class TestMethodCallProofReferencesAnalyst extends AbstractProofReferenceTestCase {
- /**
- * Tests "constructorTest".
- */
- @Test
- public void testConstructorTest() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/constructorTest/ConstructorTest.java", "ConstructorTest",
- "ConstructorTest", false, new MethodCallProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.CALL_METHOD,
- "ConstructorTest::$createObject"),
- new ExpectedProofReferences(IProofReference.CALL_METHOD, "ConstructorTest::$allocate"),
- new ExpectedProofReferences(IProofReference.CALL_METHOD,
- "ConstructorTest::$prepareEnter"),
- new ExpectedProofReferences(IProofReference.CALL_METHOD, "java.lang.Object::$prepare"),
- new ExpectedProofReferences(IProofReference.CALL_METHOD, "java.lang.Object::$init"),
- new ExpectedProofReferences(IProofReference.CALL_METHOD, "A::magic"),
- new ExpectedProofReferences(IProofReference.CALL_METHOD, "B::staticMagic"));
- }
-
- /**
- * Tests "methodCall".
- */
- @Test
- public void testMethodCall() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/methodCall/MethodCall.java",
- "methodCall.MethodCall", "caller", false, new MethodCallProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.CALL_METHOD, "methodCall.Class::a"));
- }
-
- /**
- * Tests "methodCallSuper".
- */
- @Test
- public void testMethodCallSuper() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/methodCallSuper/MethodCallSuper.java",
- "methodCallSuper.MethodCallSuper", "caller", false,
- new MethodCallProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.CALL_METHOD, "methodCallSuper.Super::a"));
- }
-
- /**
- * Tests "methodCallWithAssignment".
- */
- @Test
- public void testMethodCallWithAssignment() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/methodCallWithAssignment/MethodCall.java",
- "methodCallWithAssignment.MethodCall", "caller", false,
- new MethodCallProofReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.CALL_METHOD, "methodCallWithAssignment.Class::a"));
- }
-
- /**
- * Tests "methodCallWithAssignmentSuper".
- */
- @Test
- public void testMethodCallWithAssignmentSuper() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/methodCallWithAssignmentSuper/MethodCallWithAssignmentSuper.java",
- "methodCallWithAssignmentSuper.MethodCallWithAssignmentSuper", "caller", false,
- new MethodCallProofReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.CALL_METHOD, "methodCallWithAssignmentSuper.Super::a"));
- }
-
- /**
- * Tests "methodCallWithAssignmentWithinClass".
- */
- @Test
- public void testMethodCallWithAssignmentWithinClass() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/methodCallWithAssignmentWithinClass/MethodCallWithAssignmentWithinClass.java",
- "methodCallWithAssignmentWithinClass.MethodCallWithAssignmentWithinClass", "caller",
- false, new MethodCallProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.CALL_METHOD,
- "methodCallWithAssignmentWithinClass.MethodCallWithAssignmentWithinClass::callme"));
- }
-
- /**
- * Tests "methodCallWithinClass".
- */
- @Test
- public void testMethodCallWithinClass() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/methodCallWithinClass/MethodCallWithinClass.java",
- "methodCallWithinClass.MethodCallWithinClass", "caller", false,
- new MethodCallProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.CALL_METHOD,
- "methodCallWithinClass.MethodCallWithinClass::callme"));
- }
-
- /**
- * Tests "staticMethodCall".
- */
- @Test
- public void testStaticMethodCall() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/staticMethodCall/StaticMethodCall.java",
- "staticMethodCall.StaticMethodCall", "caller", false,
- new MethodCallProofReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.CALL_METHOD, "staticMethodCall.StaticClass::callMe"));
- }
-
- /**
- * Tests "staticMethodCallStaticViaTypereference".
- */
- @Test
- public void testStaticMethodCallStaticViaTypereference() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/staticMethodCallStaticViaTypereference/StaticMethodCallStaticViaTypereference.java",
- "staticMethodCallStaticViaTypereference.StaticMethodCallStaticViaTypereference",
- "caller", false, new MethodCallProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.CALL_METHOD,
- "staticMethodCallStaticViaTypereference.StaticClass::callMe"));
- }
-
- /**
- * Tests "staticMethodCallStaticWithAssignmentViaTypereference".
- */
- @Test
- public void testStaticMethodCallStaticWithAssignmentViaTypereference() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/staticMethodCallStaticWithAssignmentViaTypereference/StaticMethodCallStaticWithAssignmentViaTypereference.java",
- "staticMethodCallStaticWithAssignmentViaTypereference.StaticMethodCallStaticWithAssignmentViaTypereference",
- "caller", false, new MethodCallProofReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.CALL_METHOD,
- "staticMethodCallStaticWithAssignmentViaTypereference.StaticClass::callMe"));
- }
-}
diff --git a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestProgramVariableReferencesAnalyst.java b/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestProgramVariableReferencesAnalyst.java
deleted file mode 100644
index f19c622bea4..00000000000
--- a/key.core.proof_references/src/test/java/de/uka/ilkd/key/proof_references/testcase/analyst/TestProgramVariableReferencesAnalyst.java
+++ /dev/null
@@ -1,782 +0,0 @@
-/* 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 de.uka.ilkd.key.proof_references.testcase.analyst;
-
-import de.uka.ilkd.key.proof_references.analyst.ProgramVariableReferencesAnalyst;
-import de.uka.ilkd.key.proof_references.reference.IProofReference;
-import de.uka.ilkd.key.proof_references.testcase.AbstractProofReferenceTestCase;
-
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests for {@link ProgramVariableReferencesAnalyst}.
- *
- * @author Martin Hentschel
- */
-public class TestProgramVariableReferencesAnalyst extends AbstractProofReferenceTestCase {
- /**
- * Tests "ConditionalsAndOther#forEquals".
- */
- @Test
- public void testConditionalsAndOther_forEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "forEquals", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#forBoolean".
- */
- @Test
- public void testConditionalsAndOther_forBoolean() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "forBoolean", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#doWhileEquals".
- */
- @Test
- public void testConditionalsAndOther_doWhileEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "doWhileEquals", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#doWhileBoolean".
- */
- @Test
- public void testConditionalsAndOther_doWhileBoolean() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "doWhileBoolean", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#whileEquals".
- */
- @Test
- public void testConditionalsAndOther_whileEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "whileEquals", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#whileBoolean".
- */
- @Test
- public void testConditionalsAndOther_whileBoolean() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "whileBoolean", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#throwsNestedException".
- */
- @Test
- public void testConditionalsAndOther_throwsNestedException() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "throwsNestedException", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::ew"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "ConditionalsAndOther.ExceptionWrapper::wrapped"));
- }
-
- /**
- * Tests "ConditionalsAndOther#throwsException".
- */
- @Test
- public void testConditionalsAndOther_throwsException() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "throwsException", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::e"));
- }
-
- /**
- * Tests "ConditionalsAndOther#methodCallCondtional".
- */
- @Test
- public void testConditionalsAndOther_methodCallConditional() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "methodCallCondtional", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#methodCallAssignment".
- */
- @Test
- public void testConditionalsAndOther_methodCallAssignment() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "methodCallAssignment", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#methodCall".
- */
- @Test
- public void testConditionalsAndOther_methodCall() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "methodCall", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#returnComplex".
- */
- @Test
- public void testConditionalsAndOther_returnComplex() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "returnComplex", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#returnEquals".
- */
- @Test
- public void testConditionalsAndOther_returnEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "returnEquals", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#returnBoolean".
- */
- @Test
- public void testConditionalsAndOther_returnBoolean() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "returnBoolean", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#questionIncrementsAndDecrements".
- */
- @Test
- public void testConditionalsAndOther_questionIncrementsAndDecrements() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "questionIncrementsAndDecrements", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"));
- }
-
- /**
- * Tests "ConditionalsAndOther#ifIncrementsAndDecrements".
- */
- @Test
- public void testConditionalsAndOther_ifIncrementsAndDecrements() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "ifIncrementsAndDecrements", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"));
- }
-
- /**
- * Tests "ConditionalsAndOther#questionGreater".
- */
- @Test
- public void testConditionalsAndOther_questionGreater() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "questionGreater", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#questionGreaterEquals".
- */
- @Test
- public void testConditionalsAndOther_questionGreaterEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "questionGreaterEquals", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#questionNotEquals".
- */
- @Test
- public void testConditionalsAndOther_questionNotEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "questionNotEquals", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#questionEquals".
- */
- @Test
- public void testConditionalsAndOther_questionEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "questionEquals", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#questionLessEquals".
- */
- @Test
- public void testConditionalsAndOther_questionLessEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "questionLessEquals", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#questionLess".
- */
- @Test
- public void testConditionalsAndOther_questionLess() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "questionLess", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#questionBoolean".
- */
- @Test
- public void testConditionalsAndOther_questionBoolean() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "questionBoolean", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#ifGreater".
- */
- @Test
- public void testConditionalsAndOther_ifGreater() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "ifGreater", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#ifGreaterEquals".
- */
- @Test
- public void testConditionalsAndOther_ifGreaterEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "ifGreaterEquals", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#ifNotEquals".
- */
- @Test
- public void testConditionalsAndOther_ifNotEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "ifNotEquals", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#ifEquals".
- */
- @Test
- public void testConditionalsAndOther_ifEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "ifEquals", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#ifLessEquals".
- */
- @Test
- public void testConditionalsAndOther_ifLessEquals() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "ifLessEquals", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#ifLess".
- */
- @Test
- public void testConditionalsAndOther_ifLess() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "ifLess", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::y"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ConditionalsAndOther#ifBoolean".
- */
- @Test
- public void testConditionalsAndOther_ifBoolean() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "ifBoolean", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::b"));
- }
-
- /**
- * Tests "ConditionalsAndOther#switchInt".
- */
- @Test
- public void testConditionalsAndOther_switchInt() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java",
- "ConditionalsAndOther", "switchInt", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ConditionalsAndOther::x"));
- }
-
- /**
- * Tests "ArrayLength".
- */
- @Test
- public void testArrayLength() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/ArrayLength/ArrayLength.java",
- "ArrayLength", "main", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "ArrayLength::length"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ArrayLength::array"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ArrayLength::my"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ArrayLength.MyClass::length"),
- new ExpectedProofReferences(IProofReference.ACCESS, "ArrayLength.MyClass::array"));
- }
-
- /**
- * Tests "Assignments#assignmentWithSelf".
- */
- @Test
- public void testAssignments_assignmentWithSelf() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "assignmentWithSelf", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::next"));
- }
-
- /**
- * Tests "Assignments#nestedArray".
- */
- @Test
- public void testAssignments_nestedArray() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "nestedArray", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::myClass"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments.MyClass::child"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "Assignments.MyChildClass::childArray"));
- }
-
- /**
- * Tests "Assignments#nestedValueAdd".
- */
- @Test
- public void testAssignments_nestedValueAdd() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "nestedValueAdd", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::myClass"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments.MyClass::child"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "Assignments.MyChildClass::thirdChildValue"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "Assignments.MyChildClass::anotherChildValue"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "Assignments.MyChildClass::childValue"));
- }
-
- /**
- * Tests "Assignments#nestedValue".
- */
- @Test
- public void testAssignments_nestedValue() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "nestedValue", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::myClass"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments.MyClass::child"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "Assignments.MyChildClass::anotherChildValue"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "Assignments.MyChildClass::childValue"));
- }
-
- /**
- * Tests "Assignments#assign".
- */
- @Test
- public void testAssignments_assign() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "assign", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::anotherValue"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#mod".
- */
- @Test
- public void testAssignments_mod() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "mod", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::anotherValue"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#div".
- */
- @Test
- public void testAssignments_div() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "div", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::anotherValue"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#mul".
- */
- @Test
- public void testAssignments_mul() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "mul", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::anotherValue"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#sub".
- */
- @Test
- public void testAssignments_sub() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "sub", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::anotherValue"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#add".
- */
- @Test
- public void testAssignments_add() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "add", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::anotherValue"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#decrementArrayBegin".
- */
- @Test
- public void testAssignments_decrementArrayBegin() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "decrementArrayBegin", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::array"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::anotherValue"));
- }
-
- /**
- * Tests "Assignments#decrementArrayEnd".
- */
- @Test
- public void testAssignments_decrementArrayEnd() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "decrementArrayEnd", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::array"),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::anotherValue"));
- }
-
- /**
- * Tests "Assignments#incrementArrayBegin".
- */
- @Test
- public void testAssignments_incrementArrayBegin() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "incrementArrayBegin", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::array"));
- }
-
- /**
- * Tests "Assignments#incrementArrayEnd".
- */
- @Test
- public void testAssignments_incrementArrayEnd() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "incrementArrayEnd", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::array"));
- }
-
- /**
- * Tests "Assignments#decrementBegin".
- */
- @Test
- public void testAssignments_decrementBegin() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "decrementBegin", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#decrementEnd".
- */
- @Test
- public void testAssignments_decrementEnd() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "decrementEnd", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#incrementBegin".
- */
- @Test
- public void testAssignments_incrementBegin() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "incrementBegin", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "Assignments#incrementEnd".
- */
- @Test
- public void testAssignments_incrementEnd() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/Assignments/Assignments.java",
- "Assignments", "incrementEnd", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "Assignments::value"));
- }
-
- /**
- * Tests "assignment".
- */
- @Test
- public void testAssignment() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY, "/proofReferences/assignment/Assignment.java",
- "assignment.Assignment", "caller", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "assignment.Assignment::b"),
- new ExpectedProofReferences(IProofReference.ACCESS, "assignment.Enum::b"));
- }
-
- /**
- * Tests "assignment_array2".
- */
- @Test
- public void testAssignment_array2() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/assignment_array2/Assignment_array2.java",
- "assignment_array2.Assignment_array2", "caller", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_array2.Assignment_array2::index"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_array2.Assignment_array2::as"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_array2.Assignment_array2::val"));
- }
-
- /**
- * Tests "assignment_read_attribute".
- */
- @Test
- public void testAssignment_read_attribute() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/assignment_read_attribute/Assignment_read_attribute.java",
- "assignment_read_attribute.Assignment_read_attribute", "caller", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_read_attribute.Class::b"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_read_attribute.Class::a"));
- }
-
- /**
- * Tests "assignment_read_length".
- */
- @Test
- public void testAssignment_read_length() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/assignment_read_length/Assignment_read_length.java",
- "assignment_read_length.Assignment_read_length", "caller", false,
- new ProgramVariableReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.ACCESS, "assignment_read_length.Assignment_read_length::b"));
- }
-
- /**
- * Tests "assignment_to_primitive_array_component".
- */
- @Test
- public void testAssignment_to_primitive_array_component() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/assignment_to_primitive_array_component/Assignment_to_primitive_array_component.java",
- "assignment_to_primitive_array_component.Assignment_to_primitive_array_component",
- "caller", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_to_primitive_array_component.Assignment_to_primitive_array_component::index"),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_to_primitive_array_component.Assignment_to_primitive_array_component::bs"));
- }
-
- /**
- * Tests "assignment_to_reference_array_component".
- */
- @Test
- public void testAssignment_to_reference_array_component() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/assignment_to_reference_array_component/Assignment_to_reference_array_component.java",
- "assignment_to_reference_array_component.Assignment_to_reference_array_component",
- "caller", false, new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_to_reference_array_component.Assignment_to_reference_array_component::bs"));
- }
-
- /**
- * Tests "assignment_write_attribute".
- */
- @Test
- public void testAssignment_write_attribute() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/assignment_write_attribute/Assignment_write_attribute.java",
- "assignment_write_attribute.Assignment_write_attribute", "caller", false,
- new ProgramVariableReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.ACCESS, "assignment_write_attribute.Class::a"));
- }
-
- /**
- * Tests "assignment_write_static_attribute".
- */
- @Test
- public void testAssignment_write_static_attribute() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/assignment_write_static_attribute/Assignment_write_static_attribute.java",
- "assignment_write_static_attribute.Assignment_write_static_attribute", "caller", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS,
- "assignment_write_static_attribute.Assignment_write_static_attribute::b"));
- }
-
- /**
- * Tests "activeUseStaticFieldReadAccess2".
- */
- @Test
- public void testActiveUseStaticFieldReadAccess2() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/activeUseStaticFieldReadAccess2/ActiveUseStaticFieldReadAccess2.java",
- "activeUseStaticFieldReadAccess2.ActiveUseStaticFieldReadAccess2", "caller", false,
- new ProgramVariableReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.ACCESS, "activeUseStaticFieldReadAccess2.Class::i"));
- }
-
- /**
- * Tests "activeUseStaticFieldWriteAccess2".
- */
- @Test
- public void testActiveUseStaticFieldWriteAccess2() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/activeUseStaticFieldWriteAccess2/ActiveUseStaticFieldWriteAccess2.java",
- "activeUseStaticFieldWriteAccess2.ActiveUseStaticFieldWriteAccess2", "caller", false,
- new ProgramVariableReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.ACCESS, "activeUseStaticFieldWriteAccess2.Class::a"));
- }
-
- /**
- * Tests "eval_order_access4".
- */
- @Test
- public void testEval_order_access4() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/eval_order_access4/Eval_order_access4.java",
- "eval_order_access4.Eval_order_access4", "caller", false,
- new ProgramVariableReferencesAnalyst(),
- new ExpectedProofReferences(IProofReference.ACCESS, "eval_order_access4.Class::a"));
- }
-
- /**
- * Tests "eval_order_array_access5".
- */
- @Test
- public void testEval_order_array_access5() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/eval_order_array_access5/Eval_order_array_access5.java",
- "eval_order_array_access5.Eval_order_array_access5", "caller", false,
- new ProgramVariableReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.ACCESS, "eval_order_array_access5.Class::a"));
- }
-
- /**
- * Tests "variableDeclarationAssign".
- */
- @Test
- public void testVariableDeclarationAssign() throws Exception {
- doReferenceMethodTest(TESTCASE_DIRECTORY,
- "/proofReferences/variableDeclarationAssign/VariableDeclarationAssign.java",
- "variableDeclarationAssign.VariableDeclarationAssign", "caller", false,
- new ProgramVariableReferencesAnalyst(), new ExpectedProofReferences(
- IProofReference.ACCESS, "variableDeclarationAssign.VariableDeclarationAssign::a"));
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/AccessibleTest/AccessibleTest.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/AccessibleTest/AccessibleTest.java
deleted file mode 100644
index 7f29a730820..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/AccessibleTest/AccessibleTest.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package test;
-
-public class AccessibleTest {
- private int x;
-
- public AccessibleTest(int x) {
- this.x = x;
- }
-}
-
-class B {
- //@ accessible \inv : this.*, c.*;
- public final /*@ nullable @*/ AccessibleTest c;
-
- //@ invariant \invariant_for(c);
-
- B(int x) { c = new AccessibleTest(x); }
-}
\ No newline at end of file
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/ArrayLength/ArrayLength.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/ArrayLength/ArrayLength.java
deleted file mode 100644
index 739b5529449..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/ArrayLength/ArrayLength.java
+++ /dev/null
@@ -1,26 +0,0 @@
-
-public class ArrayLength {
- private int length;
-
- private int[] array;
-
- private MyClass my;
-
- /*@ requires array != null && my != null && my.array != null;
- @ ensures true;
- @*/
- public int main() {
- int result = 0;
- result += length;
- result += array.length;
- result += my.length;
- result += my.array.length;
- return result;
- }
-
- public static class MyClass {
- public int length;
-
- public int[] array;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/Assignments/Assignments.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/Assignments/Assignments.java
deleted file mode 100644
index 4cc9c05db61..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/Assignments/Assignments.java
+++ /dev/null
@@ -1,153 +0,0 @@
-
-public class Assignments {
- int value;
-
- int anotherValue;
-
- int[] array;
-
- MyClass myClass;
-
- Assignments next;
-
- /*@
- @ ensures value == \old(value) + 1;
- @*/
- public void incrementEnd() {
- value++;
- }
-
- /*@
- @ ensures value == \old(value) + 1;
- @*/
- public void incrementBegin() {
- ++value;
- }
-
- /*@
- @ ensures value == \old(value) - 1;
- @*/
- public void decrementEnd() {
- value--;
- }
-
- /*@
- @ ensures value == \old(value) - 1;
- @*/
- public void decrementBegin() {
- --value;
- }
-
- /*@ requires array != null && array.length == 1;
- @ ensures array[0] == \old(array[0]) + 1;
- @*/
- public void incrementArrayEnd() {
- array[0]++;
- }
-
- /*@ requires array != null && array.length == 1;
- @ ensures array[0] == \old(array[0]) + 1;
- @*/
- public void incrementArrayBegin() {
- ++array[0];
- }
-
- /*@ requires array != null && array.length == 1 && anotherValue == 0;
- @ ensures array[anotherValue] == \old(array[anotherValue]) - 1;
- @*/
- public void decrementArrayEnd() {
- array[anotherValue]--;
- }
-
- /*@ requires array != null && array.length == 1 && anotherValue == 0;
- @ ensures array[anotherValue] == \old(array[anotherValue]) - 1;
- @*/
- public void decrementArrayBegin() {
- --array[anotherValue];
- }
-
- /*@
- @ ensures value == \old(value) + anotherValue;
- @*/
- public void add() {
- value += anotherValue;
- }
-
- /*@
- @ ensures value == \old(value) - anotherValue;
- @*/
- public void sub() {
- value -= anotherValue;
- }
-
- /*@
- @ ensures value == \old(value) * anotherValue;
- @*/
- public void mul() {
- value *= anotherValue;
- }
-
- /*@ requires anotherValue != 0;
- @ ensures value == \old(value) / anotherValue;
- @*/
- public void div() {
- value /= anotherValue;
- }
-
- /*@ requires anotherValue != 0;
- @ ensures value == \old(value) % anotherValue;
- @*/
- public void mod() {
- value %= anotherValue;
- }
-
- /*@
- @ ensures value == anotherValue;
- @*/
- public void assign() {
- value = anotherValue;
- }
-
- /*@ requires myClass != null && myClass.child != null;
- @ ensures myClass.child.childValue == myClass.child.anotherChildValue;
- @*/
- public void nestedValue() {
- myClass.child.childValue = myClass.child.anotherChildValue;
- }
-
- /*@ requires myClass != null && myClass.child != null;
- @ ensures myClass.child.childValue == myClass.child.anotherChildValue + myClass.child.thirdChildValue;
- @*/
- public void nestedValueAdd() {
- myClass.child.childValue = myClass.child.anotherChildValue + myClass.child.thirdChildValue;
- }
-
- /*@ requires myClass != null && myClass.child != null && myClass.child.childArray != null;
- @ requires myClass.child.childArray.length == 2;
- @ ensures myClass.child.childArray[0] == myClass.child.childArray[1];
- @*/
- public void nestedArray() {
- myClass.child.childArray[0] = myClass.child.childArray[1];
- }
-
- public static class MyClass {
- public MyChildClass child;
- }
-
- public static class MyChildClass {
- public int childValue;
-
- public int anotherChildValue;
-
- public int thirdChildValue;
-
- public int[] childArray;
- }
-
- /*@
- @ ensures next == this;
- @*/
- public void assignmentWithSelf() {
- this.next = this;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java
deleted file mode 100644
index aa9e1693388..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/ConditionalsAndOther/ConditionalsAndOther.java
+++ /dev/null
@@ -1,289 +0,0 @@
-
-public class ConditionalsAndOther {
- private int x;
-
- private int y;
-
- private boolean b;
-
- private Exception e;
-
- private ExceptionWrapper ew;
-
- /*@
- @ ensures \result == (x == 0);
- @*/
- public boolean switchInt() {
- switch (x) {
- case 0 : return true;
- default : return false;
- }
- }
-
- /*@
- @ ensures \result == b;
- @*/
- public boolean ifBoolean() {
- if (b) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /*@
- @ ensures \result == x < y;
- @*/
- public boolean ifLess() {
- if (x < y) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /*@
- @ ensures \result == x <= y;
- @*/
- public boolean ifLessEquals() {
- if (x <= y) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /*@
- @ ensures \result == x <= y;
- @*/
- public boolean ifEquals() {
- if (x == y) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /*@
- @ ensures \result == (x != y);
- @*/
- public boolean ifNotEquals() {
- if (x != y) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /*@
- @ ensures \result == x >= y;
- @*/
- public boolean ifGreaterEquals() {
- if (x >= y) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /*@
- @ ensures \result == x > y;
- @*/
- public boolean ifGreater() {
- if (x > y) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /*@
- @ ensures \result == b;
- @*/
- public boolean questionBoolean() {
- return b ? true : false;
- }
-
- /*@
- @ ensures \result == x < y;
- @*/
- public boolean questionLess() {
- return x < y ? true : false;
- }
-
- /*@
- @ ensures \result == x <= y;
- @*/
- public boolean questionLessEquals() {
- return x <= y ? true : false;
- }
-
- /*@
- @ ensures \result == x <= y;
- @*/
- public boolean questionEquals() {
- return x == y ? true : false;
- }
-
- /*@
- @ ensures \result == (x != y);
- @*/
- public boolean questionNotEquals() {
- return x != y ? true : false;
- }
-
- /*@
- @ ensures \result == x >= y;
- @*/
- public boolean questionGreaterEquals() {
- return x >= y ? true : false;
- }
-
- /*@
- @ ensures \result == x > y;
- @*/
- public boolean questionGreater() {
- return x > y ? true : false;
- }
-
- /*@
- @ ensures true;
- @*/
- public boolean ifIncrementsAndDecrements() {
- if (x++ * y++ > --y * x--) {
- return true;
- }
- else {
- return false;
- }
- }
-
- /*@
- @ ensures true;
- @*/
- public boolean questionIncrementsAndDecrements() {
- return x++ * y++ > --y * x-- ? true : false;
- }
-
- /*@
- @ ensures \result == b;
- @*/
- public boolean returnBoolean() {
- return b;
- }
-
- /*@
- @ ensures \result == (x == y);
- @*/
- public boolean returnEquals() {
- return x == y;
- }
-
- /*@
- @ ensures \result == true;
- @*/
- public boolean returnComplex() {
- return x == y && b || !b && x != y;
- }
-
- /*@
- @ ensures true;
- @*/
- public void methodCall() {
- doNothing(x, b);
- }
-
- /*@
- @ ensures true;
- @*/
- public void methodCallAssignment() {
- doNothing(x++ + y + 1, b);
- }
-
- /*@
- @ ensures true;
- @*/
- public void methodCallCondtional() {
- doNothing(x, b || y == 0);
- }
-
- public void doNothing(int localInt, boolean localBoolean) {
- }
-
- /*@ exceptional_behavior
- @ requires e != null;
- @ signals (Exception e) \not_specified;
- @*/
- public void throwsException() throws Exception {
- throw e;
- }
-
- /*@ exceptional_behavior
- @ requires ew != null && ew.wrapped != null;
- @ signals (Exception e) \not_specified;
- @*/
- public void throwsNestedException() throws Exception {
- throw ew.wrapped;
- }
-
- public static class ExceptionWrapper {
- public Exception wrapped;
- }
-
- /*@ requires b == false;
- @ ensures true;
- @*/
- public void whileBoolean() {
- while (b) {
- }
- }
-
- /*@ requires x != y;
- @ ensures true;
- @*/
- public void whileEquals() {
- while (x == y) {
- }
- }
-
- /*@ requires b == false;
- @ ensures true;
- @*/
- public void doWhileBoolean() {
- do {
- }
- while (b);
- }
-
- /*@ requires x != y;
- @ ensures true;
- @*/
- public void doWhileEquals() {
- do {
- }
- while (x == y);
- }
-
- /*@ requires b == false;
- @ ensures true;
- @*/
- public void forBoolean() {
- for(int i = 0; b; i++) {
- }
- }
-
- /*@ requires x != y;
- @ ensures true;
- @*/
- public void forEquals() {
- for (int i = 0; x == y; i++) {
- }
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/InnerAndAnonymousTypeTest/InnerAndAnonymousTypeTest.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/InnerAndAnonymousTypeTest/InnerAndAnonymousTypeTest.java
deleted file mode 100644
index 8d80afb4512..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/InnerAndAnonymousTypeTest/InnerAndAnonymousTypeTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-
-public class InnerAndAnonymousTypeTest {
- /*@
- @ ensures true;
- @*/
- public int main() {
- IGetter getter = new IGetter() {
- public int getValue() {
- return 0;
- }
- };
- return getter.getValue() +
- InnerInterface.VALUE +
- InnerInterface.InnerInterfaceInterface.VALUE +
- InnerInterface.InnerInterfaceClass.VALUE +
- InnerClass.VALUE +
- InnerClass.InnerClassInterface.VALUE +
- InnerClass.InnerClassClass.VALUE +
- InnerEnum.VALUE +
- InnerEnum.InnerEnumClass.VALUE +
- InnerEnum.InnerEnumInterface.VALUE;
-// InnerEnum.InnerEnumEnum.VALUE;
- }
-
- public interface IGetter {
- public int getValue();
- }
-
- public class InnerInterface {
- public static final int VALUE = 1;
-
- public class InnerInterfaceInterface {
- public static final int VALUE = 2;
- }
-
- public class InnerInterfaceClass {
- public static final int VALUE = 3;
- }
- }
-
- public class InnerClass {
- public static final int VALUE = 4;
-
- public class InnerClassInterface {
- public static final int VALUE = 5;
- }
-
- public class InnerClassClass {
- public static final int VALUE = 6;
- }
- }
-
- public enum InnerEnum {
- INNER_LITERAL;
-
- public static final int VALUE = 7;
-
- public class InnerEnumInterface {
- public static final int VALUE = 8;
- }
-
- public class InnerEnumClass {
- public static final int VALUE = 9;
- }
-
-// public enum InnerEnumEnum {
-// INNER_ENUM_LITERAL;
-//
-// public static final int VALUE = 10;
-// }
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/InnerAndAnonymousTypeTest/model/InnerAndAnonymousTypeTest.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/InnerAndAnonymousTypeTest/model/InnerAndAnonymousTypeTest.java
deleted file mode 100644
index deecda1d167..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/InnerAndAnonymousTypeTest/model/InnerAndAnonymousTypeTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package model;
-
-public class InnerAndAnonymousTypeTest {
- /*@
- @ ensures true;
- @*/
- public int main() {
- IGetter getter = new IGetter() {
- public int getValue() {
- return 0;
- }
- };
- return getter.getValue() +
- InnerInterface.VALUE +
- InnerInterface.InnerInterfaceInterface.VALUE +
- InnerInterface.InnerInterfaceClass.VALUE +
- InnerClass.VALUE +
- InnerClass.InnerClassInterface.VALUE +
- InnerClass.InnerClassClass.VALUE +
- InnerEnum.VALUE +
- InnerEnum.InnerEnumClass.VALUE +
- InnerEnum.InnerEnumInterface.VALUE;
-// InnerEnum.InnerEnumEnum.VALUE;
- }
-
- public interface IGetter {
- public int getValue();
- }
-
- public class InnerInterface {
- public static final int VALUE = 1;
-
- public class InnerInterfaceInterface {
- public static final int VALUE = 2;
- }
-
- public class InnerInterfaceClass {
- public static final int VALUE = 3;
- }
- }
-
- public class InnerClass {
- public static final int VALUE = 4;
-
- public class InnerClassInterface {
- public static final int VALUE = 5;
- }
-
- public class InnerClassClass {
- public static final int VALUE = 6;
- }
- }
-
- public enum InnerEnum {
- INNER_LITERAL;
-
- public static final int VALUE = 7;
-
- public class InnerEnumInterface {
- public static final int VALUE = 8;
- }
-
- public class InnerEnumClass {
- public static final int VALUE = 9;
- }
-
-// public enum InnerEnumEnum {
-// INNER_ENUM_LITERAL;
-//
-// public static final int VALUE = 10;
-// }
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContract/Child.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContract/Child.java
deleted file mode 100644
index d6221f34710..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContract/Child.java
+++ /dev/null
@@ -1,7 +0,0 @@
-
-public class Child {
- /*@
- @ public invariant x >= 0 && x <= 10;
- @*/
- public int x;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContract/InvariantInOperationContract.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContract/InvariantInOperationContract.java
deleted file mode 100644
index cd75c14b469..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContract/InvariantInOperationContract.java
+++ /dev/null
@@ -1,13 +0,0 @@
-
-public class InvariantInOperationContract {
- private Child child;
-
- private int y;
-
- /*@ requires \invariant_for(child);
- @ ensures y == newValue;
- @*/
- public void main(int newValue) {
- y = newValue;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContractOfArgument/Child.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContractOfArgument/Child.java
deleted file mode 100644
index d6221f34710..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContractOfArgument/Child.java
+++ /dev/null
@@ -1,7 +0,0 @@
-
-public class Child {
- /*@
- @ public invariant x >= 0 && x <= 10;
- @*/
- public int x;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContractOfArgument/InvariantInOperationContractOfArgument.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContractOfArgument/InvariantInOperationContractOfArgument.java
deleted file mode 100644
index 9c494f12826..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/InvariantInOperationContractOfArgument/InvariantInOperationContractOfArgument.java
+++ /dev/null
@@ -1,13 +0,0 @@
-
-public class InvariantInOperationContractOfArgument {
- private static int y;
-
- /*@ requires \invariant_for(child);
- @ ensures child.x == newValue;
- @ ensures \invariant_for(child);
- @ assignable \everything;
- @*/
- public static void main(Child child, int newValue) {
- child.x = newValue;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/MethodBodyExpand/MethodBodyExpand.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/MethodBodyExpand/MethodBodyExpand.java
deleted file mode 100644
index 98d2bb25404..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/MethodBodyExpand/MethodBodyExpand.java
+++ /dev/null
@@ -1,15 +0,0 @@
-
-public class MethodBodyExpand {
- /*@
- @ ensures \result == 84;
- @*/
- public int main() {
- int first = magic42();
- int second = magic42();
- return first + second;
- }
-
- public int magic42() {
- return 42;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/ModelFieldTest/ModelFieldTest.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/ModelFieldTest/ModelFieldTest.java
deleted file mode 100644
index 5ab6fd37772..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/ModelFieldTest/ModelFieldTest.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package test;
-
-public class ModelFieldTest {
- //@ model int f;
- //@ accessible f : this.x;
- //@ represents f = 2 * x;
-
- private int x = 4;
-
- /*@
- @ ensures \result == f;
- @*/
- public int doubleX() {
- return x + x;
- }
-}
\ No newline at end of file
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/Child.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/Child.java
deleted file mode 100644
index d6221f34710..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/Child.java
+++ /dev/null
@@ -1,7 +0,0 @@
-
-public class Child {
- /*@
- @ public invariant x >= 0 && x <= 10;
- @*/
- public int x;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/ChildContainer.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/ChildContainer.java
deleted file mode 100644
index dcf6cb2ecfc..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/ChildContainer.java
+++ /dev/null
@@ -1,4 +0,0 @@
-
-public class ChildContainer {
- public Child child;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/NestedInvariantInOperationContract.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/NestedInvariantInOperationContract.java
deleted file mode 100644
index 8e377b81f61..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/NestedInvariantInOperationContract/NestedInvariantInOperationContract.java
+++ /dev/null
@@ -1,13 +0,0 @@
-
-public class NestedInvariantInOperationContract {
- private ChildContainer cc;
-
- private int y;
-
- /*@ requires cc != null && \invariant_for(cc.child);
- @ ensures y == newValue;
- @*/
- public void main(int newValue) {
- y = newValue;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/UseOperationContractTest/UseOperationContractTest.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/UseOperationContractTest/UseOperationContractTest.java
deleted file mode 100644
index ef99c1a6d0e..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/UseOperationContractTest/UseOperationContractTest.java
+++ /dev/null
@@ -1,17 +0,0 @@
-
-public class UseOperationContractTest {
- /*@ normal_behavior
- @ ensures \result == 84;
- @*/
- public int main() {
- int magic = magic42();
- return magic * 2;
- }
-
- /*@ normal_behavior
- @ ensures \result == 42;
- @*/
- public int magic42() {
- throw new RuntimeException();
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldReadAccess2/ActiveUseStaticFieldReadAccess2.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldReadAccess2/ActiveUseStaticFieldReadAccess2.java
deleted file mode 100644
index 96c08c140c7..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldReadAccess2/ActiveUseStaticFieldReadAccess2.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package activeUseStaticFieldReadAccess2;
-
-public class ActiveUseStaticFieldReadAccess2 {
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller(Class callme) {
- int i;
- i = callme.i + 2;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldReadAccess2/Class.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldReadAccess2/Class.java
deleted file mode 100644
index def0730bdf4..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldReadAccess2/Class.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package activeUseStaticFieldReadAccess2;
-
-public class Class {
- public static boolean a;
-
- public static int i;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldWriteAccess2/ActiveUseStaticFieldWriteAccess2.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldWriteAccess2/ActiveUseStaticFieldWriteAccess2.java
deleted file mode 100644
index 23b1f64b6a4..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldWriteAccess2/ActiveUseStaticFieldWriteAccess2.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package activeUseStaticFieldWriteAccess2;
-
-public class ActiveUseStaticFieldWriteAccess2 {
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller(Class callme) {
- callme.a = false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldWriteAccess2/Class.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldWriteAccess2/Class.java
deleted file mode 100644
index b6f52ef8e8c..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/activeUseStaticFieldWriteAccess2/Class.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package activeUseStaticFieldWriteAccess2;
-
-public class Class {
- public static boolean a;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment/Assignment.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment/Assignment.java
deleted file mode 100644
index 080c29959ee..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment/Assignment.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package assignment;
-
-public class Assignment {
- private boolean b;
-
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller() {
- boolean a;
- a = b;
- Enum c = Enum.b;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment/Enum.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment/Enum.java
deleted file mode 100644
index fd844638f3c..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment/Enum.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package assignment;
-
-public enum Enum {
- b;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_array2/Assignment_array2.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_array2/Assignment_array2.java
deleted file mode 100644
index 8a65b7604cd..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_array2/Assignment_array2.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package assignment_array2;
-
-public class Assignment_array2 {
- int val;
- int[] as;
- int index;
-
- /*@ requires as != null;
- @ requires index == 0;
- @ requires as.length == 1;
- @ ensures val == as[index];
- @*/
- public void caller() {
- val = as[index];
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_attribute/Assignment_read_attribute.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_attribute/Assignment_read_attribute.java
deleted file mode 100644
index 52048c2ca51..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_attribute/Assignment_read_attribute.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package assignment_read_attribute;
-
-public class Assignment_read_attribute {
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller(Class callme) {
- callme.a = callme.b + callme.b;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_attribute/Class.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_attribute/Class.java
deleted file mode 100644
index 98fff2bb9d0..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_attribute/Class.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package assignment_read_attribute;
-
-public class Class {
- public int a;
- public int b;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_length/Assignment_read_length.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_length/Assignment_read_length.java
deleted file mode 100644
index b7e4e5d5190..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_read_length/Assignment_read_length.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package assignment_read_length;
-
-public class Assignment_read_length {
- boolean[] b;
-
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller() {
- int a;
- a = b.length;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_to_primitive_array_component/Assignment_to_primitive_array_component.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_to_primitive_array_component/Assignment_to_primitive_array_component.java
deleted file mode 100644
index cc50ae90a2b..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_to_primitive_array_component/Assignment_to_primitive_array_component.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package assignment_to_primitive_array_component;
-
-public class Assignment_to_primitive_array_component {
- int index;
- boolean[] bs;
-
- /*@ requires bs.length == 1;
- @ requires index == 0;
- @ ensures true;
- @*/
- public void caller() {
- bs[index] = false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_to_reference_array_component/Assignment_to_reference_array_component.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_to_reference_array_component/Assignment_to_reference_array_component.java
deleted file mode 100644
index df766a678c0..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_to_reference_array_component/Assignment_to_reference_array_component.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package assignment_to_reference_array_component;
-
-public class Assignment_to_reference_array_component {
- String[] bs;
-
- /*@ requires \typeof(bs) == \type(String[]) && bs.length == 1;
- @ ensures true;
- @*/
- public void caller(String o) {
- bs[0] = o;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_attribute/Assignment_write_attribute.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_attribute/Assignment_write_attribute.java
deleted file mode 100644
index fed33fb0c79..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_attribute/Assignment_write_attribute.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package assignment_write_attribute;
-
-public class Assignment_write_attribute {
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller(Class callme){
- callme.a = false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_attribute/Class.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_attribute/Class.java
deleted file mode 100644
index c5de77a0eb0..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_attribute/Class.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package assignment_write_attribute;
-
-public class Class {
- public boolean a;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_static_attribute/Assignment_write_static_attribute.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_static_attribute/Assignment_write_static_attribute.java
deleted file mode 100644
index aaab3d0e1f8..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/assignment_write_static_attribute/Assignment_write_static_attribute.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package assignment_write_static_attribute;
-
-public class Assignment_write_static_attribute {
- static boolean b;
-
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller() {
- b = false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/A.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/A.java
deleted file mode 100644
index 005d81c18f3..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/A.java
+++ /dev/null
@@ -1,9 +0,0 @@
-
-public class A {
- public int magic() {
- return 42;
- }
- public static int staticMagic() {
- return 11;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/B.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/B.java
deleted file mode 100644
index 7c5079fee39..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/B.java
+++ /dev/null
@@ -1,6 +0,0 @@
-
-public class B extends A {
- public static int staticMagic() {
- return -4711;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/ConstructorTest.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/ConstructorTest.java
deleted file mode 100644
index f4c7659d0ee..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/constructorTest/ConstructorTest.java
+++ /dev/null
@@ -1,11 +0,0 @@
-
-public class ConstructorTest {
- private int value;
-
- /*@
- @ ensures value == 42 - 4711;
- @*/
- public ConstructorTest(int x, B a) {
- value = a.magic() + a.staticMagic();
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_access4/Class.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_access4/Class.java
deleted file mode 100644
index 127893de739..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_access4/Class.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package eval_order_access4;
-
-public class Class {
- public int a;
- public int b;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_access4/Eval_order_access4.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_access4/Eval_order_access4.java
deleted file mode 100644
index 5942b6842ea..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_access4/Eval_order_access4.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package eval_order_access4;
-
-public class Eval_order_access4 {
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller(Class callme) {
- callme.a = 2 + 2;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_array_access5/Class.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_array_access5/Class.java
deleted file mode 100644
index 14365ed39b7..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_array_access5/Class.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package eval_order_array_access5;
-
-public class Class {
- public int a;
- public int b;
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_array_access5/Eval_order_array_access5.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_array_access5/Eval_order_array_access5.java
deleted file mode 100644
index 00fc8ef6bcf..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/eval_order_array_access5/Eval_order_array_access5.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package eval_order_array_access5;
-
-public class Eval_order_array_access5 {
- /*@requires as.length == 2;
- @ensures true;
- @*/
- public void caller(Class callme, int[] as) {
- callme.a = as[0 + 1];
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCall/Class.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCall/Class.java
deleted file mode 100644
index 94fcd8a3cfe..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCall/Class.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package methodCall;
-
-public class Class {
- public boolean a() {
- return false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCall/MethodCall.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCall/MethodCall.java
deleted file mode 100644
index 854f51bee63..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCall/MethodCall.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package methodCall;
-
-public class MethodCall {
- /*@requires true;
- @ensures true;
- @*/
- public void caller(Class callme){
- callme.a();
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallSuper/MethodCallSuper.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallSuper/MethodCallSuper.java
deleted file mode 100644
index 4f1ebbdad85..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallSuper/MethodCallSuper.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package methodCallSuper;
-
-public class MethodCallSuper extends Super{
- /*@requires true;
- @ensures true;
- @*/
- public void caller(){
- super.a();
- }
-}
\ No newline at end of file
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallSuper/Super.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallSuper/Super.java
deleted file mode 100644
index 7388ac5c9f7..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallSuper/Super.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package methodCallSuper;
-
-public class Super {
- public boolean a() {
- return false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignment/Class.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignment/Class.java
deleted file mode 100644
index f39f30a9ac3..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignment/Class.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package methodCallWithAssignment;
-
-public class Class {
- public boolean a() {
- return false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignment/MethodCall.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignment/MethodCall.java
deleted file mode 100644
index 13397eace8c..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignment/MethodCall.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package methodCallWithAssignment;
-
-public class MethodCall {
- /*@requires true;
- @ensures true;
- @*/
- public void caller(Class callme){
- boolean fu = callme.a();
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentSuper/MethodCallWithAssignmentSuper.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentSuper/MethodCallWithAssignmentSuper.java
deleted file mode 100644
index 0c7ae148f61..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentSuper/MethodCallWithAssignmentSuper.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package methodCallWithAssignmentSuper;
-
-public class MethodCallWithAssignmentSuper extends Super{
- /*@requires true;
- @ensures true;
- @*/
- public void caller(){
- boolean fu = super.a();
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentSuper/Super.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentSuper/Super.java
deleted file mode 100644
index ea6c5f346ab..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentSuper/Super.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package methodCallWithAssignmentSuper;
-
-public class Super {
- public boolean a() {
- return false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentWithinClass/MethodCallWithAssignmentWithinClass.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentWithinClass/MethodCallWithAssignmentWithinClass.java
deleted file mode 100644
index 68f235bf71a..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithAssignmentWithinClass/MethodCallWithAssignmentWithinClass.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package methodCallWithAssignmentWithinClass;
-
-public class MethodCallWithAssignmentWithinClass {
-
- /*@requires true;
- @ensures true;
- @*/
- public void caller(){
- boolean nottrue = callme();
- }
-
-
- public boolean callme(){
- return false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithinClass/MethodCallWithinClass.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithinClass/MethodCallWithinClass.java
deleted file mode 100644
index 11eeea9398e..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/methodCallWithinClass/MethodCallWithinClass.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package methodCallWithinClass;
-
-public class MethodCallWithinClass {
-
- /*@requires true;
- @ensures true;
- @*/
- public void caller(){
- callme();
- }
-
-
- public void callme(){
-
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCall/StaticClass.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCall/StaticClass.java
deleted file mode 100644
index c7a930bf036..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCall/StaticClass.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package staticMethodCall;
-
-public class StaticClass {
- public static void callMe(){
-
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCall/StaticMethodCall.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCall/StaticMethodCall.java
deleted file mode 100644
index 39cd2df3c19..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCall/StaticMethodCall.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package staticMethodCall;
-
-public class StaticMethodCall {
- /*@requires true;
- @ensures true;
- @*/
- public void caller(StaticClass staticClass){
- staticClass.callMe();
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticViaTypereference/StaticClass.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticViaTypereference/StaticClass.java
deleted file mode 100644
index 16c6970f293..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticViaTypereference/StaticClass.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package staticMethodCallStaticViaTypereference;
-
-public class StaticClass {
- public static void callMe(){
-
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticViaTypereference/StaticMethodCallStaticViaTypereference.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticViaTypereference/StaticMethodCallStaticViaTypereference.java
deleted file mode 100644
index 377c4ff5c38..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticViaTypereference/StaticMethodCallStaticViaTypereference.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package staticMethodCallStaticViaTypereference;
-
-public class StaticMethodCallStaticViaTypereference {
- /*@requires true;
- @ensures true;
- @*/
- public void caller(){
- StaticClass.callMe();
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticWithAssignmentViaTypereference/StaticClass.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticWithAssignmentViaTypereference/StaticClass.java
deleted file mode 100644
index 7e5f1ced76b..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticWithAssignmentViaTypereference/StaticClass.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package staticMethodCallStaticWithAssignmentViaTypereference;
-
-public class StaticClass {
- public static boolean callMe(){
- return false;
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticWithAssignmentViaTypereference/StaticMethodCallStaticWithAssignmentViaTypereference.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticWithAssignmentViaTypereference/StaticMethodCallStaticWithAssignmentViaTypereference.java
deleted file mode 100644
index e1c081d3db0..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/staticMethodCallStaticWithAssignmentViaTypereference/StaticMethodCallStaticWithAssignmentViaTypereference.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package staticMethodCallStaticWithAssignmentViaTypereference;
-
-public class StaticMethodCallStaticWithAssignmentViaTypereference {
- /*@requires true;
- @ensures true;
- @*/
- public void caller(){
- boolean nottrue = StaticClass.callMe();
- }
-}
diff --git a/key.core.proof_references/src/test/resources/testcase/proofReferences/variableDeclarationAssign/VariableDeclarationAssign.java b/key.core.proof_references/src/test/resources/testcase/proofReferences/variableDeclarationAssign/VariableDeclarationAssign.java
deleted file mode 100644
index c2dba9fceea..00000000000
--- a/key.core.proof_references/src/test/resources/testcase/proofReferences/variableDeclarationAssign/VariableDeclarationAssign.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package variableDeclarationAssign;
-
-public class VariableDeclarationAssign {
- boolean a;
-
- /*@ requires true;
- @ ensures true;
- @*/
- public void caller() {
- boolean fu = a;
- }
-}
diff --git a/key.core.symbolic_execution.example/build.gradle b/key.core.symbolic_execution.example/build.gradle
deleted file mode 100644
index 8e005f7c6fd..00000000000
--- a/key.core.symbolic_execution.example/build.gradle
+++ /dev/null
@@ -1,6 +0,0 @@
-description = "Example project to use KeY's APIs"
-
-dependencies {
- implementation project(":key.core")
- implementation project(":key.core.symbolic_execution")
-}
diff --git a/key.core.symbolic_execution.example/example/Number.java b/key.core.symbolic_execution.example/example/Number.java
deleted file mode 100644
index f5a5c574763..00000000000
--- a/key.core.symbolic_execution.example/example/Number.java
+++ /dev/null
@@ -1,12 +0,0 @@
-public class Number {
- private int content;
-
- public boolean equals(Number n) {
- if (content == n.content) {
- return true;
- }
- else {
- return false;
- }
- }
-}
\ No newline at end of file
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
deleted file mode 100644
index 6d34b614fdd..00000000000
--- a/key.core.symbolic_execution.example/src/main/java/org/key_project/example/Main.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* 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.example;
-
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import de.uka.ilkd.key.control.DefaultUserInterfaceControl;
-import de.uka.ilkd.key.control.KeYEnvironment;
-import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
-import de.uka.ilkd.key.logic.op.IProgramMethod;
-import de.uka.ilkd.key.proof.Proof;
-import de.uka.ilkd.key.proof.init.AbstractOperationPO;
-import de.uka.ilkd.key.settings.ChoiceSettings;
-import de.uka.ilkd.key.settings.ProofSettings;
-import de.uka.ilkd.key.symbolic_execution.ExecutionNodePreorderIterator;
-import de.uka.ilkd.key.symbolic_execution.SymbolicExecutionTreeBuilder;
-import de.uka.ilkd.key.symbolic_execution.model.IExecutionNode;
-import de.uka.ilkd.key.symbolic_execution.po.ProgramMethodPO;
-import de.uka.ilkd.key.symbolic_execution.profile.SymbolicExecutionJavaProfile;
-import de.uka.ilkd.key.symbolic_execution.strategy.CompoundStopCondition;
-import de.uka.ilkd.key.symbolic_execution.strategy.ExecutedSymbolicExecutionTreeNodesStopCondition;
-import de.uka.ilkd.key.symbolic_execution.strategy.SymbolicExecutionBreakpointStopCondition;
-import de.uka.ilkd.key.symbolic_execution.strategy.breakpoint.ExceptionBreakpoint;
-import de.uka.ilkd.key.symbolic_execution.strategy.breakpoint.IBreakpoint;
-import de.uka.ilkd.key.symbolic_execution.util.SymbolicExecutionEnvironment;
-import de.uka.ilkd.key.symbolic_execution.util.SymbolicExecutionUtil;
-import de.uka.ilkd.key.util.MiscTools;
-
-import org.key_project.util.collection.ImmutableList;
-import org.key_project.util.java.StringUtil;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Example application which symbolically executes {@code example/Number#equals(Number)}
- *
- * @author Martin Hentschel
- */
-public class Main {
- private static final Logger LOGGER = LoggerFactory.getLogger(Main.class);
-
- /**
- * The program entry point.
- *
- * @param args
- * The start parameters.
- */
- public static void main(String[] args) {
- Path location = Paths.get("example"); // Path to the source code folder/file or to a *.proof
- // file
- List classPaths = null; // Optionally: Additional specifications for API classes
- Path bootClassPath = null; // Optionally: Different default specifications for Java API
- List includes = null; // Optionally: Additional includes to consider
- try {
- // Ensure that Taclets are parsed
- if (!ProofSettings.isChoiceSettingInitialised()) {
- KeYEnvironment> env =
- KeYEnvironment.load(location, classPaths, bootClassPath, includes);
- env.dispose();
- }
- // Set Taclet options
- ChoiceSettings choiceSettings = ProofSettings.DEFAULT_SETTINGS.getChoiceSettings();
- Map oldSettings = choiceSettings.getDefaultChoices();
- Map newSettings = new HashMap<>(oldSettings);
- newSettings.putAll(MiscTools.getDefaultTacletOptions());
- newSettings.put("methodExpansion", "methodExpansion:noRestriction");
- choiceSettings.setDefaultChoices(newSettings);
- // Load source code
- KeYEnvironment env =
- KeYEnvironment.load(SymbolicExecutionJavaProfile.getDefaultInstance(), location,
- classPaths, bootClassPath, includes, true); // env.getLoadedProof() returns
- // performed proof if a *.proof file
- // is loaded
- try {
- // Find method to symbolically execute
- KeYJavaType classType = env.getJavaInfo().getKeYJavaType("Number");
- IProgramMethod pm = env.getJavaInfo().getProgramMethod(classType, "equals",
- 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
- true, // Needs to be true for symbolic execution!
- true); // Needs to be true for symbolic execution!
- // po = new ProgramMethodSubsetPO(...); // PO for symbolic execution of some
- // statements within a method (Java semantics)
- // po = new FunctionalOperationContractPO(...) // PO for verification (JML
- // semantics)
- Proof proof = env.createProof(po);
- // Create symbolic execution tree builder
- SymbolicExecutionTreeBuilder builder =
- new SymbolicExecutionTreeBuilder(proof, false, // Merge branch conditions
- false, // Use Unicode?
- true, // Use Pretty Printing?
- true, // Variables are collected from updates instead of the visible type
- // structure
- true); // Simplify conditions
- builder.analyse();
- // Optionally, create an SymbolicExecutionEnvironment which provides access to all
- // relevant objects for symbolic execution
- SymbolicExecutionEnvironment symbolicEnv =
- new SymbolicExecutionEnvironment<>(env, builder);
- printSymbolicExecutionTree("Initial State", builder);
- // Configure strategy for full exploration
- SymbolicExecutionUtil.initializeStrategy(builder);
- SymbolicExecutionEnvironment.configureProofForSymbolicExecution(proof, 100, false,
- false, false, false, false);
- // Optionally, add a more advanced stop conditions like breakpoints
- CompoundStopCondition stopCondition = new CompoundStopCondition();
- // Stop after 100 nodes have been explored on each branch.
- stopCondition.addChildren(new ExecutedSymbolicExecutionTreeNodesStopCondition(100));
- // stopCondition.addChildren(new StepOverSymbolicExecutionTreeNodesStopCondition());
- // // Perform only a step over
- // stopCondition.addChildren(new
- // StepReturnSymbolicExecutionTreeNodesStopCondition()); // Perform only a step
- // return
- IBreakpoint breakpoint = new ExceptionBreakpoint(proof,
- "java.lang.NullPointerException", true, true, true, true, 1);
- // Stop at specified breakpoints
- stopCondition.addChildren(new SymbolicExecutionBreakpointStopCondition(breakpoint));
- proof.getSettings().getStrategySettings()
- .setCustomApplyStrategyStopCondition(stopCondition);
- // Perform strategy which will stop at breakpoint
- symbolicEnv.getProofControl().startAndWaitForAutoMode(proof);
- builder.analyse();
- printSymbolicExecutionTree("Stopped at Breakpoint", builder);
- // Perform strategy again to complete symbolic execution tree
- symbolicEnv.getProofControl().startAndWaitForAutoMode(proof);
- builder.analyse();
- printSymbolicExecutionTree("Stopped at Breakpoint", builder);
- } finally {
- env.dispose(); // Ensure always that all instances of KeYEnvironment are disposed
- }
- } catch (Exception e) {
- LOGGER.debug("Exception at '{}':", location, e);
- }
- }
-
- /**
- * Prints the symbolic execution tree as flat list into the console.
- *
- * @param title
- * The title.
- * @param builder
- * The {@link SymbolicExecutionTreeBuilder} providing the root of the symbolic
- * execution tree.
- */
- protected static void printSymbolicExecutionTree(String title,
- SymbolicExecutionTreeBuilder builder) {
- System.out.println(title);
- System.out.println(StringUtil.repeat("=", title.length()));
- ExecutionNodePreorderIterator iterator =
- new ExecutionNodePreorderIterator(builder.getStartNode());
- while (iterator.hasNext()) {
- IExecutionNode> next = iterator.next();
- System.out.println(next);
- // next.getVariables(); // Access the symbolic state.
- // next.getCallStack(); // Access the call stack.
- // next.getPathCondition(); // Access the path condition.
- // next.getFormatedPathCondition(); // Access the formated path condition.
- // next... // Additional methods provide access to additional information.
- // Check also the specific sub types of IExecutionNode like IExecutionTermination.
- }
- System.out.println();
- }
-}
diff --git a/key.core.symbolic_execution/build.gradle b/key.core.symbolic_execution/build.gradle
deleted file mode 100644
index 42d92ad7f6c..00000000000
--- a/key.core.symbolic_execution/build.gradle
+++ /dev/null
@@ -1,11 +0,0 @@
-description = "API for using KeY as a symbolic execution engine for Java programs"
-
-dependencies {
- implementation project(":key.core")
-}
-
-test {
- maxHeapSize = "4g"
- systemProperty "UPDATE_TEST_ORACLE", System.getProperty("UPDATE_TEST_ORACLE")
- systemProperty "ORACLE_DIRECTORY", System.getProperty("ORACLE_DIRECTORY")
-}
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/proof/TermProgramVariableCollectorKeepUpdatesForBreakpointconditions.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/proof/TermProgramVariableCollectorKeepUpdatesForBreakpointconditions.java
deleted file mode 100644
index 743ce07fdd5..00000000000
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/proof/TermProgramVariableCollectorKeepUpdatesForBreakpointconditions.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* 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 de.uka.ilkd.key.proof;
-
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.logic.op.LocationVariable;
-import de.uka.ilkd.key.strategy.IBreakpointStopCondition;
-import de.uka.ilkd.key.symbolic_execution.strategy.breakpoint.AbstractConditionalBreakpoint;
-import de.uka.ilkd.key.symbolic_execution.strategy.breakpoint.IBreakpoint;
-
-import org.key_project.logic.Term;
-import org.key_project.logic.op.Modality;
-
-public class TermProgramVariableCollectorKeepUpdatesForBreakpointconditions
- extends TermProgramVariableCollector {
- private final IBreakpointStopCondition breakpointStopCondition;
-
- public TermProgramVariableCollectorKeepUpdatesForBreakpointconditions(Services services,
- IBreakpointStopCondition breakpointStopCondition) {
- super(services);
- this.breakpointStopCondition = breakpointStopCondition;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void visit(Term t) {
- super.visit(t);
- if (t.op() instanceof Modality) {
- addVarsToKeep();
- }
- }
-
- private void addVarsToKeep() {
- for (IBreakpoint breakpoint : breakpointStopCondition.getBreakpoints()) {
- if (breakpoint instanceof AbstractConditionalBreakpoint conditionalBreakpoint) {
- if (conditionalBreakpoint.getToKeep() != null) {
- for (LocationVariable sub : conditionalBreakpoint.getToKeep()) {
- if (sub instanceof LocationVariable) {
- super.result().add(sub);
- }
- }
- }
- }
- }
- }
-}
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
deleted file mode 100644
index 88408fc4a4f..00000000000
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/BlockContractValidityTermLabelUpdate.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* 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 de.uka.ilkd.key.rule.label;
-
-import java.util.Set;
-
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.logic.JTerm;
-import de.uka.ilkd.key.logic.label.BlockContractValidityTermLabel;
-import de.uka.ilkd.key.logic.label.TermLabel;
-import de.uka.ilkd.key.logic.label.TermLabelState;
-import de.uka.ilkd.key.rule.BlockContractInternalRule;
-import de.uka.ilkd.key.rule.LoopContractInternalRule;
-import de.uka.ilkd.key.symbolic_execution.util.SymbolicExecutionUtil;
-
-import org.key_project.logic.Name;
-import org.key_project.prover.rules.Rule;
-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.java.CollectionUtil;
-
-/**
- * Makes sure that {@link BlockContractValidityTermLabel} is introduced when a
- * {@link BlockContractInternalRule} is applied.
- *
- * @author Martin Hentschel
- */
-public class BlockContractValidityTermLabelUpdate implements TermLabelUpdate {
- /**
- * {@inheritDoc}
- */
- @Override
- public ImmutableList getSupportedRuleNames() {
- return ImmutableList.singleton(BlockContractInternalRule.INSTANCE.name());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void updateLabels(TermLabelState state, Services services,
- PosInOccurrence applicationPosInOccurrence, JTerm applicationTerm, JTerm modalityTerm,
- Rule rule, RuleApp ruleApp, Object hint, JTerm tacletTerm, JTerm newTerm,
- Set labels) {
- if ((rule instanceof BlockContractInternalRule || rule instanceof LoopContractInternalRule)
- && ((BlockContractInternalRule.BlockContractHint) hint)
- .getExceptionalVariable() != null
- && SymbolicExecutionUtil.hasSymbolicExecutionLabel(modalityTerm)) {
- if (CollectionUtil.search(labels,
- element -> element instanceof BlockContractValidityTermLabel) == null) {
- labels.add(new BlockContractValidityTermLabel(
- ((BlockContractInternalRule.BlockContractHint) hint).getExceptionalVariable()));
- }
- }
- }
-}
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/FormulaTermLabelMerger.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/FormulaTermLabelMerger.java
deleted file mode 100644
index edabc1a3c90..00000000000
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/FormulaTermLabelMerger.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* 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 de.uka.ilkd.key.rule.label;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import de.uka.ilkd.key.logic.JTerm;
-import de.uka.ilkd.key.logic.label.FormulaTermLabel;
-import de.uka.ilkd.key.logic.label.TermLabel;
-
-import org.key_project.prover.sequent.SequentFormula;
-
-/**
- * The {@link TermLabelMerger} used to merge {@link FormulaTermLabel}s.
- *
- * @author Martin Hentschel
- */
-public class FormulaTermLabelMerger implements TermLabelMerger {
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean mergeLabels(SequentFormula existingSF,
- JTerm existingTerm,
- TermLabel existingLabel, SequentFormula rejectedSF, JTerm rejectedTerm,
- TermLabel rejectedLabel, List mergedLabels) {
- if (existingLabel != null) {
- FormulaTermLabel fExisting = (FormulaTermLabel) existingLabel;
- FormulaTermLabel fRejected = (FormulaTermLabel) rejectedLabel;
- // Compute new label
- List newBeforeIds = new ArrayList<>(Arrays.asList(fExisting.getBeforeIds()));
- newBeforeIds.add(fRejected.getId());
- newBeforeIds.addAll(Arrays.asList(fRejected.getBeforeIds()));
- FormulaTermLabel newLabel =
- new FormulaTermLabel(fExisting.getMajorId(), fExisting.getMinorId(), newBeforeIds);
- // Remove existing label
- mergedLabels.remove(existingLabel);
- // Add new label
- mergedLabels.add(newLabel);
- } else {
- mergedLabels.add(rejectedLabel);
- }
- return true;
- }
-}
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/FormulaTermLabelRefactoring.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/FormulaTermLabelRefactoring.java
deleted file mode 100644
index c9607d88c29..00000000000
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/rule/label/FormulaTermLabelRefactoring.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/* 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 de.uka.ilkd.key.rule.label;
-
-import java.util.*;
-
-import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.logic.*;
-import de.uka.ilkd.key.logic.label.FormulaTermLabel;
-import de.uka.ilkd.key.logic.label.LabelCollection;
-import de.uka.ilkd.key.logic.label.TermLabel;
-import de.uka.ilkd.key.logic.label.TermLabelState;
-import de.uka.ilkd.key.proof.Goal;
-import de.uka.ilkd.key.proof.Proof;
-import de.uka.ilkd.key.rule.SyntacticalReplaceVisitor;
-import de.uka.ilkd.key.rule.merge.CloseAfterMerge;
-import de.uka.ilkd.key.symbolic_execution.TruthValueTracingUtil;
-
-import org.key_project.logic.Name;
-import org.key_project.prover.rules.Rule;
-import org.key_project.prover.sequent.PosInOccurrence;
-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.java.CollectionUtil;
-
-/**
- * The {@link TermLabelRefactoring} used to label predicates with a {@link FormulaTermLabel} on
- * applied loop invariants or operation contracts.
- *
- * @author Martin Hentschel
- */
-public class FormulaTermLabelRefactoring implements TermLabelRefactoring {
- /**
- * Key prefix used in {@link TermLabelState} to store that the innermost label was already
- * refactored on a given {@link Goal}.
- */
- private static final String INNER_MOST_PARENT_REFACTORED_PREFIX =
- "innerMostParentRefactoredAtGoal_";
-
- /**
- * Key used in {@link TermLabelState} by the {@link StayOnOperatorTermLabelPolicy} to indicate
- * that a refactoring below an update ({@link RefactoringScope#APPLICATION_BELOW_UPDATES}) is
- * required, which will be performed by
- * {@link #refactorBelowUpdates(PosInOccurrence, JTerm, LabelCollection)}.
- *
- * This is for instance required for the following rules:
- *
- *
{@code concrete_and_1}
- *
{@code concrete_and_2}
- *
{@code concrete_and_3}
- *
{@code concrete_and_4}
- *
{@code concrete_eq_1}
- *
{@code concrete_eq_2}
- *
{@code concrete_eq_3}
- *
{@code concrete_eq_4}
- *
{@code concrete_impl_1}
- *
{@code concrete_impl_2}
- *
{@code concrete_impl_3}
- *
{@code concrete_impl_4}
- *
{@code concrete_not_1}
- *
{@code concrete_not_2}
- *
{@code concrete_or_1}
- *
{@code concrete_or_2}
- *
{@code concrete_or_3}
- *
{@code concrete_or_4}
- *
- */
- private static final String UPDATE_REFACTORING_REQUIRED = "updateRefactoringRequired";
-
- /**
- * Key used in {@link TermLabelState} by the {@link FormulaTermLabelUpdate} to indicate that a
- * refactoring of parents
- * ({@link RefactoringScope#APPLICATION_CHILDREN_AND_GRANDCHILDREN_SUBTREE_AND_PARENTS}) is
- * required, which will be performed by
- * {@link #refactorInCaseOfNewIdRequired(TermLabelState, Goal, JTerm, Services, LabelCollection)}.
- *
- * This is for instance required if a rule is applied on a sub term without a
- * {@link FormulaTermLabel} of a parent which has a {@link FormulaTermLabel}. Example rules are:
- *
- *
{@code ifthenelse_split}
- *
{@code arrayLengthNotNegative}
- *
- */
- private static final String PARENT_REFACTORING_REQUIRED = "parentRefactoringRequired";
-
- /**
- * Key used in {@link TermLabelState} by the {@link FormulaTermLabelUpdate} to indicate that a
- * refactoring of specified {@link SequentFormula}s ({@link RefactoringScope#SEQUENT}) is
- * required, which will be performed by
- * {@link #refactorSequentFormulas(TermLabelState, Services, JTerm, LabelCollection)}.
- *
- * This is for instance required if the assumes clause of a rule has a {@link FormulaTermLabel}
- * but the application does not have it. Example rules are:
- *
- *
{@code inEqSimp_contradInEq1}
- *
- */
- private static final String SEQUENT_FORMULA_REFACTORING_REQUIRED =
- "sequentFormulaRefactoringRequired";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ImmutableList getSupportedRuleNames() {
- return null; // Support all rules
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public RefactoringScope defineRefactoringScope(TermLabelState state, Services services,
- PosInOccurrence applicationPosInOccurrence,
- JTerm applicationTerm, Rule rule, Goal goal,
- Object hint, JTerm tacletTerm) {
- if (shouldRefactorSpecificationApplication(rule, goal, hint)) {
- return RefactoringScope.APPLICATION_CHILDREN_AND_GRANDCHILDREN_SUBTREE;
- } else if (isParentRefactoringRequired(state)) {
- return RefactoringScope.APPLICATION_CHILDREN_AND_GRANDCHILDREN_SUBTREE_AND_PARENTS;
- } else if (isUpdateRefactoringRequired(state)) {
- return RefactoringScope.APPLICATION_BELOW_UPDATES;
- } else if (containsSequentFormulasToRefactor(state)) {
- return RefactoringScope.SEQUENT;
- } else if (SyntacticalReplaceVisitor.SUBSTITUTION_WITH_LABELS_HINT.equals(hint)) {
- return RefactoringScope.APPLICATION_BELOW_UPDATES;
- } else {
- return RefactoringScope.NONE;
- }
- }
-
- /**
- * Checks if the given hint requires a refactoring.
- *
- * @param rule The applied {@link Rule}.
- * @param goal The {@link Goal}.
- * @param hint The hint to check.
- * @return {@code true} perform refactoring, {@code false} do not perform refactoring.
- */
- private boolean shouldRefactorSpecificationApplication(Rule rule, Goal goal, Object hint) {
- return TermLabelRefactoring.shouldRefactorOnBuiltInRule(rule, goal, hint);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void refactorLabels(TermLabelState state, Services services,
- PosInOccurrence applicationPosInOccurrence,
- JTerm applicationTerm, Rule rule, Goal goal,
- Object hint, JTerm tacletTerm, JTerm term, LabelCollection labels) {
- if (shouldRefactorSpecificationApplication(rule, goal, hint)) {
- refactorSpecificationApplication(term, services, labels, hint);
- } else if (isParentRefactoringRequired(state)) {
- refactorInCaseOfNewIdRequired(state, goal, term, services, labels);
- } else if (isUpdateRefactoringRequired(state)) {
- refactorBelowUpdates(applicationPosInOccurrence, term, labels);
- } else if (containsSequentFormulasToRefactor(state)) {
- refactorSequentFormulas(state, services, term, labels);
- } else if (SyntacticalReplaceVisitor.SUBSTITUTION_WITH_LABELS_HINT.equals(hint)) {
- refactorSubstitution(term, tacletTerm, labels);
- }
- }
-
- /**
- * Refactors a specification application.
- *
- * @param term The {@link JTerm} which is now refactored.
- * @param services The {@link Services} used by the {@link Proof} on which a {@link Rule} is
- * applied right now.
- * @param labels The new labels the {@link JTerm} will have after the refactoring.
- */
- private void refactorSpecificationApplication(JTerm term, Services services,
- LabelCollection labels, Object hint) {
- if (TruthValueTracingUtil.isPredicate(term)
- || (CloseAfterMerge.FINAL_WEAKENING_TERM_HINT.equals(hint)
- && TruthValueTracingUtil.isLogicOperator(term))) {
- TermLabel existingLabel = term.getLabel(FormulaTermLabel.NAME);
- if (existingLabel == null) {
- int labelID =
- services.getCounter(FormulaTermLabel.PROOF_COUNTER_NAME).getCountPlusPlus();
- int labelSubID = FormulaTermLabel.newLabelSubID(services, labelID);
- labels.add(new FormulaTermLabel(labelID, labelSubID));
- }
- }
- }
-
- /**
- * Refactors in case that the innermost label needs a new ID.
- *
- * @param state The {@link TermLabelState} of the current rule application.
- * @param goal The optional {@link Goal} on which the {@link JTerm} to create will be used.
- * @param term The {@link JTerm} which is now refactored.
- * @param services The {@link Services} used by the {@link Proof} on which a {@link Rule} is
- * applied right now.
- * @param labels The new labels the {@link JTerm} will have after the refactoring.
- */
- private void refactorInCaseOfNewIdRequired(TermLabelState state, Goal goal, JTerm term,
- Services services, LabelCollection labels) {
- if (goal != null && !isInnerMostParentRefactored(state, goal)) {
- TermLabel existingLabel = term.getLabel(FormulaTermLabel.NAME);
- if (existingLabel instanceof FormulaTermLabel pLabel) {
- int labelID = pLabel.getMajorId();
- int labelSubID = FormulaTermLabel.newLabelSubID(services, labelID);
- labels.remove(existingLabel);
- labels.add(new FormulaTermLabel(labelID, labelSubID,
- Collections.singletonList(pLabel.getId())));
- setInnerMostParentRefactored(state, goal, true);
- }
- }
- }
-
- /**
- * Refactors the {@link JTerm} below its update.
- *
- * @param applicationPosInOccurrence The {@link PosInOccurrence} in the previous {@link Sequent}
- * which defines the {@link JTerm} that is rewritten.
- * @param term The {@link JTerm} which is now refactored.
- * @param labels The new labels the {@link JTerm} will have after the refactoring.
- */
- private void refactorBelowUpdates(
- PosInOccurrence applicationPosInOccurrence, JTerm term,
- LabelCollection labels) {
- JTerm applicationTerm =
- applicationPosInOccurrence != null ? (JTerm) applicationPosInOccurrence.subTerm()
- : null;
- FormulaTermLabel applicationLabel = applicationTerm != null
- ? (FormulaTermLabel) applicationTerm.getLabel(FormulaTermLabel.NAME)
- : null;
- if (applicationLabel != null) {
- FormulaTermLabel termLabel = (FormulaTermLabel) term.getLabel(FormulaTermLabel.NAME);
- if (termLabel == null) {
- labels.add(applicationLabel);
- } else {
- labels.remove(termLabel);
- Set beforeIds =
- new LinkedHashSet<>(Arrays.asList(termLabel.getBeforeIds()));
- beforeIds.add(applicationLabel.getId());
- labels.add(new FormulaTermLabel(termLabel.getMajorId(), termLabel.getMinorId(),
- beforeIds));
- }
- }
- }
-
- /**
- * Refactors the specified {@link SequentFormula}s.
- *
- * @param state The {@link TermLabelState} of the current rule application.
- * @param services The {@link Services} used by the {@link Proof} on which a {@link Rule} is
- * applied right now.
- * @param term The {@link JTerm} which is now refactored.
- * @param labels The new labels the {@link JTerm} will have after the refactoring.
- */
- private void refactorSequentFormulas(TermLabelState state, Services services, final JTerm term,
- LabelCollection labels) {
- Set sequentFormulas =
- getSequentFormulasToRefactor(state);
- if (CollectionUtil.search(sequentFormulas, element -> element.formula() == term) != null) {
- FormulaTermLabel termLabel = (FormulaTermLabel) term.getLabel(FormulaTermLabel.NAME);
- if (termLabel != null) {
- labels.remove(termLabel);
- Set beforeIds = new LinkedHashSet<>();
- beforeIds.add(termLabel.getId());
- int labelSubID = FormulaTermLabel.newLabelSubID(services, termLabel);
- labels.add(new FormulaTermLabel(termLabel.getMajorId(), labelSubID, beforeIds));
- }
- }
- }
-
- /**
- * Refactors the given {@link JTerm} after a substitution.
- *
- * @param term The {@link JTerm} to refactor.
- * @param tacletTerm The taclet {@link JTerm} which provides additional labels to be merged with
- * the other {@link JTerm}.
- * @param labels The new labels the {@link JTerm} will have after the refactoring.
- */
- private void refactorSubstitution(JTerm term, JTerm tacletTerm, LabelCollection labels) {
- FormulaTermLabel tacletLabel =
- (FormulaTermLabel) tacletTerm.getLabel(FormulaTermLabel.NAME);
- if (tacletLabel != null) {
- FormulaTermLabel existingLabel =
- (FormulaTermLabel) term.getLabel(FormulaTermLabel.NAME);
- if (existingLabel == null) {
- labels.add(tacletLabel);
- } else {
- List beforeIds =
- new ArrayList<>(Arrays.asList(existingLabel.getBeforeIds()));
- boolean changed = false;
- if (!beforeIds.contains(tacletLabel.getId())) {
- changed = true;
- beforeIds.add(tacletLabel.getId());
- }
- for (String id : tacletLabel.getBeforeIds()) {
- if (!beforeIds.contains(id)) {
- changed = true;
- beforeIds.add(id);
- }
- }
- if (changed) {
- labels.remove(existingLabel);
- labels.add(new FormulaTermLabel(existingLabel.getMajorId(),
- existingLabel.getMinorId(), beforeIds));
- }
- }
- }
- }
-
- /**
- * Checks if the innermost parent was already refactored on the given {@link Goal}.
- *
- * @param state The {@link TermLabelState} to read from.
- * @param goal The {@link Goal} to check.
- * @return {@code true} already refactored, {@code false} not refactored yet.
- */
- public static boolean isInnerMostParentRefactored(TermLabelState state, Goal goal) {
- Map