From b41c2b79ffd3b3b068fea3f3a8e3ba22d4d9b6b3 Mon Sep 17 00:00:00 2001
From: Drodt
Date: Wed, 27 Mar 2024 08:53:50 +0100
Subject: [PATCH 01/15] API design
---
.../org/key_project/logic/SyntaxElement.java | 3 +++
.../logic/SyntaxElementCursor.java | 23 +++++++++++++++++++
.../logic/SyntaxElementCursorNode.java | 4 ++++
3 files changed, 30 insertions(+)
create mode 100644 key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
create mode 100644 key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursorNode.java
diff --git a/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java b/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
index 244f53bbe4b..347ec52dd1b 100644
--- a/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
+++ b/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
@@ -8,4 +8,7 @@
* AST nodes.
*/
public interface SyntaxElement {
+ SyntaxElement getChild(int child);
+
+ int getChildCount();
}
diff --git a/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
new file mode 100644
index 00000000000..ee6ad7d01ee
--- /dev/null
+++ b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
@@ -0,0 +1,23 @@
+package org.key_project.logic;
+
+public class SyntaxElementCursor {
+ public SyntaxElement getCurrentNode() {
+ return null;
+ }
+
+ public SyntaxElementCursorNode getCurrentTreeCursorNode() {
+ return null;
+ }
+
+ public boolean gotoFirstChild() {
+ return false;
+ }
+
+ public boolean gotoNextSibling() {
+ return false;
+ }
+
+ public boolean gotoParent() {
+ return false;
+ }
+}
diff --git a/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursorNode.java b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursorNode.java
new file mode 100644
index 00000000000..f6494c6efd3
--- /dev/null
+++ b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursorNode.java
@@ -0,0 +1,4 @@
+package org.key_project.logic;
+
+public record SyntaxElementCursorNode(String type, String name) {
+}
From 179d71e8b65e1f357cbb6774fd71703a203b1da7 Mon Sep 17 00:00:00 2001
From: Drodt
Date: Thu, 2 May 2024 10:18:09 +0200
Subject: [PATCH 02/15] Increase Java version
---
gradle/wrapper/gradle-wrapper.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e411586a54a..48c0a02ca41 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
From c168bb765ca93673a929ceff446abd852882c990 Mon Sep 17 00:00:00 2001
From: Drodt
Date: Thu, 2 May 2024 11:08:10 +0200
Subject: [PATCH 03/15] Implement cursor
---
.../org/key_project/logic/SyntaxElement.java | 12 +++++-
.../logic/SyntaxElementCursor.java | 37 +++++++++++++++----
.../logic/SyntaxElementCursorNode.java | 4 --
3 files changed, 41 insertions(+), 12 deletions(-)
delete mode 100644 key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursorNode.java
diff --git a/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java b/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
index 347ec52dd1b..a9e2a7e0bd0 100644
--- a/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
+++ b/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
@@ -8,7 +8,17 @@
* AST nodes.
*/
public interface SyntaxElement {
- SyntaxElement getChild(int child);
+ /**
+ * Get the {@code n}-th child of this syntax element.
+ * @param n index of the child.
+ * @return the {@code n}-th child of this syntax element.
+ * @throws IndexOutOfBoundsException if there is no {@code n}-th child.
+ */
+ SyntaxElement getChild(int n);
+ /**
+ *
+ * @return the number of children of this syntax element.
+ */
int getChildCount();
}
diff --git a/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
index ee6ad7d01ee..fdc3e6013cd 100644
--- a/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
+++ b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
@@ -1,23 +1,46 @@
package org.key_project.logic;
+import java.util.ArrayDeque;
+import java.util.Deque;
+
public class SyntaxElementCursor {
- public SyntaxElement getCurrentNode() {
- return null;
+ record ParentAndPosition(SyntaxElement parent, int index) {}
+
+ private final Deque path = new ArrayDeque<>();
+
+ private SyntaxElement node;
+
+ SyntaxElementCursor(SyntaxElement node) {
+ this.node = node;
}
- public SyntaxElementCursorNode getCurrentTreeCursorNode() {
- return null;
+ public SyntaxElement getCurrentNode() {
+ return node;
}
public boolean gotoFirstChild() {
- return false;
+ if (node.getChildCount() <= 0) return false;
+ path.push(new ParentAndPosition(node, 0));
+ node = node.getChild(0);
+ return true;
}
public boolean gotoNextSibling() {
- return false;
+ if (path.isEmpty()) return false;
+ var pnp = path.pop();
+ SyntaxElement parent = pnp.parent;
+ int index =pnp.index+1;
+ if (index > parent.getChildCount()) {
+ return false;
+ }
+ path.push(new ParentAndPosition(parent, index));
+ node = parent.getChild(index);
+ return true;
}
public boolean gotoParent() {
- return false;
+ if (path.isEmpty()) return false;
+ node = path.pop().parent;
+ return true;
}
}
diff --git a/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursorNode.java b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursorNode.java
deleted file mode 100644
index f6494c6efd3..00000000000
--- a/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursorNode.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.key_project.logic;
-
-public record SyntaxElementCursorNode(String type, String name) {
-}
From fe83fc86efccd3fa093e919886202e0718c1fa53 Mon Sep 17 00:00:00 2001
From: Drodt
Date: Wed, 8 May 2024 13:47:00 +0200
Subject: [PATCH 04/15] Start implementation of traversal
---
.../MethodCallProofReferencesAnalyst.java | 2 +-
.../ProgramVariableReferencesAnalyst.java | 2 +-
.../slicing/AbstractBackwardSlicer.java | 2 +-
.../slicing/AbstractSlicer.java | 2 +-
.../breakpoint/ExceptionBreakpoint.java | 2 +-
.../strategy/breakpoint/FieldWatchpoint.java | 4 +-
.../SymbolicExecutionExceptionBreakpoint.java | 2 +-
.../util/SymbolicExecutionUtil.java | 4 +-
.../CcatchBreakLabelParameterDeclaration.java | 2 +-
.../java/CcatchBreakParameterDeclaration.java | 2 +-
...atchBreakWildcardParameterDeclaration.java | 2 +-
...atchContinueLabelParameterDeclaration.java | 2 +-
.../CcatchContinueParameterDeclaration.java | 2 +-
...hContinueWildcardParameterDeclaration.java | 2 +-
.../CcatchReturnParameterDeclaration.java | 2 +-
.../CcatchReturnValParameterDeclaration.java | 2 +-
.../java/de/uka/ilkd/key/java/Comment.java | 12 ++++++
.../de/uka/ilkd/key/java/CompilationUnit.java | 6 +--
.../ilkd/key/java/ContextStatementBlock.java | 4 +-
.../java/de/uka/ilkd/key/java/Import.java | 2 +-
.../java/JavaNonTerminalProgramElement.java | 16 +++++---
.../key/java/NonTerminalProgramElement.java | 2 +-
.../ilkd/key/java/PackageSpecification.java | 2 +-
.../java/de/uka/ilkd/key/java/SourceData.java | 2 +-
.../de/uka/ilkd/key/java/SourceElement.java | 4 +-
.../de/uka/ilkd/key/java/StatementBlock.java | 2 +-
.../ilkd/key/java/TerminalProgramElement.java | 11 +++++
.../java/declaration/ArrayDeclaration.java | 2 +-
.../java/declaration/ClassDeclaration.java | 2 +-
.../java/declaration/ClassInitializer.java | 2 +-
.../java/declaration/FieldDeclaration.java | 2 +-
.../declaration/InheritanceSpecification.java | 2 +-
.../declaration/InterfaceDeclaration.java | 2 +-
.../declaration/LocalVariableDeclaration.java | 2 +-
.../java/declaration/MethodDeclaration.java | 4 +-
.../declaration/ParameterDeclaration.java | 2 +-
.../declaration/SuperArrayDeclaration.java | 2 +-
.../uka/ilkd/key/java/declaration/Throws.java | 2 +-
.../java/declaration/VariableDeclaration.java | 2 +-
.../declaration/VariableSpecification.java | 6 +--
.../modifier/AnnotationUseSpecification.java | 2 +-
.../key/java/expression/ArrayInitializer.java | 2 +-
.../ilkd/key/java/expression/Operator.java | 2 +-
.../expression/operator/ExactInstanceof.java | 2 +-
.../java/expression/operator/Instanceof.java | 6 +--
.../key/java/expression/operator/New.java | 4 +-
.../java/expression/operator/NewArray.java | 2 +-
.../java/expression/operator/TypeCast.java | 2 +-
.../java/reference/ArrayLengthReference.java | 2 +-
.../key/java/reference/ArrayReference.java | 2 +-
.../key/java/reference/ExecutionContext.java | 2 +-
.../key/java/reference/FieldReference.java | 2 +-
.../java/reference/MetaClassReference.java | 2 +-
.../key/java/reference/MethodReference.java | 2 +-
.../key/java/reference/PackageReference.java | 2 +-
.../reference/SchematicFieldReference.java | 2 +-
.../SpecialConstructorReference.java | 2 +-
.../key/java/reference/SuperReference.java | 2 +-
.../key/java/reference/ThisReference.java | 2 +-
.../key/java/reference/TypeReferenceImp.java | 2 +-
.../key/java/reference/VariableReference.java | 2 +-
.../uka/ilkd/key/java/statement/Assert.java | 2 +-
.../de/uka/ilkd/key/java/statement/Case.java | 2 +-
.../de/uka/ilkd/key/java/statement/Catch.java | 2 +-
.../key/java/statement/CatchAllStatement.java | 2 +-
.../uka/ilkd/key/java/statement/Ccatch.java | 2 +-
.../uka/ilkd/key/java/statement/Default.java | 2 +-
.../de/uka/ilkd/key/java/statement/Else.java | 2 +-
.../de/uka/ilkd/key/java/statement/Exec.java | 4 +-
.../statement/ExpressionJumpStatement.java | 2 +-
.../uka/ilkd/key/java/statement/Finally.java | 2 +-
.../ilkd/key/java/statement/ForUpdates.java | 2 +-
.../de/uka/ilkd/key/java/statement/Guard.java | 2 +-
.../de/uka/ilkd/key/java/statement/If.java | 4 +-
.../ilkd/key/java/statement/JmlAssert.java | 2 +-
.../java/statement/LabelJumpStatement.java | 2 +-
.../key/java/statement/LabeledStatement.java | 2 +-
.../uka/ilkd/key/java/statement/LoopInit.java | 2 +-
.../key/java/statement/LoopScopeBlock.java | 4 +-
.../key/java/statement/LoopStatement.java | 2 +-
.../java/statement/MergePointStatement.java | 2 +-
.../java/statement/MethodBodyStatement.java | 2 +-
.../ilkd/key/java/statement/MethodFrame.java | 8 ++--
.../ilkd/key/java/statement/SetStatement.java | 2 +-
.../uka/ilkd/key/java/statement/Switch.java | 2 +-
.../key/java/statement/SynchronizedBlock.java | 4 +-
.../de/uka/ilkd/key/java/statement/Then.java | 2 +-
.../java/statement/TransactionStatement.java | 2 +-
.../de/uka/ilkd/key/java/statement/Try.java | 4 +-
.../key/java/visitor/CreatingASTVisitor.java | 6 +--
.../key/java/visitor/FreeLabelFinder.java | 2 +-
.../InnerBreakAndContinueReplacer.java | 4 +-
.../ilkd/key/java/visitor/JavaASTWalker.java | 2 +-
.../OuterBreakContinueAndReturnReplacer.java | 4 +-
.../key/java/visitor/ProgramContextAdder.java | 6 +--
.../java/de/uka/ilkd/key/logic/JavaBlock.java | 17 +++++++-
.../ilkd/key/logic/op/ElementaryUpdate.java | 13 ++++++
.../de/uka/ilkd/key/logic/op/Equality.java | 11 +++++
.../uka/ilkd/key/logic/op/IfExThenElse.java | 11 +++++
.../de/uka/ilkd/key/logic/op/IfThenElse.java | 11 +++++
.../de/uka/ilkd/key/logic/op/Junctor.java | 11 +++++
.../uka/ilkd/key/logic/op/LogicVariable.java | 11 +++++
.../ilkd/key/logic/op/ObserverFunction.java | 18 ++++++--
.../uka/ilkd/key/logic/op/ProgramMethod.java | 2 +-
.../de/uka/ilkd/key/logic/op/ProgramSV.java | 2 +-
.../ilkd/key/logic/op/ProgramVariable.java | 12 ++++++
.../de/uka/ilkd/key/logic/op/Qualifier.java | 41 +++++++++++++++++++
.../de/uka/ilkd/key/logic/op/Quantifier.java | 11 +++++
.../key/logic/op/SortDependingFunction.java | 21 ++++++++--
.../de/uka/ilkd/key/logic/op/SubstOp.java | 12 ++++++
.../de/uka/ilkd/key/logic/op/TermLabelSV.java | 2 +-
.../ilkd/key/logic/op/UpdateApplication.java | 11 +++++
.../uka/ilkd/key/logic/op/UpdateJunctor.java | 11 +++++
.../ilkd/key/logic/sort/ProgramSVSort.java | 2 +-
.../de/uka/ilkd/key/pp/PrettyPrinter.java | 2 +-
.../de/uka/ilkd/key/proof/TacletIndex.java | 2 +-
.../key/rule/LoopInvariantBuiltInRuleApp.java | 2 +-
.../rule/conditions/StoreStmtInCondition.java | 2 +-
.../metaconstruct/ProgramTransformer.java | 2 +-
.../WhileLoopTransformation.java | 4 +-
.../key/speclang/jml/JMLSpecExtractor.java | 2 +-
.../key/java/TestContextStatementBlock.java | 2 +-
.../org/key_project/logic/SyntaxElement.java | 3 +-
.../logic/SyntaxElementCursor.java | 16 +++++---
.../main/java/org/key_project/logic/Term.java | 19 +++++++++
.../org/key_project/logic/op/Function.java | 11 +++++
.../org/key_project/logic/op/Modality.java | 28 ++++++++++++-
.../org/key_project/logic/op/Operator.java | 3 +-
.../ilkd/key/gui/sourceview/SourceView.java | 2 +-
129 files changed, 455 insertions(+), 150 deletions(-)
create mode 100644 key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
diff --git a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java
index 706723eaeab..07bee533ecd 100644
--- a/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java
+++ b/key.core.proof_references/src/main/java/de/uka/ilkd/key/proof_references/analyst/MethodCallProofReferencesAnalyst.java
@@ -59,7 +59,7 @@ public LinkedHashSet> computeReferences(Node node, Services s
ExecutionContext context = extractContext(node, services);
LinkedHashSet> result =
new LinkedHashSet<>();
- for (int i = 0; i < assignment.getChildCount(); i++) {
+ for (int i = 0; i < assignment.getSyntaxChildCount(); i++) {
ProgramElement child = assignment.getChildAt(i);
if (child instanceof MethodReference) {
IProofReference reference =
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
index e37beeaa55b..49c35b4f0e6 100644
--- 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
@@ -82,7 +82,7 @@ protected void listReferences(Node node, ProgramElement pe, ProgramVariable arra
ProofReferenceUtil.merge(toFill, reference);
}
} else if (includeExpressionContainer && pe instanceof ExpressionContainer ec) {
- for (int i = ec.getChildCount() - 1; i >= 0; i--) {
+ for (int i = ec.getSyntaxChildCount() - 1; i >= 0; i--) {
ProgramElement element = ec.getChildAt(i);
listReferences(node, element, arrayLength, toFill, includeExpressionContainer);
}
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractBackwardSlicer.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractBackwardSlicer.java
index bfb10ac3e91..20a6a6e091e 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractBackwardSlicer.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractBackwardSlicer.java
@@ -120,7 +120,7 @@ protected void updateRelevantLocations(final ProgramElement read,
Location normalizedElement = normalizeAlias(services, relevantElement, info);
relevantLocations.add(normalizedElement);
} else if (read instanceof NonTerminalProgramElement ntpe) {
- for (int i = 0; i < ntpe.getChildCount(); i++) {
+ for (int i = 0; i < ntpe.getSyntaxChildCount(); i++) {
updateRelevantLocations(ntpe.getChildAt(i), relevantLocations, info, services);
}
}
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java
index 56ead50dddb..3aab95bc564 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java
@@ -792,7 +792,7 @@ protected Location computeRepresentativeAlias(Location location,
*/
protected ReferencePrefix toReferencePrefix(SourceElement sourceElement) {
if (sourceElement instanceof PassiveExpression) {
- if (((PassiveExpression) sourceElement).getChildCount() != 1) {
+ if (((PassiveExpression) sourceElement).getSyntaxChildCount() != 1) {
throw new IllegalStateException(
"PassiveExpression '" + sourceElement + "' has not exactly one child.");
}
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/ExceptionBreakpoint.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/ExceptionBreakpoint.java
index bb81a7f3e64..74c23775aff 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/ExceptionBreakpoint.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/ExceptionBreakpoint.java
@@ -104,7 +104,7 @@ public boolean isBreakpointHit(SourceElement activeStatement, RuleApp ruleApp, P
Node node) {
Node SETParent = SymbolicExecutionUtil.findParentSetNode(node);
if (activeStatement instanceof Throw throwStatement && isEnabled()) {
- for (int i = 0; i < throwStatement.getChildCount(); i++) {
+ for (int i = 0; i < throwStatement.getSyntaxChildCount(); i++) {
SourceElement childElement = throwStatement.getChildAt(i);
if (childElement instanceof LocationVariable locVar) {
if (locVar.getKeYJavaType().getSort().toString().equals(exceptionName)
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/FieldWatchpoint.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/FieldWatchpoint.java
index d1082bca4c9..a3246cc6949 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/FieldWatchpoint.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/FieldWatchpoint.java
@@ -80,7 +80,7 @@ public boolean isBreakpointHit(SourceElement activeStatement, RuleApp ruleApp, P
private boolean checkChildrenOfSourceElement(SourceElement sourceElement) {
boolean found = false;
if (sourceElement instanceof Assignment assignment) {
- for (int i = 1; i < assignment.getChildCount(); i++) {
+ for (int i = 1; i < assignment.getSyntaxChildCount(); i++) {
SourceElement childElement = assignment.getChildAt(i);
if (childElement instanceof FieldReference field && ((FieldReference) childElement)
.getProgramVariable().name().toString().equals(fullFieldName)) {
@@ -93,7 +93,7 @@ private boolean checkChildrenOfSourceElement(SourceElement sourceElement) {
}
}
} else if (sourceElement instanceof NonTerminalProgramElement programElement) {
- for (int i = 0; i < programElement.getChildCount(); i++) {
+ for (int i = 0; i < programElement.getSyntaxChildCount(); i++) {
SourceElement childElement = programElement.getChildAt(i);
if (childElement instanceof FieldReference field && ((FieldReference) childElement)
.getProgramVariable().name().toString().equals(fullFieldName)) {
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/SymbolicExecutionExceptionBreakpoint.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/SymbolicExecutionExceptionBreakpoint.java
index 18787225830..995917eef20 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/SymbolicExecutionExceptionBreakpoint.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/breakpoint/SymbolicExecutionExceptionBreakpoint.java
@@ -93,7 +93,7 @@ public void updateState(int maxApplications, long timeout, Proof proof, long sta
SourceElement activeStatement = NodeInfo.computeActiveStatement(ruleApp);
Node SETParent = SymbolicExecutionUtil.findParentSetNode(node);
if (activeStatement instanceof Throw throwStatement && isEnabled()) {
- for (int i = 0; i < throwStatement.getChildCount(); i++) {
+ for (int i = 0; i < throwStatement.getSyntaxChildCount(); i++) {
SourceElement childElement = throwStatement.getChildAt(i);
if (childElement instanceof LocationVariable locVar) {
if (locVar.getKeYJavaType().getSort().toString().equals(exceptionName)
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java
index 785b03e3d80..fa13eb0fe87 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java
@@ -3951,10 +3951,10 @@ public static Pair computeSecondStatement(RuleApp ruleAp
}
// Compute second statement
StatementBlock block = null;
- while (!blocks.isEmpty() && (block == null || block.getChildCount() < 2)) {
+ while (!blocks.isEmpty() && (block == null || block.getSyntaxChildCount() < 2)) {
block = blocks.removeFirst();
}
- if (block != null && block.getChildCount() >= 2) {
+ if (block != null && block.getSyntaxChildCount() >= 2) {
return new Pair<>(methodFrameCount, block.getChildAt(1));
} else {
return new Pair<>(methodFrameCount, null);
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakLabelParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakLabelParameterDeclaration.java
index 792cf39949a..f072563e45c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakLabelParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakLabelParameterDeclaration.java
@@ -21,7 +21,7 @@ public CcatchBreakLabelParameterDeclaration(ExtList children) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (label != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakParameterDeclaration.java
index 8bd2af73e20..05bb1d123f7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakParameterDeclaration.java
@@ -18,7 +18,7 @@ public CcatchBreakParameterDeclaration(ExtList children) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakWildcardParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakWildcardParameterDeclaration.java
index 51938d23965..69b416cef06 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakWildcardParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchBreakWildcardParameterDeclaration.java
@@ -18,7 +18,7 @@ public CcatchBreakWildcardParameterDeclaration(ExtList children) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueLabelParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueLabelParameterDeclaration.java
index 1c5544866f6..a16bf704d2d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueLabelParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueLabelParameterDeclaration.java
@@ -21,7 +21,7 @@ public CcatchContinueLabelParameterDeclaration(ExtList children) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (label != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueParameterDeclaration.java
index e01e4739c8b..47f2a481df7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueParameterDeclaration.java
@@ -18,7 +18,7 @@ public CcatchContinueParameterDeclaration(ExtList children) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueWildcardParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueWildcardParameterDeclaration.java
index 984ab585973..bad98ad62f4 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueWildcardParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchContinueWildcardParameterDeclaration.java
@@ -19,7 +19,7 @@ public CcatchContinueWildcardParameterDeclaration(ExtList children) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchReturnParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchReturnParameterDeclaration.java
index 838ca7e192a..6345841c16a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchReturnParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchReturnParameterDeclaration.java
@@ -18,7 +18,7 @@ public CcatchReturnParameterDeclaration(ExtList children) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchReturnValParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchReturnValParameterDeclaration.java
index 88aaee039ce..78a8bdd40b0 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CcatchReturnValParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CcatchReturnValParameterDeclaration.java
@@ -43,7 +43,7 @@ public ImmutableArray getVariables() {
* @return an int giving the number of children of this node
*/
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return delegate != null ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/Comment.java b/key.core/src/main/java/de/uka/ilkd/key/java/Comment.java
index 0d556acb369..33b0d882c62 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/Comment.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/Comment.java
@@ -5,6 +5,8 @@
import de.uka.ilkd.key.java.visitor.Visitor;
+import org.key_project.logic.SyntaxElement;
+
/**
* Comment element of Java source code.
*/
@@ -71,4 +73,14 @@ public boolean equals(Object o) {
}
return (getText().equals(cmp.getText()));
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ return 0;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException("Comment has no children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/CompilationUnit.java b/key.core/src/main/java/de/uka/ilkd/key/java/CompilationUnit.java
index 1f4573e5f3f..c8540345aff 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/CompilationUnit.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/CompilationUnit.java
@@ -72,12 +72,12 @@ public CompilationUnit(ExtList children) {
public SourceElement getFirstElement() {
- return (getChildCount() > 0) ? getChildAt(0).getFirstElement() : this;
+ return (getSyntaxChildCount() > 0) ? getChildAt(0).getFirstElement() : this;
}
@Override
public SourceElement getFirstElementIncludingBlocks() {
- return (getChildCount() > 0) ? getChildAt(0).getFirstElementIncludingBlocks() : this;
+ return (getSyntaxChildCount() > 0) ? getChildAt(0).getFirstElementIncludingBlocks() : this;
}
public SourceElement getLastElement() {
@@ -101,7 +101,7 @@ public String getName() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (packageSpec != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/ContextStatementBlock.java b/key.core/src/main/java/de/uka/ilkd/key/java/ContextStatementBlock.java
index 408d81bbdb1..b8deb7f0d83 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/ContextStatementBlock.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/ContextStatementBlock.java
@@ -88,12 +88,12 @@ public IExecutionContext getExecutionContext() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int count = 0;
if (executionContext != null) {
count++;
}
- count += super.getChildCount();
+ count += super.getSyntaxChildCount();
return count;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/Import.java b/key.core/src/main/java/de/uka/ilkd/key/java/Import.java
index 500d659b836..43bd217e901 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/Import.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/Import.java
@@ -88,7 +88,7 @@ public boolean isMultiImport() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (reference != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/JavaNonTerminalProgramElement.java b/key.core/src/main/java/de/uka/ilkd/key/java/JavaNonTerminalProgramElement.java
index ded5c975478..af7148c5398 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/JavaNonTerminalProgramElement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/JavaNonTerminalProgramElement.java
@@ -5,6 +5,7 @@
import de.uka.ilkd.key.rule.MatchConditions;
+import org.key_project.logic.SyntaxElement;
import org.key_project.util.ExtList;
import org.key_project.util.collection.ImmutableArray;
@@ -69,11 +70,11 @@ public boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat) {
}
final JavaNonTerminalProgramElement jnte = (JavaNonTerminalProgramElement) se;
- if (jnte.getChildCount() != getChildCount()) {
+ if (jnte.getSyntaxChildCount() != getSyntaxChildCount()) {
return false;
}
- for (int i = 0, cc = getChildCount(); i < cc; i++) {
+ for (int i = 0, cc = getSyntaxChildCount(); i < cc; i++) {
if (!getChildAt(i).equalsModRenaming(jnte.getChildAt(i), nat)) {
return false;
}
@@ -89,7 +90,7 @@ public boolean equals(Object o) {
@Override
protected int computeHashCode() {
int localHash = 17 * super.computeHashCode();
- for (int i = 0, sz = getChildCount(); i < sz; i++) {
+ for (int i = 0, sz = getSyntaxChildCount(); i < sz; i++) {
final ProgramElement pe = getChildAt(i);
localHash = 17 * localHash + (pe == null ? 0 : pe.hashCode());
}
@@ -148,7 +149,7 @@ protected boolean compatibleBlockSize(int pos, int max) {
protected MatchConditions matchChildren(SourceData source, MatchConditions matchCond,
int offset) {
- for (int i = offset, sz = getChildCount(); i < sz; i++) {
+ for (int i = offset, sz = getSyntaxChildCount(); i < sz; i++) {
matchCond = getChildAt(i).match(source, matchCond);
if (matchCond == null) {
return null;
@@ -157,10 +158,15 @@ protected MatchConditions matchChildren(SourceData source, MatchConditions match
final NonTerminalProgramElement ntSrc = (NonTerminalProgramElement) source.getElement();
- if (!compatibleBlockSize(source.getChildPos(), ntSrc.getChildCount())) {
+ if (!compatibleBlockSize(source.getChildPos(), ntSrc.getSyntaxChildCount())) {
return null;
}
return matchCond;
}
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ return getChildAt(n);
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/NonTerminalProgramElement.java b/key.core/src/main/java/de/uka/ilkd/key/java/NonTerminalProgramElement.java
index ca20a719d4d..97368ebdad2 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/NonTerminalProgramElement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/NonTerminalProgramElement.java
@@ -14,7 +14,7 @@ public interface NonTerminalProgramElement extends ProgramElement {
*
* @return an int giving the number of children of this node
*/
- int getChildCount();
+ int getSyntaxChildCount();
/**
* Returns the child at the specified index in this node's "virtual" child array.
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/PackageSpecification.java b/key.core/src/main/java/de/uka/ilkd/key/java/PackageSpecification.java
index 1adeb3a75d5..82a9d5de4fb 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/PackageSpecification.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/PackageSpecification.java
@@ -46,7 +46,7 @@ public SourceElement getLastElement() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (reference != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/SourceData.java b/key.core/src/main/java/de/uka/ilkd/key/java/SourceData.java
index 0c34b1c15bf..e56178bde54 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/SourceData.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/SourceData.java
@@ -99,7 +99,7 @@ public ProgramElement getSource() {
final NonTerminalProgramElement ntpe = (NonTerminalProgramElement) element;
- if (childPos < ntpe.getChildCount()) {
+ if (childPos < ntpe.getSyntaxChildCount()) {
return ntpe.getChildAt(childPos);
} else {
return null;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/SourceElement.java b/key.core/src/main/java/de/uka/ilkd/key/java/SourceElement.java
index 046d51538cb..d9709324c9d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/SourceElement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/SourceElement.java
@@ -6,13 +6,15 @@
import de.uka.ilkd.key.java.visitor.Visitor;
import de.uka.ilkd.key.logic.op.SVSubstitute;
+import org.key_project.logic.SyntaxElement;
+
/**
* A source element is a piece of syntax. It does not necessarily have a semantics, at least none
* that is machinable, for instance a {@link recoder.java.Comment}. taken from RECODER and changed
* to achieve an immutable structure
*/
-public interface SourceElement extends SVSubstitute {
+public interface SourceElement extends SVSubstitute, SyntaxElement {
/**
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/StatementBlock.java b/key.core/src/main/java/de/uka/ilkd/key/java/StatementBlock.java
index 6d0c95695c8..0fe7c811033 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/StatementBlock.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/StatementBlock.java
@@ -121,7 +121,7 @@ public final boolean isEmpty() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return body.size();
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/TerminalProgramElement.java b/key.core/src/main/java/de/uka/ilkd/key/java/TerminalProgramElement.java
index 902e791ace6..b0cc3d15ece 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/TerminalProgramElement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/TerminalProgramElement.java
@@ -3,9 +3,20 @@
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.java;
+import org.key_project.logic.SyntaxElement;
+
/**
* Terminal program element. taken from COMPOST and changed to achieve an immutable structure
*/
public interface TerminalProgramElement extends ProgramElement {
+ @Override
+ default int getSyntaxChildCount() {
+ return 0;
+ }
+
+ @Override
+ default SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException("Program element " + this + " has no children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ArrayDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ArrayDeclaration.java
index c432502f14d..a689408a21a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ArrayDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ArrayDeclaration.java
@@ -71,7 +71,7 @@ public ArrayDeclaration(ExtList children, TypeReference baseType, KeYJavaType su
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (modArray != null) {
result += modArray.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ClassDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ClassDeclaration.java
index 269dc7f999a..a9ab43f9e41 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ClassDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ClassDeclaration.java
@@ -117,7 +117,7 @@ public ClassDeclaration(ExtList children, ProgramElementName fullName, boolean i
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (modArray != null) {
result += modArray.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ClassInitializer.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ClassInitializer.java
index aebf56f774e..2a35ae21d8f 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ClassInitializer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ClassInitializer.java
@@ -70,7 +70,7 @@ public Statement getStatementAt(int index) {
}
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (modArray != null) {
result += modArray.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/FieldDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/FieldDeclaration.java
index 26223d4712b..b3dbd242dd7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/FieldDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/FieldDeclaration.java
@@ -66,7 +66,7 @@ public ImmutableArray extends VariableSpecification> getVariables() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (modArray != null) {
result += modArray.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/InheritanceSpecification.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/InheritanceSpecification.java
index df4cebda29f..631c6aecb4d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/InheritanceSpecification.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/InheritanceSpecification.java
@@ -82,7 +82,7 @@ public SourceElement getLastElement() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (supertypes != null) {
result += supertypes.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/InterfaceDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/InterfaceDeclaration.java
index 201ab2f32ea..baf29255751 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/InterfaceDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/InterfaceDeclaration.java
@@ -65,7 +65,7 @@ public InterfaceDeclaration(ProgramElementName name) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (modArray != null) {
result += modArray.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/LocalVariableDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/LocalVariableDeclaration.java
index 710ed417aa5..16a18b6a58c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/LocalVariableDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/LocalVariableDeclaration.java
@@ -121,7 +121,7 @@ public ImmutableArray getVariables() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (modArray != null) {
result += modArray.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/MethodDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/MethodDeclaration.java
index 04346acf3a7..04a1aa6cf0b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/MethodDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/MethodDeclaration.java
@@ -163,12 +163,12 @@ public SourceElement getFirstElement() {
@Override
public SourceElement getLastElement() {
- return getChildAt(getChildCount() - 1).getLastElement();
+ return getChildAt(getSyntaxChildCount() - 1).getLastElement();
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (modArray != null) {
result += modArray.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ParameterDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ParameterDeclaration.java
index 75c08a72be7..75685e606d5 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ParameterDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/ParameterDeclaration.java
@@ -109,7 +109,7 @@ public ImmutableArray getVariables() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (modArray != null) {
result += modArray.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/SuperArrayDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/SuperArrayDeclaration.java
index 67f52df42bc..55cd9a967b3 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/SuperArrayDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/SuperArrayDeclaration.java
@@ -28,7 +28,7 @@ public SuperArrayDeclaration(FieldDeclaration length) {
this(new ProgramElementName("SuperArray"), length);
}
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/Throws.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/Throws.java
index 35d0279ec88..80eb623695c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/Throws.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/Throws.java
@@ -77,7 +77,7 @@ public SourceElement getLastElement() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (exceptions != null) {
result += exceptions.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/VariableDeclaration.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/VariableDeclaration.java
index 185194af413..a6124472682 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/VariableDeclaration.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/VariableDeclaration.java
@@ -95,7 +95,7 @@ public SourceElement getFirstElementIncludingBlocks() {
}
public SourceElement getLastElement() {
- return getChildAt(getChildCount() - 1).getLastElement();
+ return getChildAt(getSyntaxChildCount() - 1).getLastElement();
}
/**
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/VariableSpecification.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/VariableSpecification.java
index 787cf6b874e..6c28e9a0ad8 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/VariableSpecification.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/VariableSpecification.java
@@ -100,7 +100,7 @@ public VariableSpecification(ExtList children, IProgramVariable var, int dim, Ty
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (var != null) {
result++;
@@ -280,10 +280,10 @@ public boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat) {
}
}
nat.add(var, vs.getProgramVariable());
- if (vs.getChildCount() != getChildCount()) {
+ if (vs.getSyntaxChildCount() != getSyntaxChildCount()) {
return false;
}
- for (int i = 0, cc = getChildCount(); i < cc; i++) {
+ for (int i = 0, cc = getSyntaxChildCount(); i < cc; i++) {
if (!getChildAt(i).equalsModRenaming(vs.getChildAt(i), nat)) {
return false;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/modifier/AnnotationUseSpecification.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/modifier/AnnotationUseSpecification.java
index fa81c6b4a6d..18266529523 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/modifier/AnnotationUseSpecification.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/modifier/AnnotationUseSpecification.java
@@ -39,7 +39,7 @@ public ProgramElement getChildAt(int index) {
throw new ArrayIndexOutOfBoundsException();
}
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 1;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/expression/ArrayInitializer.java b/key.core/src/main/java/de/uka/ilkd/key/java/expression/ArrayInitializer.java
index 5e1a0fe937b..a4f9abffeb8 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/expression/ArrayInitializer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/expression/ArrayInitializer.java
@@ -54,7 +54,7 @@ public ArrayInitializer(Expression[] expressions, KeYJavaType kjt) {
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (children != null) ? children.size() : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/expression/Operator.java b/key.core/src/main/java/de/uka/ilkd/key/java/expression/Operator.java
index ff1a653287a..952f7e1b5da 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/expression/Operator.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/expression/Operator.java
@@ -143,7 +143,7 @@ public SourceElement getLastElement() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (children != null) ? children.size() : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/ExactInstanceof.java b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/ExactInstanceof.java
index a76c65a7676..f327fa68264 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/ExactInstanceof.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/ExactInstanceof.java
@@ -43,7 +43,7 @@ public ExactInstanceof(Expression unaryChild, TypeReference typeref) {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (children != null) {
result += children.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/Instanceof.java b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/Instanceof.java
index 284c254db72..a3ba9852625 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/Instanceof.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/Instanceof.java
@@ -31,13 +31,13 @@ public class Instanceof extends TypeOperator {
public Instanceof(ExtList children) {
super(children);
- assert getChildCount() == 2 : "not 2 children but " + getChildCount();
+ assert this.getSyntaxChildCount() == 2 : "not 2 children but " + this.getSyntaxChildCount();
}
public Instanceof(Expression unaryChild, TypeReference typeref) {
super(unaryChild, typeref);
- assert getChildCount() == 2 : "not 2 children but " + getChildCount();
+ assert this.getSyntaxChildCount() == 2 : "not 2 children but " + this.getSyntaxChildCount();
}
/**
@@ -46,7 +46,7 @@ public Instanceof(Expression unaryChild, TypeReference typeref) {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (children != null) {
result += children.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/New.java b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/New.java
index bc7027d5498..51062cc9558 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/New.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/New.java
@@ -99,7 +99,7 @@ public SourceElement getFirstElementIncludingBlocks() {
@Override
public SourceElement getLastElement() {
- return getChildAt(getChildCount() - 1).getLastElement();
+ return getChildAt(this.getSyntaxChildCount() - 1).getLastElement();
}
@@ -142,7 +142,7 @@ public TypeDeclaration getTypeDeclarationAt(int index) {
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (accessPath != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/NewArray.java b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/NewArray.java
index 2496a1a84cd..e88712ff847 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/NewArray.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/NewArray.java
@@ -148,7 +148,7 @@ public ArrayInitializer getArrayInitializer() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (typeReference != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/TypeCast.java b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/TypeCast.java
index 76ac7b3c5a1..f6b3d467215 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/TypeCast.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/expression/operator/TypeCast.java
@@ -49,7 +49,7 @@ public TypeCast(ExtList children) {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (typeReference != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/ArrayLengthReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/ArrayLengthReference.java
index c12d07be94d..d141a83bd81 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/ArrayLengthReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/ArrayLengthReference.java
@@ -49,7 +49,7 @@ public ArrayLengthReference(ExtList children) {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (prefix != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/ArrayReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/ArrayReference.java
index 667f011688b..abba0a21f91 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/ArrayReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/ArrayReference.java
@@ -184,7 +184,7 @@ public ReferencePrefix getReferencePrefix() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (prefix != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/ExecutionContext.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/ExecutionContext.java
index c9a1ba78a12..3c0aab03cd8 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/ExecutionContext.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/ExecutionContext.java
@@ -63,7 +63,7 @@ public ExecutionContext(ExtList children) {
* @return an int giving the number of children of this node
*/
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int count = 0;
if (classContext != null) {
count++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/FieldReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/FieldReference.java
index 0616f1b3c7e..e6d3b6f61af 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/FieldReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/FieldReference.java
@@ -56,7 +56,7 @@ public FieldReference(ProgramVariable pv, ReferencePrefix prefix, PositionInfo p
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (prefix != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/MetaClassReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/MetaClassReference.java
index 446d332ff55..2305cf42a18 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/MetaClassReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/MetaClassReference.java
@@ -54,7 +54,7 @@ public MetaClassReference(ExtList children) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (typeReference != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/MethodReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/MethodReference.java
index e31c8e827b3..7b48aaaab09 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/MethodReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/MethodReference.java
@@ -117,7 +117,7 @@ public ReferencePrefix getReferencePrefix() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (prefix != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/PackageReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/PackageReference.java
index fdccddd95cc..fc821d1c24d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/PackageReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/PackageReference.java
@@ -63,7 +63,7 @@ public SourceElement getFirstElementIncludingBlocks() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (prefix != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/SchematicFieldReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/SchematicFieldReference.java
index 97c27ac7abc..130c07b1c93 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/SchematicFieldReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/SchematicFieldReference.java
@@ -43,7 +43,7 @@ public SchematicFieldReference(ExtList children, ReferencePrefix prefix) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (prefix != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/SpecialConstructorReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/SpecialConstructorReference.java
index bb05f76b56c..81e6e2baf4b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/SpecialConstructorReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/SpecialConstructorReference.java
@@ -77,7 +77,7 @@ public SpecialConstructorReference(ExtList children, PositionInfo pi) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return getExpressionCount();
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/SuperReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/SuperReference.java
index ad5d2828d63..11d9725c4a7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/SuperReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/SuperReference.java
@@ -73,7 +73,7 @@ public ReferencePrefix getReferencePrefix() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int count = 0;
if (prefix != null) {
count++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/ThisReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/ThisReference.java
index 6c04bf116a3..573444a7bff 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/ThisReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/ThisReference.java
@@ -66,7 +66,7 @@ public SourceElement getFirstElementIncludingBlocks() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int count = 0;
if (prefix != null) {
count++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/TypeReferenceImp.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/TypeReferenceImp.java
index f70a47f3e46..a05c177b7ec 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/TypeReferenceImp.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/TypeReferenceImp.java
@@ -80,7 +80,7 @@ public SourceElement getFirstElementIncludingBlocks() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (prefix != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/reference/VariableReference.java b/key.core/src/main/java/de/uka/ilkd/key/java/reference/VariableReference.java
index 8b2d4a86702..6d127891693 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/reference/VariableReference.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/reference/VariableReference.java
@@ -41,7 +41,7 @@ public ProgramElementName getProgramElementName() {
return (ProgramElementName) variable.name();
}
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (variable != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Assert.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Assert.java
index 1cffa3aa4e6..065e882b968 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Assert.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Assert.java
@@ -41,7 +41,7 @@ public ProgramElement getChildAt(int index) {
return getExpressionAt(index);
}
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return getExpressionCount();
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Case.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Case.java
index c1c9535b626..6b24a389b40 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Case.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Case.java
@@ -76,7 +76,7 @@ public Case(ExtList children, Expression expr, PositionInfo pos) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (expression != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Catch.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Catch.java
index 4ab7438bc60..bf1d64d22c7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Catch.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Catch.java
@@ -70,7 +70,7 @@ public SourceElement getLastElement() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (parameter != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/CatchAllStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/CatchAllStatement.java
index bb7690aa055..b0387cb822f 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/CatchAllStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/CatchAllStatement.java
@@ -44,7 +44,7 @@ public LocationVariable getParam() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int i = 0;
if (body != null) {
i++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Ccatch.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Ccatch.java
index e3126a5ebe6..3e8558efbf8 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Ccatch.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Ccatch.java
@@ -99,7 +99,7 @@ public boolean hasNonStdParameterDeclaration() {
* @return an int giving the number of children of this node
*/
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (hasParameterDeclaration()) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Default.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Default.java
index 6536464ed76..d1d4960d423 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Default.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Default.java
@@ -54,7 +54,7 @@ public Default(ExtList children) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (body != null) {
result += body.size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Else.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Else.java
index 63dc0c92e63..154fffc633e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Else.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Else.java
@@ -54,7 +54,7 @@ public SourceElement getLastElement() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (body != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Exec.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Exec.java
index 32774cb8f19..5afad68e81b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Exec.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Exec.java
@@ -131,7 +131,7 @@ public SourceElement getFirstElement() {
@Override
public SourceElement getLastElement() {
- return getChildAt(getChildCount() - 1).getLastElement();
+ return getChildAt(getSyntaxChildCount() - 1).getLastElement();
}
/**
@@ -140,7 +140,7 @@ public SourceElement getLastElement() {
* @return an int giving the number of children of this node
*/
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (body != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/ExpressionJumpStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/ExpressionJumpStatement.java
index 4bddeab80a7..2a1d810627d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/ExpressionJumpStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/ExpressionJumpStatement.java
@@ -85,7 +85,7 @@ public Expression getExpression() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (expression != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Finally.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Finally.java
index bd4e40b6d8b..24c2db9ea17 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Finally.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Finally.java
@@ -52,7 +52,7 @@ public Finally(ExtList children) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (body != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/ForUpdates.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/ForUpdates.java
index 3823a2ab3be..3626fccfc96 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/ForUpdates.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/ForUpdates.java
@@ -69,7 +69,7 @@ public void visit(Visitor v) {
v.performActionOnForUpdates(this);
}
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return getExpressionCount();
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Guard.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Guard.java
index d1483fed22a..70c883985bd 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Guard.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Guard.java
@@ -33,7 +33,7 @@ public void visit(Visitor v) {
v.performActionOnGuard(this);
}
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (expr != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/If.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/If.java
index e9f451dc038..25a8be2825c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/If.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/If.java
@@ -88,7 +88,7 @@ public If(Expression e, Then thenBranch, Else elseBranch) {
* @return
*/
public SourceElement getLastElement() {
- return getChildAt(getChildCount() - 1).getLastElement();
+ return getChildAt(getSyntaxChildCount() - 1).getLastElement();
}
/**
@@ -97,7 +97,7 @@ public SourceElement getLastElement() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
if (elseBranch != null) {
return 3;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/JmlAssert.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/JmlAssert.java
index 732174aa2fd..8254ebcbe92 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/JmlAssert.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/JmlAssert.java
@@ -149,7 +149,7 @@ protected int computeHashCode() {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LabelJumpStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LabelJumpStatement.java
index 68d1c45a7b2..755e228811a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LabelJumpStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LabelJumpStatement.java
@@ -93,7 +93,7 @@ public ProgramElementName getProgramElementName() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (name != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LabeledStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LabeledStatement.java
index 7a8fffc97ca..6ac702ba7be 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LabeledStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LabeledStatement.java
@@ -211,7 +211,7 @@ public Statement getBody() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (name != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopInit.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopInit.java
index f3f6e918d8c..289ab69dd81 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopInit.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopInit.java
@@ -74,7 +74,7 @@ public void visit(Visitor v) {
v.performActionOnLoopInit(this);
}
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return getStatementCount();
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopScopeBlock.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopScopeBlock.java
index 90b373e1438..edd36bc8d50 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopScopeBlock.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopScopeBlock.java
@@ -107,7 +107,7 @@ public ImmutableArray getPrefixElements() {
@Override
public PosInProgram getFirstActiveChildPos() {
return getStatementCount() == 0 ? PosInProgram.TOP
- : PosInProgram.TOP.down(getChildCount() - 1).down(0);
+ : PosInProgram.TOP.down(this.getSyntaxChildCount() - 1).down(0);
}
/**
@@ -150,7 +150,7 @@ public IProgramVariable getIndexPV() {
* @return an int giving the number of children of this node
*/
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (indexPV != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopStatement.java
index af0b8c08b57..d2f68f3de43 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/LoopStatement.java
@@ -217,7 +217,7 @@ static private ExtList add(ExtList e, Object o) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (inits != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/MergePointStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/MergePointStatement.java
index 1749900d64d..0de156b2627 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/MergePointStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/MergePointStatement.java
@@ -82,7 +82,7 @@ public Expression getExpression() {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (identifier != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/MethodBodyStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/MethodBodyStatement.java
index 60d8aa4206b..33be238c465 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/MethodBodyStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/MethodBodyStatement.java
@@ -161,7 +161,7 @@ public Statement getBody(Services services) {
*
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int i = 0;
if (bodySource != null) {
i++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/MethodFrame.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/MethodFrame.java
index ede5682ff23..224239aaa71 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/MethodFrame.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/MethodFrame.java
@@ -53,7 +53,8 @@ public MethodFrame(IProgramVariable resultVar, IExecutionContext execContext,
this.execContext = execContext;
firstActiveChildPos =
- body.isEmpty() ? PosInProgram.TOP : PosInProgram.TOP.down(getChildCount() - 1).down(0);
+ body.isEmpty() ? PosInProgram.TOP
+ : PosInProgram.TOP.down(getSyntaxChildCount() - 1).down(0);
Debug.assertTrue(execContext != null, "methodframe: executioncontext missing");
Debug.assertTrue(body != null, "methodframe: body missing");
@@ -78,7 +79,8 @@ public MethodFrame(IProgramVariable resultVar, IExecutionContext execContext,
this.execContext = execContext;
firstActiveChildPos =
- body.isEmpty() ? PosInProgram.TOP : PosInProgram.TOP.down(getChildCount() - 1).down(0);
+ body.isEmpty() ? PosInProgram.TOP
+ : PosInProgram.TOP.down(getSyntaxChildCount() - 1).down(0);
Debug.assertTrue(execContext != null, "methodframe: executioncontext missing");
@@ -185,7 +187,7 @@ public IProgramMethod getProgramMethod() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (resultVar != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/SetStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/SetStatement.java
index 0ece40806f5..5bbdd77569e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/SetStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/SetStatement.java
@@ -62,7 +62,7 @@ public void visit(Visitor v) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Switch.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Switch.java
index 3816e6f9282..f4a2b7ca6eb 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Switch.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Switch.java
@@ -81,7 +81,7 @@ public Switch(ExtList children) {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (expression != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/SynchronizedBlock.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/SynchronizedBlock.java
index 492cfc5b683..d0bc46c3c61 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/SynchronizedBlock.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/SynchronizedBlock.java
@@ -135,7 +135,7 @@ private boolean expressionWithoutSideffects() {
public PosInProgram getFirstActiveChildPos() {
return getStatementCount() == 0 ? PosInProgram.TOP
: (expressionWithoutSideffects()
- ? PosInProgram.TOP.down(getChildCount() - 1).down(0)
+ ? PosInProgram.TOP.down(getSyntaxChildCount() - 1).down(0)
: PosInProgram.ONE);
}
@@ -183,7 +183,7 @@ public Expression getExpression() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (expression != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Then.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Then.java
index a87fd000787..37ed703cd92 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Then.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Then.java
@@ -65,7 +65,7 @@ public SourceElement getLastElement() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return (body != null) ? 1 : 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/TransactionStatement.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/TransactionStatement.java
index 00c17a5e034..6ae42412b2a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/TransactionStatement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/TransactionStatement.java
@@ -39,7 +39,7 @@ public ProgramElement getChildAt(int index) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Try.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Try.java
index 9011234e233..01c2c35e49a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/Try.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/Try.java
@@ -137,7 +137,7 @@ public SourceElement getFirstElement() {
public SourceElement getLastElement() {
- return getChildAt(getChildCount() - 1).getLastElement();
+ return getChildAt(this.getSyntaxChildCount() - 1).getLastElement();
}
/**
@@ -146,7 +146,7 @@ public SourceElement getLastElement() {
* @return an int giving the number of children of this node
*/
- public int getChildCount() {
+ public int getSyntaxChildCount() {
int result = 0;
if (body != null) {
result++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/CreatingASTVisitor.java b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/CreatingASTVisitor.java
index 31bb841ed14..b8cdb2acdeb 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/CreatingASTVisitor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/CreatingASTVisitor.java
@@ -543,11 +543,11 @@ public void performActionOnMethodFrame(MethodFrame x) {
pi = PositionInfo.UNDEFINED;
}
- if (x.getChildCount() == 3) {
+ if (x.getSyntaxChildCount() == 3) {
addChild(new MethodFrame((IProgramVariable) changeList.get(0),
(IExecutionContext) changeList.get(1), (StatementBlock) changeList.get(2), pi));
- } else if (x.getChildCount() == 2) {
+ } else if (x.getSyntaxChildCount() == 2) {
addChild(new MethodFrame(null, (IExecutionContext) changeList.get(0),
(StatementBlock) changeList.get(1), pi));
} else {
@@ -1527,7 +1527,7 @@ ProgramElement createNewElement(ExtList changeList) {
* @return pe2's position in pe1
*/
protected static int getPosition(NonTerminalProgramElement pe1, ProgramElement pe2) {
- int n = pe1.getChildCount();
+ int n = pe1.getSyntaxChildCount();
int i = 0;
while ((i < n) && (pe1.getChildAt(i) != pe2)) {
i++;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/FreeLabelFinder.java b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/FreeLabelFinder.java
index cd4968add8d..55e251fb36b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/FreeLabelFinder.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/FreeLabelFinder.java
@@ -20,7 +20,7 @@ public boolean findLabel(Label label, ProgramElement node) {
if (!(node instanceof LabeledStatement
&& ((LabeledStatement) node).getLabel().equals(label))) {
if (node instanceof NonTerminalProgramElement nonTerminalNode) {
- for (int i = 0; i < nonTerminalNode.getChildCount(); i++) {
+ for (int i = 0; i < nonTerminalNode.getSyntaxChildCount(); i++) {
if (nonTerminalNode.getChildAt(i) != null) {
if (findLabel(label, nonTerminalNode.getChildAt(i))) {
return true;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/InnerBreakAndContinueReplacer.java b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/InnerBreakAndContinueReplacer.java
index bbb9fbfe280..35c3b1e4d1a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/InnerBreakAndContinueReplacer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/InnerBreakAndContinueReplacer.java
@@ -285,11 +285,11 @@ public void performActionOnMethodFrame(final MethodFrame x) {
final ExtList changeList = stack.peek();
if (!changeList.isEmpty() && changeList.getFirst() == CHANGED) {
changeList.removeFirst();
- if (x.getChildCount() == 3) {
+ if (x.getSyntaxChildCount() == 3) {
addChild(new MethodFrame((IProgramVariable) changeList.get(0),
(IExecutionContext) changeList.get(1), (StatementBlock) changeList.get(2),
PositionInfo.UNDEFINED));
- } else if (x.getChildCount() == 2) {
+ } else if (x.getSyntaxChildCount() == 2) {
addChild(new MethodFrame(null, (IExecutionContext) changeList.get(0),
(StatementBlock) changeList.get(1), PositionInfo.UNDEFINED));
} else {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/JavaASTWalker.java b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/JavaASTWalker.java
index 125f6dbdd5c..3dd9391d1fd 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/JavaASTWalker.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/JavaASTWalker.java
@@ -63,7 +63,7 @@ public int depth() {
protected void walk(ProgramElement node) {
if (node instanceof NonTerminalProgramElement nonTerminalNode) {
depth++;
- for (int i = 0; i < nonTerminalNode.getChildCount(); i++) {
+ for (int i = 0; i < nonTerminalNode.getSyntaxChildCount(); i++) {
if (nonTerminalNode.getChildAt(i) != null) {
walk(nonTerminalNode.getChildAt(i));
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/OuterBreakContinueAndReturnReplacer.java b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/OuterBreakContinueAndReturnReplacer.java
index a796487d7d1..c6c560ffb4f 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/OuterBreakContinueAndReturnReplacer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/OuterBreakContinueAndReturnReplacer.java
@@ -303,12 +303,12 @@ public void performActionOnMethodFrame(final MethodFrame x) {
final ExtList changeList = stack.peek();
if (!changeList.isEmpty() && changeList.getFirst() == CHANGED) {
changeList.removeFirst();
- if (x.getChildCount() == 3) {
+ if (x.getSyntaxChildCount() == 3) {
addChild(new MethodFrame((IProgramVariable) changeList.get(0),
(IExecutionContext) changeList.get(1), (StatementBlock) changeList.get(2),
PositionInfo.UNDEFINED));
- } else if (x.getChildCount() == 2) {
+ } else if (x.getSyntaxChildCount() == 2) {
addChild(new MethodFrame(null, (IExecutionContext) changeList.get(0),
(StatementBlock) changeList.get(1), PositionInfo.UNDEFINED));
} else {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/ProgramContextAdder.java b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/ProgramContextAdder.java
index 589b1cb9d4d..49df58e0032 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/visitor/ProgramContextAdder.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/visitor/ProgramContextAdder.java
@@ -110,12 +110,12 @@ protected JavaNonTerminalProgramElement wrap(JavaNonTerminalProgramElement conte
private final StatementBlock createWrapperBody(JavaNonTerminalProgramElement wrapper,
StatementBlock putIn, PosInProgram suffix) {
- final int putInLength = putIn.getChildCount();
+ final int putInLength = putIn.getSyntaxChildCount();
// ATTENTION: may be -1
final int lastChild = suffix.last();
- final int childLeft = wrapper.getChildCount() - lastChild;
+ final int childLeft = wrapper.getSyntaxChildCount() - lastChild;
final int childrenToAdd = putInLength + childLeft;
@@ -182,7 +182,7 @@ protected MethodFrame createMethodFrameWrapper(MethodFrame old, StatementBlock b
protected LabeledStatement createLabeledStatementWrapper(LabeledStatement old,
JavaNonTerminalProgramElement body) {
return new LabeledStatement(old.getLabel(),
- body instanceof StatementBlock && body.getChildCount() == 1
+ body instanceof StatementBlock && body.getSyntaxChildCount() == 1
&& !(body.getChildAt(0) instanceof LocalVariableDeclaration)
? (Statement) body.getChildAt(0)
: (Statement) body,
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/JavaBlock.java b/key.core/src/main/java/de/uka/ilkd/key/logic/JavaBlock.java
index b7d72e26382..2dd935eda54 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/JavaBlock.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/JavaBlock.java
@@ -8,6 +8,7 @@
import de.uka.ilkd.key.pp.PrettyPrinter;
import org.key_project.logic.Program;
+import org.key_project.logic.SyntaxElement;
import org.key_project.util.EqualsModProofIrrelevancy;
import org.slf4j.Logger;
@@ -64,7 +65,7 @@ public boolean isEmpty() {
public int size() {
if ((program() instanceof StatementBlock)) {
- return ((StatementBlock) program()).getChildCount();
+ return ((StatementBlock) program()).getSyntaxChildCount();
}
return 0;
}
@@ -128,4 +129,18 @@ public int hashCodeModProofIrrelevancy() {
}
return hashCode;
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ if (prg == null || this == EMPTY_JAVABLOCK)
+ return 0;
+ return 1;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ if (n == 0)
+ return prg;
+ throw new IndexOutOfBoundsException("JavaBlock " + this + " has only one child");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ElementaryUpdate.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ElementaryUpdate.java
index 0837fda6089..9ae7934762d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ElementaryUpdate.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ElementaryUpdate.java
@@ -9,6 +9,7 @@
import de.uka.ilkd.key.ldt.JavaDLTheory;
import org.key_project.logic.Name;
+import org.key_project.logic.SyntaxElement;
import org.key_project.logic.sort.Sort;
@@ -58,4 +59,16 @@ public static ElementaryUpdate getInstance(UpdateableOperator lhs) {
public UpdateableOperator lhs() {
return lhs;
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ return 1;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ if (n == 0)
+ return lhs;
+ throw new IndexOutOfBoundsException("Elementary updates only contain 1 child");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Equality.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Equality.java
index ecd4c878dfc..d1d58d62d6c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Equality.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Equality.java
@@ -6,6 +6,7 @@
import de.uka.ilkd.key.ldt.JavaDLTheory;
import org.key_project.logic.Name;
+import org.key_project.logic.SyntaxElement;
import org.key_project.logic.sort.Sort;
@@ -34,4 +35,14 @@ public final class Equality extends AbstractSortedOperator {
private Equality(Name name, Sort targetSort) {
super(name, new Sort[] { targetSort, targetSort }, JavaDLTheory.FORMULA, true);
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ return 0;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException(name() + " has no children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfExThenElse.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfExThenElse.java
index be40110ea40..a9ee0c2371b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfExThenElse.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfExThenElse.java
@@ -6,6 +6,7 @@
import de.uka.ilkd.key.ldt.JavaDLTheory;
import org.key_project.logic.Name;
+import org.key_project.logic.SyntaxElement;
import org.key_project.logic.TermCreationException;
import org.key_project.logic.op.AbstractOperator;
import org.key_project.logic.sort.Sort;
@@ -44,4 +45,14 @@ public void validTopLevelException(T term
throw new TermCreationException(this, term);
}
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ return 0;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException(name() + " has no children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfThenElse.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfThenElse.java
index a7fe9097055..bf2aabb58d0 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfThenElse.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfThenElse.java
@@ -8,6 +8,7 @@
import de.uka.ilkd.key.logic.sort.ProgramSVSort;
import org.key_project.logic.Name;
+import org.key_project.logic.SyntaxElement;
import org.key_project.logic.TermCreationException;
import org.key_project.logic.op.AbstractOperator;
import org.key_project.logic.sort.Sort;
@@ -85,4 +86,14 @@ public void validTopLevelException(T term
throw new TermCreationException(this, term);
}
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ return 0;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException(name() + " has no children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Junctor.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Junctor.java
index e2b1162c6cc..71db0f91e10 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Junctor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Junctor.java
@@ -6,6 +6,7 @@
import de.uka.ilkd.key.ldt.JavaDLTheory;
import org.key_project.logic.Name;
+import org.key_project.logic.SyntaxElement;
import org.key_project.logic.sort.Sort;
@@ -62,4 +63,14 @@ private static Sort[] createFormulaSortArray(int arity) {
private Junctor(Name name, int arity) {
super(name, createFormulaSortArray(arity), JavaDLTheory.FORMULA, true);
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ return 0;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException("The Junctor operator " + name() + " has no children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/LogicVariable.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/LogicVariable.java
index d4e8aa5def9..c8d0769489a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/LogicVariable.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/LogicVariable.java
@@ -9,6 +9,7 @@
import org.key_project.logic.Name;
import org.key_project.logic.ParsableVariable;
+import org.key_project.logic.SyntaxElement;
import org.key_project.logic.sort.Sort;
import org.key_project.util.EqualsModProofIrrelevancy;
@@ -43,4 +44,14 @@ public boolean equalsModProofIrrelevancy(Object obj) {
public int hashCodeModProofIrrelevancy() {
return Objects.hash(name(), sort());
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ return 0;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException("Logic variable " + name() + " does not have children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ObserverFunction.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ObserverFunction.java
index 95d0597ab6c..adbd5d5736a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ObserverFunction.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ObserverFunction.java
@@ -7,6 +7,7 @@
import de.uka.ilkd.key.java.abstraction.KeYJavaType;
import de.uka.ilkd.key.logic.ProgramElementName;
+import org.key_project.logic.SyntaxElement;
import org.key_project.logic.sort.Sort;
import org.key_project.util.collection.ImmutableArray;
@@ -22,7 +23,7 @@
*/
public class ObserverFunction extends JFunction implements IObserverFunction {
- private final KeYJavaType container;
+ private final Qualifier container;
private final boolean isStatic;
private final ImmutableArray paramTypes;
private final KeYJavaType type;
@@ -42,7 +43,7 @@ public ObserverFunction(String baseName, Sort sort, KeYJavaType type, Sort heapS
assert type == null || type.getSort() == sort;
assert container != null;
this.type = type;
- this.container = container;
+ this.container = Qualifier.create(container);
this.isStatic = isStatic;
this.paramTypes = paramTypes;
this.heapCount = heapCount;
@@ -107,7 +108,7 @@ public final KeYJavaType getType() {
*/
@Override
public final KeYJavaType getContainerType() {
- return container;
+ return container.getQualifier();
}
@@ -169,4 +170,15 @@ public final ImmutableArray getParamTypes() {
return paramTypes;
}
+ @Override
+ public int getSyntaxChildCount() {
+ return 1;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ if (n == 0)
+ return container;
+ throw new IndexOutOfBoundsException("ObserverFunction " + name() + " has only one child");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java
index a86db464202..07a2e2bc5de 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java
@@ -257,7 +257,7 @@ public ImmutableArray getModifiers() {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
index 1ab0db5231b..12db0cb8831 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
@@ -142,7 +142,7 @@ public Expression getExpressionAt(int index) {
}
@Override
- public int getChildCount() {
+ public int getSyntaxChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramVariable.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramVariable.java
index 40cb2da7762..49982fd749d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramVariable.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramVariable.java
@@ -16,6 +16,7 @@
import de.uka.ilkd.key.rule.MatchConditions;
import org.key_project.logic.ParsableVariable;
+import org.key_project.logic.SyntaxElement;
import org.key_project.logic.sort.Sort;
import org.key_project.util.ExtList;
@@ -256,4 +257,15 @@ public MatchConditions match(SourceData source, MatchConditions matchCond) {
return null;
}
}
+
+ @Override
+ public int getSyntaxChildCount() {
+ return 0;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException(
+ "Program variable " + name() + " does not have children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
new file mode 100644
index 00000000000..be18e73d0d3
--- /dev/null
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
@@ -0,0 +1,41 @@
+/* This file is part of KeY - https://key-project.org
+ * KeY is licensed under the GNU General Public License Version 2
+ * SPDX-License-Identifier: GPL-2.0-only */
+package de.uka.ilkd.key.logic.op;
+
+import java.util.WeakHashMap;
+
+import org.key_project.logic.SyntaxElement;
+
+public class Qualifier implements SyntaxElement {
+ private final T qualifier;
+
+ private static final WeakHashMap
*
- * A term label can have parameters accessible via {@link #getChild(int)} and
- * {@link #getChildCount()}. Such parameters can be any {@link Object}. But keep in mind that it is
+ * A term label can have parameters accessible via {@link #getTLChild(int)} and
+ * {@link #getTLChildCount()}. Such parameters can be any {@link Object}. But keep in mind that it is
* required to parse {@link String}s into {@link Term}s, e.g. if it is used in a Taclet definition
* or if a cut rule is applied. For convenience parameters are always printed as {@link String}s
* and have to be parsed individually into the required {@link Object} instances via a
@@ -150,7 +152,7 @@
* @see TermLabelManager
*/
// spotless:on
-public interface TermLabel extends Named {
+public interface TermLabel extends Named, SyntaxElement, /* TODO: Remove*/ TerminalSyntaxElement {
/**
* Retrieves the i-th parameter object of this term label.
@@ -161,16 +163,16 @@ public interface TermLabel extends Named {
* @param i the number of the parameter to retrieve ( {@code 0 <= i < getChildCount()})
* @return the selected parameter
* @throws IndexOutOfBoundsException if the given parameter number i is negative or
- * greater-or-equal the number of parameters returned by {@link #getChildCount()}
+ * greater-or-equal the number of parameters returned by {@link #getTLChildCount()}
*/
- Object getChild(int i);
+ Object getTLChild(int i);
/**
* Gets the number of parameters of this term label.
*
* @return the number of parameters (a non-negative number)
*/
- int getChildCount();
+ int getTLChildCount();
/**
* Returns {@code true} iff this label is used in any way during the proof. E.g.,
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ElementaryUpdate.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ElementaryUpdate.java
index 9ae7934762d..c4ae30a8789 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ElementaryUpdate.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ElementaryUpdate.java
@@ -61,7 +61,7 @@ public UpdateableOperator lhs() {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 1;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Equality.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Equality.java
index d1d58d62d6c..09fa71a855e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Equality.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Equality.java
@@ -37,7 +37,7 @@ private Equality(Name name, Sort targetSort) {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/FormulaSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/FormulaSV.java
index f93b960860e..270c2a92c89 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/FormulaSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/FormulaSV.java
@@ -7,12 +7,13 @@
import de.uka.ilkd.key.util.pp.Layouter;
import org.key_project.logic.Name;
+import org.key_project.logic.TerminalSyntaxElement;
/**
* A schema variable that is used as placeholder for formulas.
*/
-public final class FormulaSV extends OperatorSV {
+public final class FormulaSV extends OperatorSV implements TerminalSyntaxElement {
/**
* @param name the name of the SchemaVariable
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfExThenElse.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfExThenElse.java
index a9ee0c2371b..c7f05ada203 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfExThenElse.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfExThenElse.java
@@ -47,7 +47,7 @@ public void validTopLevelException(T term
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfThenElse.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfThenElse.java
index bf2aabb58d0..a77b49ec111 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfThenElse.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/IfThenElse.java
@@ -88,7 +88,7 @@ public void validTopLevelException(T term
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Junctor.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Junctor.java
index 71db0f91e10..42b78108d67 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Junctor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Junctor.java
@@ -65,7 +65,7 @@ private Junctor(Name name, int arity) {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/LogicVariable.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/LogicVariable.java
index c8d0769489a..fe94c1c3b01 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/LogicVariable.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/LogicVariable.java
@@ -46,7 +46,7 @@ public int hashCodeModProofIrrelevancy() {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ObserverFunction.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ObserverFunction.java
index adbd5d5736a..3edd92a4333 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ObserverFunction.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ObserverFunction.java
@@ -171,7 +171,7 @@ public final ImmutableArray getParamTypes() {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 1;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java
index 07a2e2bc5de..a86db464202 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramMethod.java
@@ -257,7 +257,7 @@ public ImmutableArray getModifiers() {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
index 12db0cb8831..8a0406ee4b6 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
@@ -22,6 +22,8 @@
import de.uka.ilkd.key.util.pp.Layouter;
import org.key_project.logic.Name;
+import org.key_project.logic.SyntaxElement;
+import org.key_project.logic.TerminalSyntaxElement;
import org.key_project.util.collection.ImmutableArray;
import org.key_project.util.collection.ImmutableList;
@@ -32,7 +34,7 @@
* Objects of this class are schema variables matching program constructs within modal operators.
* The particular construct being matched is determined by the ProgramSVSort of the schema variable.
*/
-public final class ProgramSV extends OperatorSV implements ProgramConstruct, UpdateableOperator {
+public final class ProgramSV extends OperatorSV implements ProgramConstruct, UpdateableOperator , TerminalSyntaxElement {
public static final Logger LOGGER = LoggerFactory.getLogger(ProgramSV.class);
private static final ProgramList EMPTY_LIST_INSTANTIATION =
@@ -142,13 +144,18 @@ public Expression getExpressionAt(int index) {
}
@Override
- public int getSyntaxChildCount() {
- return 0;
+ public ProgramElement getChildAt(int index) {
+ return this;
}
@Override
- public ProgramElement getChildAt(int index) {
- return this;
+ public SyntaxElement getChild(int n) {
+ return TerminalSyntaxElement.super.getChild(n);
+ }
+
+ @Override
+ public int getChildCount() {
+ return TerminalSyntaxElement.super.getChildCount();
}
@Override
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramVariable.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramVariable.java
index 49982fd749d..67210bebe7f 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramVariable.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramVariable.java
@@ -259,7 +259,7 @@ public MatchConditions match(SourceData source, MatchConditions matchCond) {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
index be18e73d0d3..ad978c0b346 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
@@ -35,7 +35,7 @@ public SyntaxElement getChild(int n) {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Quantifier.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Quantifier.java
index 7a94e63f953..e73cb2e17c6 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Quantifier.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Quantifier.java
@@ -39,7 +39,7 @@ private Quantifier(Name name) {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/SkolemTermSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/SkolemTermSV.java
index 19bce65bc98..1cd550fa69d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/SkolemTermSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/SkolemTermSV.java
@@ -7,6 +7,7 @@
import de.uka.ilkd.key.util.pp.Layouter;
import org.key_project.logic.Name;
+import org.key_project.logic.TerminalSyntaxElement;
import org.key_project.logic.sort.Sort;
/**
@@ -14,7 +15,7 @@
* variables have to be accompanied by a "NewDependingOn" varcond, although with the removal of the
* meta variable mechanism, this would no longer really be necessary.
*/
-public final class SkolemTermSV extends OperatorSV {
+public final class SkolemTermSV extends OperatorSV implements TerminalSyntaxElement {
/**
* Creates a new schema variable that is used as placeholder for skolem terms.
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/SortDependingFunction.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/SortDependingFunction.java
index 50eee4f7b96..bd675d35d89 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/SortDependingFunction.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/SortDependingFunction.java
@@ -191,7 +191,7 @@ private record SortDependingFunctionTemplate(GenericSort sortDependingOn, Name k
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 1;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/SubstOp.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/SubstOp.java
index 561389444cf..193fcc78e60 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/SubstOp.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/SubstOp.java
@@ -76,7 +76,7 @@ public void validTopLevelException(T term
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermLabelSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermLabelSV.java
index 6dc0b73105f..fc1fb8526e3 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermLabelSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermLabelSV.java
@@ -8,11 +8,12 @@
import de.uka.ilkd.key.util.pp.Layouter;
import org.key_project.logic.Name;
+import org.key_project.logic.TerminalSyntaxElement;
/**
* A schema variable which matches term labels
*/
-public final class TermLabelSV extends OperatorSV implements SchemaVariable, TermLabel {
+public final class TermLabelSV extends OperatorSV implements TermLabel, TerminalSyntaxElement {
TermLabelSV(Name name) {
super(name, JavaDLTheory.TERMLABEL, true, false);
@@ -29,12 +30,12 @@ public String toString() {
}
@Override
- public Object getChild(int i) {
- throw new IndexOutOfBoundsException();
+ public int getTLChildCount() {
+ return 0;
}
@Override
- public int getSyntaxChildCount() {
- return 0;
+ public Object getTLChild(int i) {
+ throw new IndexOutOfBoundsException();
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermSV.java
index b057d045105..15353a7aaea 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermSV.java
@@ -7,13 +7,14 @@
import de.uka.ilkd.key.util.pp.Layouter;
import org.key_project.logic.Name;
+import org.key_project.logic.TerminalSyntaxElement;
import org.key_project.logic.sort.Sort;
/**
* A schema variable that is used as placeholder for terms.
*/
-public final class TermSV extends OperatorSV {
+public final class TermSV extends OperatorSV implements TerminalSyntaxElement {
/**
* @param name the name of the schema variable
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermTransformer.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermTransformer.java
index b722678fd3d..bb21080c5a3 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermTransformer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/TermTransformer.java
@@ -6,12 +6,13 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.rule.inst.SVInstantiations;
+import org.key_project.logic.TerminalSyntaxElement;
/**
* TermTransformer perform complex term transformation which cannot be (efficiently or at all)
* described by taclets.
*/
-public interface TermTransformer extends org.key_project.logic.op.SortedOperator, Operator {
+public interface TermTransformer extends org.key_project.logic.op.SortedOperator, Operator, /*TODO: check*/ TerminalSyntaxElement {
/**
* initiates term transformation of term. Note the top level operator of of parameter
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateApplication.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateApplication.java
index c51f0452be3..19c503cff67 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateApplication.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateApplication.java
@@ -80,7 +80,7 @@ public static Term getTarget(Term t) {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateJunctor.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateJunctor.java
index 5f55b7cfaad..ca3586e9aa8 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateJunctor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateJunctor.java
@@ -37,7 +37,7 @@ private UpdateJunctor(Name name, int arity) {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateSV.java
index 44b86cbd2c3..089f3b003e4 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/UpdateSV.java
@@ -7,12 +7,13 @@
import de.uka.ilkd.key.util.pp.Layouter;
import org.key_project.logic.Name;
+import org.key_project.logic.TerminalSyntaxElement;
/**
* A schema variable that is used as placeholder for updates.
*/
-public final class UpdateSV extends OperatorSV {
+public final class UpdateSV extends OperatorSV implements TerminalSyntaxElement {
UpdateSV(Name name) {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/VariableSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/VariableSV.java
index 1024cf7b45d..732769c23b4 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/VariableSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/VariableSV.java
@@ -6,12 +6,13 @@
import de.uka.ilkd.key.util.pp.Layouter;
import org.key_project.logic.Name;
+import org.key_project.logic.TerminalSyntaxElement;
import org.key_project.logic.sort.Sort;
/**
* Schema variable that is instantiated with logical variables.
*/
-public final class VariableSV extends OperatorSV implements QuantifiableVariable {
+public final class VariableSV extends OperatorSV implements QuantifiableVariable, TerminalSyntaxElement {
/**
* Creates a new SchemaVariable that is used as placeholder for bound(quantified) variables.
@@ -34,4 +35,6 @@ public void layout(Layouter> l) {
l.print("\\schemaVar \\variables ").print(sort().name().toString()).print(" ")
.print(name().toString());
}
+
+
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/sort/ProgramSVSort.java b/key.core/src/main/java/de/uka/ilkd/key/logic/sort/ProgramSVSort.java
index 04c17871eea..4f344bb86a2 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/sort/ProgramSVSort.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/sort/ProgramSVSort.java
@@ -482,7 +482,7 @@ protected boolean canStandFor(ProgramElement pe, Services services) {
|| pe instanceof SeqLength || pe instanceof SeqGet || pe instanceof SeqIndexOf
|| pe instanceof SeqSub || pe instanceof SeqReverse || pe instanceof SeqPut) {
if (pe instanceof NonTerminalProgramElement npe) {
- for (int i = 0, childCount = npe.getSyntaxChildCount(); i < childCount; i++) {
+ for (int i = 0, childCount = npe.getChildCount(); i < childCount; i++) {
if (!canStandFor(npe.getChildAt(i), services)) {
return false;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/LogicPrinter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/LogicPrinter.java
index 409c6dd32cd..11deca874c7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/LogicPrinter.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/LogicPrinter.java
@@ -816,11 +816,11 @@ void printLabels(Term t, String left, String right) {
afterFirst = true;
}
layouter.print(l.name().toString());
- if (l.getChildCount() > 0) {
+ if (l.getTLChildCount() > 0) {
layouter.print("(").beginC();
- for (int i = 0; i < l.getChildCount(); i++) {
- layouter.print("\"" + l.getChild(i).toString() + "\"");
- if (i < l.getChildCount() - 1) {
+ for (int i = 0; i < l.getTLChildCount(); i++) {
+ layouter.print("\"" + l.getTLChild(i).toString() + "\"");
+ if (i < l.getTLChildCount() - 1) {
layouter.print(",").ind(1, 2);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/PrettyPrinter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/PrettyPrinter.java
index fbc296e5837..aa4d5c176c9 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/PrettyPrinter.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/PrettyPrinter.java
@@ -410,7 +410,7 @@ public void performActionOnDLEmbeddedExpression(DLEmbeddedExpression x) {
layouter.print("\\dl_" + x.getFunctionSymbol().name());
layouter.print("(");
- for (int i = 0; i < x.getSyntaxChildCount(); i++) {
+ for (int i = 0; i < x.getChildCount(); i++) {
if (i != 0) {
layouter.print(",").brk();
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java
index 1f0aebea363..b8fcfbee6b9 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/TacletIndex.java
@@ -314,7 +314,7 @@ private ImmutableList getJavaTacletList(
if (pe instanceof ProgramPrefix) {
int next = prefixOccurrences.occurred(pe);
NonTerminalProgramElement nt = (NonTerminalProgramElement) pe;
- if (next < nt.getSyntaxChildCount()) {
+ if (next < nt.getChildCount()) {
return getJavaTacletList(map, nt.getChildAt(next), prefixOccurrences);
}
} else {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/LoopInvariantBuiltInRuleApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/LoopInvariantBuiltInRuleApp.java
index bfd4ff80c55..88f44e40120 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/LoopInvariantBuiltInRuleApp.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/LoopInvariantBuiltInRuleApp.java
@@ -93,7 +93,7 @@ private LoopSpecification instantiateIndexValues(LoopSpecification rawInv,
// try to retrieve a loop index variable
de.uka.ilkd.key.java.statement.IGuard guard = loop.getGuard();
// the guard is expected to be of the form "i < x" and we want to retrieve "i".
- assert guard.getSyntaxChildCount() == 1 : "child count: " + guard.getSyntaxChildCount();
+ assert guard.getChildCount() == 1 : "child count: " + guard.getChildCount();
ProgramElement guardStatement = guard.getChildAt(0);
skipIndex = !(guardStatement instanceof LessThan);
Expression loopIndex =
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/conditions/StoreStmtInCondition.java b/key.core/src/main/java/de/uka/ilkd/key/rule/conditions/StoreStmtInCondition.java
index ca3e68b6a44..74f87909a8f 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/conditions/StoreStmtInCondition.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/conditions/StoreStmtInCondition.java
@@ -55,7 +55,7 @@ public MatchConditions check(SchemaVariable sv, SVSubstitute instCandidate,
assert !instantiatedTerm.javaBlock().isEmpty();
assert instantiatedTerm.javaBlock().program() instanceof StatementBlock;
- assert ((StatementBlock) instantiatedTerm.javaBlock().program()).getSyntaxChildCount() == 1;
+ assert ((StatementBlock) instantiatedTerm.javaBlock().program()).getChildCount() == 1;
return matchCond.setInstantiations(//
svInst.add(storeInSV,
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/label/OriginTermLabelRefactoring.java b/key.core/src/main/java/de/uka/ilkd/key/rule/label/OriginTermLabelRefactoring.java
index 3fc16ba6428..9b964549cfb 100755
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/label/OriginTermLabelRefactoring.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/label/OriginTermLabelRefactoring.java
@@ -129,8 +129,8 @@ private Set collectSubtermOrigins(Term term, Set result) {
TermLabel label = term.getLabel(OriginTermLabel.NAME);
if (label != null) {
- result.add((Origin) label.getChild(0));
- result.addAll((Set) label.getChild(1));
+ result.add((Origin) label.getTLChild(0));
+ result.addAll((Set) label.getTLChild(1));
}
ImmutableArray subterms = term.subs();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ProgramTransformer.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ProgramTransformer.java
index fd5edcccdb6..0b7e5d2716e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ProgramTransformer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/ProgramTransformer.java
@@ -134,7 +134,7 @@ public Statement getStatementAt(int index) {
*
* @return an int giving the number of children of this node
*/
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 1;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/WhileLoopTransformation.java b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/WhileLoopTransformation.java
index a11be238695..14bc6a66ec1 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/WhileLoopTransformation.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/metaconstruct/WhileLoopTransformation.java
@@ -718,11 +718,11 @@ public void performActionOnMethodFrame(MethodFrame x) {
ExtList changeList = stack.peek();
if (!changeList.isEmpty() && changeList.getFirst() == CHANGED) {
changeList.removeFirst();
- if (x.getSyntaxChildCount() == 3) {
+ if (x.getChildCount() == 3) {
addChild(KeYJavaASTFactory.methodFrame((IProgramVariable) changeList.get(0),
(IExecutionContext) changeList.get(1), (StatementBlock) changeList.get(2),
PositionInfo.UNDEFINED));
- } else if (x.getSyntaxChildCount() == 2) {
+ } else if (x.getChildCount() == 2) {
addChild(KeYJavaASTFactory.methodFrame((IExecutionContext) changeList.get(0),
(StatementBlock) changeList.get(1), PositionInfo.UNDEFINED));
} else {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLSpecExtractor.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLSpecExtractor.java
index 00be8ef33e4..15fba88cfc9 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLSpecExtractor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/JMLSpecExtractor.java
@@ -281,7 +281,7 @@ public ImmutableSet extractClassSpecs(KeYJavaType kjt)
}
// iterate over all children
- for (int i = 0, n = td.getSyntaxChildCount(); i <= n; i++) {
+ for (int i = 0, n = td.getChildCount(); i <= n; i++) {
// collect comments
// (last position are comments of type declaration itself)
Comment[] comments = null;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/Metavariable.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/Metavariable.java
index 76edd2ab297..44fb3a27177 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/Metavariable.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/quantifierHeuristics/Metavariable.java
@@ -8,11 +8,12 @@
import org.key_project.logic.Name;
import org.key_project.logic.ParsableVariable;
+import org.key_project.logic.TerminalSyntaxElement;
import org.key_project.logic.sort.Sort;
@Deprecated
public final class Metavariable extends AbstractSortedOperator
- implements ParsableVariable, Comparable {
+ implements ParsableVariable, Comparable, TerminalSyntaxElement {
// Used to define an alternative order of all existing
// metavariables
diff --git a/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/SuperTermGenerator.java b/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/SuperTermGenerator.java
index c3a3b2599d0..201090e5703 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/SuperTermGenerator.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/strategy/termgenerator/SuperTermGenerator.java
@@ -19,6 +19,7 @@
import org.key_project.logic.Name;
import org.key_project.logic.TermCreationException;
+import org.key_project.logic.TerminalSyntaxElement;
import org.key_project.logic.op.Modifier;
import org.key_project.logic.op.SortedOperator;
import org.key_project.logic.sort.Sort;
@@ -95,7 +96,7 @@ protected Term generateOneTerm(Term superterm, int child) {
return services.getTermBuilder().tf().createTerm(binFunc, superterm, index);
}
- private static class SuperTermGeneratedOp implements SortedOperator, Operator {
+ private static class SuperTermGeneratedOp implements SortedOperator, Operator, TerminalSyntaxElement {
private final Name NAME;
private final IntegerLDT numbers;
diff --git a/key.core/src/test/java/de/uka/ilkd/key/java/TestContextStatementBlock.java b/key.core/src/test/java/de/uka/ilkd/key/java/TestContextStatementBlock.java
index 68cd906b2d0..b7f699eeff2 100644
--- a/key.core/src/test/java/de/uka/ilkd/key/java/TestContextStatementBlock.java
+++ b/key.core/src/test/java/de/uka/ilkd/key/java/TestContextStatementBlock.java
@@ -43,7 +43,7 @@ public void tearDown() {
public void testContextTermInstantiation() {
ExtList statementList = new ExtList();
StatementBlock stContainer = (StatementBlock) blockOne.program();
- int size = stContainer.getSyntaxChildCount();
+ int size = stContainer.getChildCount();
assertEquals(3, size, "Wrong size. Should have only 3 children");
PosInProgram prefixEnd = PosInProgram.TOP.down(0);
assertTrue(
diff --git a/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermLabelManager.java b/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermLabelManager.java
index 517a5a78a8c..8599f8d81d3 100644
--- a/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermLabelManager.java
+++ b/key.core/src/test/java/de/uka/ilkd/key/logic/TestTermLabelManager.java
@@ -557,18 +557,18 @@ public void testParseLabel() throws TermLabelException {
TermLabel label = manager.parseLabel("ONE", null, services);
assertTrue(label instanceof LoggingTermLabel);
assertEquals("ONE", label.name().toString());
- assertEquals(0, label.getChildCount());
+ assertEquals(0, label.getTLChildCount());
// Test empty parameter
label = manager.parseLabel("TWO", null, services);
assertTrue(label instanceof LoggingTermLabel);
assertEquals("TWO", label.name().toString());
- assertEquals(0, label.getChildCount());
+ assertEquals(0, label.getTLChildCount());
// Test with parameter
label = manager.parseLabel("THREE", Collections.singletonList("Param"), services);
assertTrue(label instanceof LoggingTermLabel);
assertEquals("THREE", label.name().toString());
- assertEquals(1, label.getChildCount());
- assertEquals("Param", label.getChild(0));
+ assertEquals(1, label.getTLChildCount());
+ assertEquals("Param", label.getTLChild(0));
// Test unsupported
try {
manager.parseLabel("UNKNOWN", null, services);
@@ -850,12 +850,12 @@ public Name name() {
}
@Override
- public Object getChild(int i) {
+ public Object getTLChild(int i) {
return arguments.get(i);
}
@Override
- public int getChildCount() {
+ public int getTLChildCount() {
return arguments != null ? arguments.size() : 0;
}
}
diff --git a/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java b/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
index 2439237ae9e..a0e61d60102 100644
--- a/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
+++ b/key.ncore/src/main/java/org/key_project/logic/SyntaxElement.java
@@ -21,5 +21,5 @@ public interface SyntaxElement {
*
* @return the number of children of this syntax element.
*/
- int getSyntaxChildCount();
+ int getChildCount();
}
diff --git a/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
index b6b20313bbe..cc4892122b3 100644
--- a/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
+++ b/key.ncore/src/main/java/org/key_project/logic/SyntaxElementCursor.java
@@ -22,7 +22,7 @@ public SyntaxElement getCurrentNode() {
}
public boolean gotoFirstChild() {
- if (node.getSyntaxChildCount() <= 0)
+ if (node.getChildCount() <= 0)
return false;
path.push(new ParentAndPosition(node, 0));
node = node.getChild(0);
@@ -35,7 +35,7 @@ public boolean gotoNextSibling() {
var pnp = path.pop();
SyntaxElement parent = pnp.parent;
int index = pnp.index + 1;
- if (index > parent.getSyntaxChildCount()) {
+ if (index > parent.getChildCount()) {
return false;
}
path.push(new ParentAndPosition(parent, index));
diff --git a/key.ncore/src/main/java/org/key_project/logic/Term.java b/key.ncore/src/main/java/org/key_project/logic/Term.java
index a66d82ecc52..5dc16e0ea29 100644
--- a/key.ncore/src/main/java/org/key_project/logic/Term.java
+++ b/key.ncore/src/main/java/org/key_project/logic/Term.java
@@ -93,7 +93,7 @@ public interface Term extends LogicElement, Sorted {
void execPreOrder(Visitor visitor);
@Override
- default int getSyntaxChildCount() {
+ default int getChildCount() {
return 1 + boundVars().size() + subs().size();
}
@@ -108,6 +108,6 @@ default SyntaxElement getChild(int n) {
if (n < subs().size())
return sub(n);
throw new IndexOutOfBoundsException(
- "Term " + this + " has only " + getSyntaxChildCount() + " children");
+ "Term " + this + " has only " + getChildCount() + " children");
}
}
diff --git a/key.ncore/src/main/java/org/key_project/logic/TerminalSyntaxElement.java b/key.ncore/src/main/java/org/key_project/logic/TerminalSyntaxElement.java
new file mode 100644
index 00000000000..e6d25f7ae00
--- /dev/null
+++ b/key.ncore/src/main/java/org/key_project/logic/TerminalSyntaxElement.java
@@ -0,0 +1,13 @@
+package org.key_project.logic;
+
+public interface TerminalSyntaxElement extends SyntaxElement{
+ @Override
+ default SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException(this.getClass() + " " + this + " has no children");
+ }
+
+ @Override
+ default int getChildCount() {
+ return 0;
+ }
+}
diff --git a/key.ncore/src/main/java/org/key_project/logic/op/Function.java b/key.ncore/src/main/java/org/key_project/logic/op/Function.java
index 1f638f9efd8..ec55b5dcd44 100644
--- a/key.ncore/src/main/java/org/key_project/logic/op/Function.java
+++ b/key.ncore/src/main/java/org/key_project/logic/op/Function.java
@@ -54,7 +54,7 @@ public final String toString() {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.ncore/src/main/java/org/key_project/logic/op/Modality.java b/key.ncore/src/main/java/org/key_project/logic/op/Modality.java
index 4a6c01643e3..9df6dccc9bd 100644
--- a/key.ncore/src/main/java/org/key_project/logic/op/Modality.java
+++ b/key.ncore/src/main/java/org/key_project/logic/op/Modality.java
@@ -43,7 +43,7 @@ public final K kind() {
public abstract Program program();
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 2;
}
@@ -92,7 +92,7 @@ public int hashCode() {
}
@Override
- public int getSyntaxChildCount() {
+ public int getChildCount() {
return 0;
}
diff --git a/key.ui/src/main/java/de/uka/ilkd/key/gui/sourceview/SourceView.java b/key.ui/src/main/java/de/uka/ilkd/key/gui/sourceview/SourceView.java
index 0de19c95623..1ee7b710b81 100644
--- a/key.ui/src/main/java/de/uka/ilkd/key/gui/sourceview/SourceView.java
+++ b/key.ui/src/main/java/de/uka/ilkd/key/gui/sourceview/SourceView.java
@@ -815,7 +815,7 @@ private static PositionInfo joinPositionsRec(SourceElement se) {
PositionInfo pos = se.getPositionInfo();
- for (int i = 0; i < ntpe.getSyntaxChildCount(); i++) {
+ for (int i = 0; i < ntpe.getChildCount(); i++) {
ProgramElement pe2 = ntpe.getChildAt(i);
pos = PositionInfo.join(pos, joinPositionsRec(pe2));
}
From 1bb54fc29654174f1d0e4d80621ac9b403b634f0 Mon Sep 17 00:00:00 2001
From: Drodt
Date: Wed, 22 May 2024 10:47:36 +0200
Subject: [PATCH 06/15] Clean up inheritance
---
.../key/java/JavaNonTerminalProgramElement.java | 5 -----
.../key/java/NonTerminalProgramElement.java | 6 ++++++
.../ilkd/key/java/TerminalProgramElement.java | 11 ++---------
.../uka/ilkd/key/java/declaration/Modifier.java | 13 ++++++++++++-
.../key/java/declaration/modifier/Static.java | 1 +
.../ilkd/key/java/statement/IForUpdates.java | 2 +-
.../uka/ilkd/key/java/statement/ILoopInit.java | 3 ++-
.../de/uka/ilkd/key/logic/op/ProgramSV.java | 6 +++---
.../de/uka/ilkd/key/logic/op/Qualifier.java | 13 ++-----------
.../java/org/key_project/logic/op/Modality.java | 17 ++---------------
10 files changed, 31 insertions(+), 46 deletions(-)
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/JavaNonTerminalProgramElement.java b/key.core/src/main/java/de/uka/ilkd/key/java/JavaNonTerminalProgramElement.java
index 8a1b4c0cf82..4f1dfdb2ff2 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/JavaNonTerminalProgramElement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/JavaNonTerminalProgramElement.java
@@ -164,9 +164,4 @@ protected MatchConditions matchChildren(SourceData source, MatchConditions match
return matchCond;
}
-
- @Override
- public SyntaxElement getChild(int n) {
- return getChildAt(n);
- }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/NonTerminalProgramElement.java b/key.core/src/main/java/de/uka/ilkd/key/java/NonTerminalProgramElement.java
index ca20a719d4d..1865f6e964c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/NonTerminalProgramElement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/NonTerminalProgramElement.java
@@ -3,6 +3,8 @@
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.java;
+import org.key_project.logic.SyntaxElement;
+
/**
* Non terminal program element. taken from COMPOST and changed to achieve an immutable structure
*/
@@ -25,4 +27,8 @@ public interface NonTerminalProgramElement extends ProgramElement {
*/
ProgramElement getChildAt(int index);
+ @Override
+ default SyntaxElement getChild(int n) {
+ return getChildAt(n);
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/TerminalProgramElement.java b/key.core/src/main/java/de/uka/ilkd/key/java/TerminalProgramElement.java
index 653187dc473..d240ddafb2e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/TerminalProgramElement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/TerminalProgramElement.java
@@ -4,19 +4,12 @@
package de.uka.ilkd.key.java;
import org.key_project.logic.SyntaxElement;
+import org.key_project.logic.TerminalSyntaxElement;
/**
* Terminal program element. taken from COMPOST and changed to achieve an immutable structure
*/
-public interface TerminalProgramElement extends ProgramElement {
- @Override
- default int getChildCount() {
- return 0;
- }
+public interface TerminalProgramElement extends ProgramElement, TerminalSyntaxElement {
- @Override
- default SyntaxElement getChild(int n) {
- throw new IndexOutOfBoundsException("Program element " + this + " has no children");
- }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/Modifier.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/Modifier.java
index 357d417d3ca..c6533ebfe38 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/Modifier.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/Modifier.java
@@ -7,13 +7,14 @@
import de.uka.ilkd.key.java.TerminalProgramElement;
import de.uka.ilkd.key.java.visitor.Visitor;
+import org.key_project.logic.SyntaxElement;
import org.key_project.util.ExtList;
/**
* Modifier. taken from COMPOST and changed to achieve an immutable structure
*/
-public abstract class Modifier extends JavaProgramElement implements TerminalProgramElement {
+public abstract class Modifier extends JavaProgramElement {
/**
* Modifier.
@@ -56,4 +57,14 @@ public String getText() {
public void visit(Visitor v) {
v.performActionOnModifier(this);
}
+
+ @Override
+ public int getChildCount() {
+ return 0;
+ }
+
+ @Override
+ public SyntaxElement getChild(int n) {
+ throw new IndexOutOfBoundsException(getClass() + " " + this + " has no children");
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/modifier/Static.java b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/modifier/Static.java
index 6efc4cf1f20..f99f1494181 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/declaration/modifier/Static.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/declaration/modifier/Static.java
@@ -5,6 +5,7 @@
import de.uka.ilkd.key.java.declaration.Modifier;
+import org.key_project.logic.TerminalSyntaxElement;
import org.key_project.util.ExtList;
/**
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/IForUpdates.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/IForUpdates.java
index a532522aa5e..75d499d1cdf 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/IForUpdates.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/IForUpdates.java
@@ -7,7 +7,7 @@
import org.key_project.util.collection.ImmutableArray;
-public interface IForUpdates extends de.uka.ilkd.key.java.TerminalProgramElement {
+public interface IForUpdates extends de.uka.ilkd.key.java.NonTerminalProgramElement {
int size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/java/statement/ILoopInit.java b/key.core/src/main/java/de/uka/ilkd/key/java/statement/ILoopInit.java
index c8528112d4d..362b5b85e4a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/java/statement/ILoopInit.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/java/statement/ILoopInit.java
@@ -4,11 +4,12 @@
package de.uka.ilkd.key.java.statement;
import de.uka.ilkd.key.java.LoopInitializer;
+import de.uka.ilkd.key.java.NonTerminalProgramElement;
import de.uka.ilkd.key.java.TerminalProgramElement;
import org.key_project.util.collection.ImmutableArray;
-public interface ILoopInit extends TerminalProgramElement {
+public interface ILoopInit extends NonTerminalProgramElement {
int size();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
index 8a0406ee4b6..efd705956fc 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/ProgramSV.java
@@ -34,7 +34,7 @@
* Objects of this class are schema variables matching program constructs within modal operators.
* The particular construct being matched is determined by the ProgramSVSort of the schema variable.
*/
-public final class ProgramSV extends OperatorSV implements ProgramConstruct, UpdateableOperator , TerminalSyntaxElement {
+public final class ProgramSV extends OperatorSV implements ProgramConstruct, UpdateableOperator , SyntaxElement {
public static final Logger LOGGER = LoggerFactory.getLogger(ProgramSV.class);
private static final ProgramList EMPTY_LIST_INSTANTIATION =
@@ -150,12 +150,12 @@ public ProgramElement getChildAt(int index) {
@Override
public SyntaxElement getChild(int n) {
- return TerminalSyntaxElement.super.getChild(n);
+ throw new IndexOutOfBoundsException("ProgramSV " + this + " has no children");
}
@Override
public int getChildCount() {
- return TerminalSyntaxElement.super.getChildCount();
+ return 0;
}
@Override
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
index ad978c0b346..ed06827732d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/op/Qualifier.java
@@ -6,8 +6,9 @@
import java.util.WeakHashMap;
import org.key_project.logic.SyntaxElement;
+import org.key_project.logic.TerminalSyntaxElement;
-public class Qualifier implements SyntaxElement {
+public class Qualifier implements TerminalSyntaxElement {
private final T qualifier;
private static final WeakHashMap
*
- * The original {@link SequentFormula} which contains the equality is always removed in the
+ * The original {@link Term} which contains the equality is always removed in the
* following {@link Goal}. How the result of the query computed in the side proof is represented
* depends on the occurrence of the equality:
*
*
top level {@code = } or {@code = }
- * For each possible result value is a {@link SequentFormula} added to the {@link Sequent} of the
+ * For each possible result value is a {@link Term} added to the {@link Sequent} of the
* form:
*
*
Antecedent: {@code -> = } or
@@ -62,7 +61,7 @@
*
right side of an implication on top level
* {@code -> = } or
* {@code -> = }
- * For each possible result value is a {@link SequentFormula} added to the {@link Sequent} of the
+ * For each possible result value is a {@link Term} added to the {@link Sequent} of the
* form:
*
*
Antecedent: {@code
@@ -93,9 +92,9 @@
*
*
everywhere else {@code ...( = )...} or
* {@code ...( = )...}
- * In the original {@link SequentFormula} is the {@code } replaced by a new constant function
+ * In the original {@link Term} is the {@code } replaced by a new constant function
* named {@code QueryResult} and added to the antecedent/succedent in which it was contained before.
- * For each possible result value is an additional {@link SequentFormula} added to the
+ * For each possible result value is an additional {@link Term} added to the
* antecedent of the form:
*
*
{@code -> QueryResult = } or
@@ -196,7 +195,7 @@ public IBuiltInRuleApp createApp(PosInOccurrence pos, TermServices services) {
// Extract required Terms from goal
PosInOccurrence pio = ruleApp.posInOccurrence();
Sequent goalSequent = goal.sequent();
- SequentFormula equalitySF = pio.sequentFormula();
+ Term equalitySF = pio.sequentLevelFormula();
Term equalityTerm = pio.subTerm();
Term queryTerm;
Term varTerm;
@@ -211,9 +210,10 @@ public IBuiltInRuleApp createApp(PosInOccurrence pos, TermServices services) {
varFirst = false;
}
Term queryConditionTerm = null;
- if (equalitySF.formula().op() == Junctor.IMP
- && equalitySF.formula().sub(1) == equalityTerm) {
- queryConditionTerm = equalitySF.formula().sub(0);
+ if (equalitySF.op() == Junctor.IMP) {
+ if (equalitySF.sub(1) == equalityTerm) {
+ queryConditionTerm = equalitySF.sub(0);
+ }
}
// Compute sequent for side proof to compute query in.
// New OneStepSimplifier is required because it has an internal state and the default
@@ -226,7 +226,7 @@ public IBuiltInRuleApp createApp(PosInOccurrence pos, TermServices services) {
JFunction newPredicate = createResultFunction(sideProofServices, queryTerm.sort());
Term newTerm = sideProofServices.getTermBuilder().func(newPredicate, queryTerm);
sequentToProve =
- sequentToProve.addFormula(new SequentFormula(newTerm), false, false).sequent();
+ sequentToProve.addFormula(newTerm, false, false).sequent();
// Compute results and their conditions
List, Node>> conditionsAndResultsMap =
computeResultsAndConditions(services, goal, sideProofEnv, sequentToProve,
@@ -246,7 +246,7 @@ public IBuiltInRuleApp createApp(PosInOccurrence pos, TermServices services) {
if (queryConditionTerm != null) {
resultTerm = tb.imp(queryConditionTerm, resultTerm);
}
- resultGoal.addFormula(new SequentFormula(resultTerm), pio.isInAntec(), false);
+ resultGoal.addFormula(resultTerm, pio.isInAntec(), false);
}
} else {
JFunction resultFunction = createResultConstant(services, varTerm.sort());
@@ -261,7 +261,7 @@ public IBuiltInRuleApp createApp(PosInOccurrence pos, TermServices services) {
Term resultTerm = tb.imp(conditionTerm,
varFirst ? tb.equals(resultFunctionTerm, conditionsAndResult.first)
: tb.equals(conditionsAndResult.first, resultFunctionTerm));
- resultGoal.addFormula(new SequentFormula(resultTerm), true, false);
+ resultGoal.addFormula(resultTerm, true, false);
}
}
return goals;
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java
index 56ead50dddb..d875fafffd6 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/slicing/AbstractSlicer.java
@@ -69,7 +69,7 @@ public ImmutableArray slice(Node seedNode, ReferencePrefix seedLocation,
ImmutableList sec) throws ProofInputException {
// Solve this reference
PosInOccurrence pio = seedNode.getAppliedRuleApp().posInOccurrence();
- Term topLevel = pio.sequentFormula().formula();
+ Term topLevel = pio.sequentLevelFormula();
Term modalityTerm = TermBuilder.goBelowUpdates(topLevel);
Services services = seedNode.proof().getServices();
ExecutionContext ec =
@@ -209,7 +209,7 @@ public ReferencePrefix getThisReference() {
*/
protected SequentInfo analyzeSequent(Node node, ImmutableList sec) {
PosInOccurrence pio = node.getAppliedRuleApp().posInOccurrence();
- Term topLevel = pio.sequentFormula().formula();
+ Term topLevel = pio.sequentLevelFormula();
Pair, Term> pair = TermBuilder.goBelowUpdates2(topLevel);
Term modalityTerm = pair.second;
SymbolicExecutionTermLabel label =
@@ -283,14 +283,14 @@ protected void analyzeEquivalenceClasses(Services services,
*/
protected void analyzeSequent(Services services, Sequent sequent,
Map> aliases, ReferencePrefix thisReference) {
- for (SequentFormula sf : sequent.antecedent()) {
- Term term = sf.formula();
+ for (Term sf : sequent.antecedent()) {
+ Term term = sf;
if (Equality.EQUALS == term.op()) {
analyzeEquality(services, term, aliases, thisReference);
}
}
- for (SequentFormula sf : sequent.succedent()) {
- Term term = sf.formula();
+ for (Term sf : sequent.succedent()) {
+ Term term = sf;
if (Junctor.NOT == term.op()) {
Term negatedTerm = term.sub(0);
if (Equality.EQUALS == negatedTerm.op()) {
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/CutHeapObjectsFeature.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/CutHeapObjectsFeature.java
index b82c837cd0c..20904e34173 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/CutHeapObjectsFeature.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/CutHeapObjectsFeature.java
@@ -7,7 +7,6 @@
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.Equality;
import de.uka.ilkd.key.logic.op.Junctor;
@@ -27,7 +26,7 @@
*
* This means the cut is only applied if the cut formula is not an equality or if it is not a
* negated formula or if the (negated) equality is not contained as top term
- * ({@link SequentFormula}) in the {@link Sequent} ignoring the order of the equality children.
+ * ({@link Term}) in the {@link Sequent} ignoring the order of the equality children.
*
*
* @author Martin Hentschel
@@ -49,9 +48,9 @@ protected boolean filter(RuleApp app, PosInOccurrence pos, Goal goal, MutableSta
Term cutFormulaC0 = cutFormula.sub(0);
Term cutFormulaC1 = cutFormula.sub(1);
boolean contains = false;
- Iterator iter = goal.sequent().iterator();
+ Iterator iter = goal.sequent().iterator();
while (!contains && iter.hasNext()) {
- Term formula = iter.next().formula();
+ Term formula = iter.next();
if (formula.op() == Junctor.NOT) {
formula = formula.sub(0);
}
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/CutHeapObjectsTermGenerator.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/CutHeapObjectsTermGenerator.java
index db00d1469bf..b06a9f7f4a8 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/CutHeapObjectsTermGenerator.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/CutHeapObjectsTermGenerator.java
@@ -12,7 +12,6 @@
import de.uka.ilkd.key.logic.DefaultVisitor;
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.JFunction;
import de.uka.ilkd.key.proof.Goal;
@@ -38,13 +37,13 @@ public Iterator generate(RuleApp app, PosInOccurrence pos, Goal goal,
// Compute collect terms of sequent formulas
Sequent sequent = goal.sequent();
Set topTerms = new LinkedHashSet<>();
- for (SequentFormula sf : sequent) {
- topTerms.add(sf.formula());
+ for (Term sf : sequent) {
+ topTerms.add(sf);
}
// Compute equality terms
HeapLDT heapLDT = goal.node().proof().getServices().getTypeConverter().getHeapLDT();
Set equalityTerms = new LinkedHashSet<>();
- for (SequentFormula sf : sequent) {
+ for (Term sf : sequent) {
collectEqualityTerms(sf, equalityTerms, topTerms, heapLDT,
goal.node().proof().getServices());
}
@@ -52,19 +51,19 @@ public Iterator generate(RuleApp app, PosInOccurrence pos, Goal goal,
}
/**
- * Computes all possible equality terms between objects in the given {@link SequentFormula}.
+ * Computes all possible equality terms between objects in the given {@link Term}.
*
- * @param sf The {@link SequentFormula} to work with.
+ * @param sf The {@link Term} to work with.
* @param equalityTerms The result {@link Set} with the equality {@link Term}s to fill.
* @param topTerms The terms of all sequent formulas
* @param heapLDT The {@link HeapLDT} to use.
* @param services TODO
*/
- protected void collectEqualityTerms(SequentFormula sf, Set equalityTerms,
+ protected void collectEqualityTerms(Term sf, Set equalityTerms,
Set topTerms, HeapLDT heapLDT, Services services) {
// Collect objects (target of store operations on heap)
Set storeLocations = new LinkedHashSet<>();
- collectStoreLocations(sf.formula(), storeLocations, heapLDT);
+ collectStoreLocations(sf, storeLocations, heapLDT);
// Check if equality checks are possible
if (storeLocations.size() >= 2) {
// Generate all possible equality checks
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/SimplifyTermStrategy.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/SimplifyTermStrategy.java
index a6594e4e05b..ceeb80aa40f 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/SimplifyTermStrategy.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/strategy/SimplifyTermStrategy.java
@@ -60,7 +60,7 @@ protected Feature setupApprovalF() {
TacletApp ta = (TacletApp) app;
if (ta.ifFormulaInstantiations() != null) {
for (IfFormulaInstantiation ifi : ta.ifFormulaInstantiations()) {
- if (ifi.getConstrainedFormula().formula()
+ if (ifi.getConstrainedFormula()
.containsLabel(SymbolicExecutionUtil.RESULT_LABEL)) {
hasLabel = true;
}
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionSideProofUtil.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionSideProofUtil.java
index 766547c958c..bafc9353346 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionSideProofUtil.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionSideProofUtil.java
@@ -57,24 +57,24 @@ private SymbolicExecutionSideProofUtil() {
/**
* Computes a general {@link Sequent} to prove in a side proof which contains all
- * {@link SequentFormula} of the original {@link Sequent} except the given current
- * {@link SequentFormula} and those which contains modalities and queries.
+ * {@link Term} of the original {@link Sequent} except the given current
+ * {@link Term} and those which contains modalities and queries.
*
* @param goalSequent The original {@link Sequent} of the current {@link Goal}.
- * @param currentSF The {@link SequentFormula} to ignore.
+ * @param currentSF The {@link Term} to ignore.
* @return The general initial {@link Sequent}.
*/
public static Sequent computeGeneralSequentToProve(Sequent goalSequent,
- SequentFormula currentSF) {
+ Term currentSF) {
Sequent sequentToProve = Sequent.EMPTY_SEQUENT;
- for (SequentFormula sf : goalSequent.antecedent()) {
+ for (Term sf : goalSequent.antecedent()) {
if (sf != currentSF) {
if (!containsModalityOrQuery(sf)) {
sequentToProve = sequentToProve.addFormula(sf, true, false).sequent();
}
}
}
- for (SequentFormula sf : goalSequent.succedent()) {
+ for (Term sf : goalSequent.succedent()) {
if (sf != currentSF) {
if (!containsModalityOrQuery(sf)) {
sequentToProve = sequentToProve.addFormula(sf, false, false).sequent();
@@ -121,16 +121,16 @@ public static List> computeResults(Services services, Proof pro
}
Sequent sequent = resultGoal.sequent();
List results = new LinkedList<>();
- for (SequentFormula sf : sequent.antecedent()) {
- if (sf.formula().containsLabel(label)) {
- Term result = sf.formula();
+ for (Term sf : sequent.antecedent()) {
+ if (sf.containsLabel(label)) {
+ Term result = sf;
result = services.getTermBuilder().not(result);
results.add(result);
}
}
- for (SequentFormula sf : sequent.succedent()) {
- if (sf.formula().containsLabel(label)) {
- Term result = sf.formula();
+ for (Term sf : sequent.succedent()) {
+ if (sf.containsLabel(label)) {
+ Term result = sf;
results.add(result);
}
}
@@ -189,12 +189,12 @@ public static List, Node>> computeResultsAndConditions(Se
throw new IllegalStateException("Not all applicable rules are applied.");
}
Sequent sequent = resultGoal.sequent();
- boolean newPredicateIsSequentFormula = isOperatorASequentFormula(sequent, operator);
+ boolean newPredicateIsTerm = isOperatorATerm(sequent, operator);
Set resultConditions = new LinkedHashSet<>();
Term result = null;
- for (SequentFormula sf : sequent.antecedent()) {
- if (newPredicateIsSequentFormula) {
- if (Operator.opEquals(sf.formula().op(), operator)) {
+ for (Term sf : sequent.antecedent()) {
+ if (newPredicateIsTerm) {
+ if (Operator.opEquals(sf.op(), operator)) {
throw new IllegalStateException(
"Result predicate found in antecedent.");
} else {
@@ -208,19 +208,19 @@ public static List, Node>> computeResultsAndConditions(Se
}
if (!isIrrelevantCondition(services, sequentToProve,
relevantThingsInSequentToProve, sf)) {
- if (resultConditions.add(sf.formula()) && addNamesToServices) {
- addNewNamesToNamespace(services, sf.formula());
+ if (resultConditions.add(sf) && addNamesToServices) {
+ addNewNamesToNamespace(services, sf);
}
}
}
- for (SequentFormula sf : sequent.succedent()) {
- if (newPredicateIsSequentFormula) {
- if (Operator.opEquals(sf.formula().op(), operator)) {
+ for (Term sf : sequent.succedent()) {
+ if (newPredicateIsTerm) {
+ if (Operator.opEquals(sf.op(), operator)) {
if (result != null) {
throw new IllegalStateException(
"Result predicate found multiple times in succedent.");
}
- result = sf.formula().sub(0);
+ result = sf.sub(0);
}
} else {
Term constructedResult = constructResultIfContained(services, sf, operator);
@@ -235,9 +235,9 @@ public static List, Node>> computeResultsAndConditions(Se
if (result == null) {
if (!isIrrelevantCondition(services, sequentToProve,
relevantThingsInSequentToProve, sf)) {
- if (resultConditions.add(services.getTermBuilder().not(sf.formula()))
+ if (resultConditions.add(services.getTermBuilder().not(sf))
&& addNamesToServices) {
- addNewNamesToNamespace(services, sf.formula());
+ addNewNamesToNamespace(services, sf);
}
}
}
@@ -254,11 +254,6 @@ public static List, Node>> computeResultsAndConditions(Se
}
}
- private static Term constructResultIfContained(Services services, SequentFormula sf,
- Operator operator) {
- return constructResultIfContained(services, sf.formula(), operator);
- }
-
private static Term constructResultIfContained(Services services, Term term,
Operator operator) {
if (Operator.opEquals(term.op(), operator)) {
@@ -287,9 +282,11 @@ private static Term constructResultIfContained(Services services, Term term,
}
}
- private static boolean isOperatorASequentFormula(Sequent sequent, final Operator operator) {
+ private static boolean isOperatorATerm(Sequent sequent, final Operator operator) {
return CollectionUtil.search(sequent,
- element -> Operator.opEquals(element.formula().op(), operator)) != null;
+ element -> {
+ return Operator.opEquals(element.op(), operator);
+ }) != null;
}
/**
@@ -315,17 +312,6 @@ public void visit(Term visited) {
});
}
- /**
- * Checks if the given {@link SequentFormula} contains a modality or query.
- *
- * @param sf The {@link SequentFormula} to check.
- * @return {@code true} contains at least one modality or query, {@code false} contains no
- * modalities and no queries.
- */
- public static boolean containsModalityOrQuery(SequentFormula sf) {
- return containsModalityOrQuery(sf.formula());
- }
-
/**
* Checks if the given {@link Term} contains a modality or query.
*
@@ -384,8 +370,8 @@ public boolean isContainsModalityOrQuery() {
public static Set extractRelevantThings(final Services services,
Sequent sequentToProve) {
final Set result = new HashSet<>();
- for (SequentFormula sf : sequentToProve) {
- sf.formula().execPreOrder(new DefaultVisitor() {
+ for (Term sf : sequentToProve) {
+ sf.execPreOrder(new DefaultVisitor() {
@Override
public void visit(Term visited) {
if (isRelevantThing(services, visited)) {
@@ -426,29 +412,29 @@ private static boolean isRelevantThing(Services services, Term term) {
}
/**
- * Checks if the given {@link SequentFormula} is a relevant condition.
+ * Checks if the given {@link Term} is a relevant condition.
*
* @param services The {@link Services} to use.
* @param initialSequent The initial {@link Sequent} of the side proof.
* @param relevantThingsInSequentToProve The relevant things found in the initial
* {@link Sequent}.
- * @param sf The {@link SequentFormula} to check.
- * @return {@code true} {@link SequentFormula} is relevant condition, {@code false}
- * {@link SequentFormula} is not a relevant condition.
+ * @param sf The {@link Term} to check.
+ * @return {@code true} {@link Term} is relevant condition, {@code false}
+ * {@link Term} is not a relevant condition.
*/
public static boolean isIrrelevantCondition(Services services, Sequent initialSequent,
- Set relevantThingsInSequentToProve, SequentFormula sf) {
+ Set relevantThingsInSequentToProve, Term sf) {
return initialSequent.antecedent().contains(sf) || initialSequent.succedent().contains(sf)
|| containsModalityOrQuery(sf) // isInOrOfAntecedent(initialSequent, sf) ||
|| containsIrrelevantThings(services, sf, relevantThingsInSequentToProve);
}
- // public static boolean isInOrOfAntecedent(Sequent initialSequent, SequentFormula sf) {
+ // public static boolean isInOrOfAntecedent(Sequent initialSequent, Term sf) {
// Term term = sf.formula();
// boolean result = false;
- // Iterator iter = initialSequent.antecedent().iterator();
+ // Iterator iter = initialSequent.antecedent().iterator();
// while (!result && iter.hasNext()) {
- // SequentFormula next = iter.next();
+ // Term next = iter.next();
// if (isInOr(next.formula(), term)) {
// result = true;
// }
@@ -471,26 +457,26 @@ public static boolean isIrrelevantCondition(Services services, Sequent initialSe
// }
/**
- * Checks if the given {@link SequentFormula} contains irrelevant things (things which are not
+ * Checks if the given {@link Term} contains irrelevant things (things which are not
* contained in the relevantThingsToProve and are no Java types)
*
* @param services The {@link Services} to use.
- * @param sf The {@link SequentFormula} to check.
+ * @param sf The {@link Term} to check.
* @param relevantThings The relevant things.
- * @return {@code true} The {@link SequentFormula} contains irrelevant things, {@code false} the
- * {@link SequentFormula} contains no irrelevant things.
+ * @return {@code true} The {@link Term} contains irrelevant things, {@code false} the
+ * {@link Term} contains no irrelevant things.
*/
- public static boolean containsIrrelevantThings(Services services, SequentFormula sf,
+ public static boolean containsIrrelevantThings(Services services, Term sf,
Set relevantThings) {
ContainsIrrelevantThingsVisitor visitor =
new ContainsIrrelevantThingsVisitor(services, relevantThings);
- sf.formula().execPostOrder(visitor);
+ sf.execPostOrder(visitor);
return visitor.isContainsIrrelevantThings();
}
/**
* Utility class used by
- * {@link #containsIrrelevantThings(Services, SequentFormula, Set)}.
+ * {@link #containsIrrelevantThings(Services, Term, Set)}.
*
* @author Martin Hentschel
*/
@@ -540,8 +526,8 @@ public void visit(Term visited) {
/**
* Returns the result.
*
- * @return The {@link SequentFormula} contains irrelevant things, {@code false} the
- * {@link SequentFormula} contains no irrelevant things.
+ * @return The {@link Term} contains irrelevant things, {@code false} the
+ * {@link Term} contains no irrelevant things.
*/
public boolean isContainsIrrelevantThings() {
return containsIrrelevantThings;
@@ -699,13 +685,13 @@ public static Term extractOperatorTerm(Goal goal, final Operator operator) {
public static Term extractOperatorTerm(Node node, final Operator operator) {
assert node != null;
// Search formula with the given operator in sequent (or in some cases below the updates)
- SequentFormula sf = CollectionUtil.search(node.sequent(), element -> {
- Term term = element.formula();
+ Term sf = CollectionUtil.search(node.sequent(), element -> {
+ Term term = element;
term = TermBuilder.goBelowUpdates(term);
return Objects.equals(term.op(), operator);
});
if (sf != null) {
- Term term = sf.formula();
+ Term term = sf;
term = TermBuilder.goBelowUpdates(term);
return term;
} else {
diff --git a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java
index 785b03e3d80..55e8831a48c 100644
--- a/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java
+++ b/key.core.symbolic_execution/src/main/java/de/uka/ilkd/key/symbolic_execution/util/SymbolicExecutionUtil.java
@@ -189,7 +189,7 @@ public static Term simplify(InitConfig initConfig, Proof parentProof, Term term)
.cloneProofEnvironmentWithOwnOneStepSimplifier(initConfig, true);
// Create Sequent to prove
Sequent sequentToProve =
- Sequent.EMPTY_SEQUENT.addFormula(new SequentFormula(term), false, true).sequent();
+ Sequent.EMPTY_SEQUENT.addFormula(term, false, true).sequent();
// Return created Sequent and the used predicate to identify the value interested in.
ApplyStrategyInfo info = SymbolicExecutionSideProofUtil.startSideProof(parentProof,
sideProofEnv, sequentToProve);
@@ -245,8 +245,8 @@ public static Term sequentToImplication(Sequent sequent, Services services) {
public static ImmutableList listSemisequentTerms(Semisequent semisequent) {
ImmutableList terms = ImmutableSLList.nil();
if (semisequent != null) {
- for (SequentFormula sf : semisequent) {
- terms = terms.append(sf.formula());
+ for (Term sf : semisequent) {
+ terms = terms.append(sf);
}
}
return terms;
@@ -487,7 +487,7 @@ public static SiteProofVariableValueInput createExtractReturnVariableValueSequen
Term modalityTerm = services.getTermBuilder().dia(newJavaBlock, newTerm);
// Get the updates from the return node which includes the value interested in.
Term originalModifiedFormula =
- methodReturnNode.getAppliedRuleApp().posInOccurrence().sequentFormula().formula();
+ methodReturnNode.getAppliedRuleApp().posInOccurrence().sequentLevelFormula();
ImmutableList originalUpdates =
TermBuilder.goBelowUpdates2(originalModifiedFormula).first;
// Create Sequent to prove with new succedent.
@@ -668,16 +668,16 @@ public static IExecutionConstraint[] createExecutionConstraints(IExecutionNode
List constraints = new LinkedList<>();
Node proofNode = node.getProofNode();
Sequent sequent = proofNode.sequent();
- for (SequentFormula sf : sequent.antecedent()) {
- if (!containsSymbolicExecutionLabel(sf.formula())) {
+ for (Term sf : sequent.antecedent()) {
+ if (!containsSymbolicExecutionLabel(sf)) {
constraints.add(new ExecutionConstraint(node.getSettings(), proofNode,
- node.getModalityPIO(), sf.formula()));
+ node.getModalityPIO(), sf));
}
}
- for (SequentFormula sf : sequent.succedent()) {
- if (!containsSymbolicExecutionLabel(sf.formula())) {
+ for (Term sf : sequent.succedent()) {
+ if (!containsSymbolicExecutionLabel(sf)) {
constraints.add(new ExecutionConstraint(node.getSettings(), proofNode,
- node.getModalityPIO(), tb.not(sf.formula())));
+ node.getModalityPIO(), tb.not(sf)));
}
}
return constraints.toArray(new IExecutionConstraint[0]);
@@ -820,11 +820,11 @@ public static List collectAllElementaryUpdateTerms(Node node)
if (node != null) {
Services services = node.proof().getServices();
List result = new LinkedList<>();
- for (SequentFormula sf : node.sequent().antecedent()) {
- internalCollectAllElementaryUpdateTerms(services, result, sf.formula());
+ for (Term sf : node.sequent().antecedent()) {
+ internalCollectAllElementaryUpdateTerms(services, result, sf);
}
- for (SequentFormula sf : node.sequent().succedent()) {
- internalCollectAllElementaryUpdateTerms(services, result, sf.formula());
+ for (Term sf : node.sequent().succedent()) {
+ internalCollectAllElementaryUpdateTerms(services, result, sf);
}
return result;
} else {
@@ -1339,8 +1339,8 @@ public static PosInOccurrence findModalityWithMaxSymbolicExecutionLabelId(
if (semisequent != null) {
int maxId = Integer.MIN_VALUE;
PosInOccurrence maxPio = null;
- for (SequentFormula sf : semisequent) {
- PosInTerm current = findModalityWithMaxSymbolicExecutionLabelId(sf.formula());
+ for (Term sf : semisequent) {
+ PosInTerm current = findModalityWithMaxSymbolicExecutionLabelId(sf);
if (current != null) {
PosInOccurrence pio = new PosInOccurrence(sf, current, inAntec);
SymbolicExecutionTermLabel label = getSymbolicExecutionLabel(pio.subTerm());
@@ -1424,8 +1424,8 @@ public static PosInOccurrence findModalityWithMinSymbolicExecutionLabelId(
if (semisequent != null) {
int maxId = Integer.MIN_VALUE;
PosInOccurrence minPio = null;
- for (SequentFormula sf : semisequent) {
- PosInTerm current = findModalityWithMinSymbolicExecutionLabelId(sf.formula());
+ for (Term sf : semisequent) {
+ PosInTerm current = findModalityWithMinSymbolicExecutionLabelId(sf);
if (current != null) {
PosInOccurrence pio = new PosInOccurrence(sf, current, inAntec);
SymbolicExecutionTermLabel label = getSymbolicExecutionLabel(pio.subTerm());
@@ -2085,8 +2085,8 @@ else if (rightTerm.op() == Junctor.IMP
public static ContractPostOrExcPostExceptionVariableResult searchContractPostOrExcPostExceptionVariable(
Node node, Services services) throws ProofInputException {
Semisequent antecedent = node.sequent().antecedent();
- SequentFormula sf = antecedent.get(antecedent.size() - 1);
- Term workingTerm = sf.formula();
+ Term sf = antecedent.get(antecedent.size() - 1);
+ Term workingTerm = sf;
Pair, Term> updatesAndTerm = TermBuilder.goBelowUpdates2(workingTerm);
workingTerm = updatesAndTerm.second;
if (workingTerm.op() != Junctor.AND) {
@@ -2257,7 +2257,7 @@ private static Term computeLoopInvariantBuiltInRuleAppBranchCondition(Node paren
Services services = parent.proof().getServices();
Node useNode = parent.child(2);
Semisequent antecedent = useNode.sequent().antecedent();
- Term invTerm = antecedent.get(antecedent.size() - 1).formula();
+ Term invTerm = antecedent.get(antecedent.size() - 1);
// Extract loop condition from child
Term loopConditionModalityTerm =
posInOccurrenceInOtherNode(parent, app.posInOccurrence(), node);
@@ -2371,7 +2371,7 @@ private static Term computeBlockContractBuiltInRuleAppBranchCondition(Node paren
// Compute invariant (last antecedent formula of the use branch)
Services services = parent.proof().getServices();
Semisequent antecedent = node.sequent().antecedent();
- Term condition = antecedent.get(antecedent.size() - 1).formula();
+ Term condition = antecedent.get(antecedent.size() - 1);
if (simplify) {
// New OneStepSimplifier is required because it has an internal state and the
// default instance can't be used parallel.
@@ -2469,7 +2469,7 @@ public static PosInOccurrence posInOccurrenceToOtherSequent(Sequent original,
PosInOccurrence pio, Sequent toApplyTo) {
if (original != null && pio != null && toApplyTo != null) {
// Search index of formula in original sequent
- SequentFormula originalSF = pio.sequentFormula();
+ Term originalSF = pio.sequentLevelFormula();
boolean antecendet = pio.isInAntec();
int index;
if (antecendet) {
@@ -2478,7 +2478,7 @@ public static PosInOccurrence posInOccurrenceToOtherSequent(Sequent original,
index = original.succedent().indexOf(originalSF);
}
if (index >= 0) {
- final SequentFormula toApplyToSF =
+ final Term toApplyToSF =
(antecendet ? toApplyTo.antecedent() : toApplyTo.succedent()).get(index);
return new PosInOccurrence(toApplyToSF, pio.posInTerm(), antecendet);
} else {
@@ -2535,8 +2535,8 @@ private static Term computeTacletAppBranchCondition(Node parent, Node node, bool
// Remove replace part of symbolic execution rules
if (NodeInfo.isSymbolicExecution(app.taclet())) {
Sequent sequent = (Sequent) goalTemplate.replaceWithExpressionAsObject();
- for (SequentFormula sf : sequent.antecedent()) {
- Term replaceTerm = instantiateTerm(node, sf.formula(), app, services);
+ for (Term sf : sequent.antecedent()) {
+ Term replaceTerm = instantiateTerm(node, sf, app, services);
replaceTerm = services.getTermBuilder().applyUpdatePairsSequential(
app.instantiations().getUpdateContext(), replaceTerm);
Term originalTerm = findReplacement(node.sequent().antecedent(),
@@ -2544,8 +2544,8 @@ private static Term computeTacletAppBranchCondition(Node parent, Node node, bool
assert originalTerm != null;
newAntecedents = newAntecedents.removeFirst(originalTerm);
}
- for (SequentFormula sf : sequent.succedent()) {
- Term replaceTerm = instantiateTerm(node, sf.formula(), app, services);
+ for (Term sf : sequent.succedent()) {
+ Term replaceTerm = instantiateTerm(node, sf, app, services);
replaceTerm = services.getTermBuilder().applyUpdatePairsSequential(
app.instantiations().getUpdateContext(), replaceTerm);
Term originalTerm = findReplacement(node.sequent().succedent(),
@@ -2637,7 +2637,7 @@ private static Term computeTacletAppBranchCondition(Node parent, Node node, bool
}
/**
- * Lists the {@link Term}s of all new {@link SequentFormula} in the child {@link Semisequent}.
+ * Lists the {@link Term}s of all new {@link Term} in the child {@link Semisequent}.
*
* @param parent The parent {@link Semisequent}.
* @param child The child {@link Semisequent}.
@@ -2645,14 +2645,14 @@ private static Term computeTacletAppBranchCondition(Node parent, Node node, bool
*/
private static ImmutableList listNewSemisequentTerms(Semisequent parent,
Semisequent child) {
- Set parentSFs = new HashSet<>();
- for (SequentFormula sf : parent) {
+ Set parentSFs = new HashSet<>();
+ for (Term sf : parent) {
parentSFs.add(sf);
}
ImmutableList result = ImmutableSLList.nil();
- for (SequentFormula sf : child) {
+ for (Term sf : child) {
if (!parentSFs.contains(sf)) {
- result = result.append(sf.formula());
+ result = result.append(sf);
}
}
return result;
@@ -2669,9 +2669,15 @@ private static ImmutableList listNewSemisequentTerms(Semisequent parent,
*/
private static Term findReplacement(Semisequent semisequent,
final PosInOccurrence posInOccurrence, final Term replaceTerm) {
- SequentFormula sf = CollectionUtil.search(semisequent,
- element -> checkReplaceTerm(element.formula(), posInOccurrence, replaceTerm));
- return sf != null ? sf.formula() : null;
+ Term sf = CollectionUtil.search(semisequent,
+ element -> {
+ return checkReplaceTerm(element, posInOccurrence, replaceTerm);
+ });
+ if (sf != null) {
+ return sf;
+ } else {
+ return null;
+ }
}
/**
@@ -2931,7 +2937,7 @@ public static Sequent createSequentToProveWithNewSuccedent(Node node, PosInOccur
if (node.proof().root() == node) {
originalUpdates = computeRootElementaryUpdates(node);
} else {
- Term originalModifiedFormula = pio.sequentFormula().formula();
+ Term originalModifiedFormula = pio.sequentLevelFormula();
originalUpdates = TermBuilder.goBelowUpdates2(originalModifiedFormula).first;
}
// Create new sequent
@@ -2952,8 +2958,8 @@ public static Sequent createSequentToProveWithNewSuccedent(Node node, PosInOccur
public static ImmutableList computeRootElementaryUpdates(Node root) {
ImmutableList result = ImmutableSLList.nil();
Sequent sequent = root.sequent();
- for (SequentFormula sf : sequent.succedent()) {
- Term term = sf.formula();
+ for (Term sf : sequent.succedent()) {
+ Term term = sf;
if (Junctor.IMP.equals(term.op())) {
result = result.prepend(collectElementaryUpdates(term.sub(1)));
}
@@ -3031,7 +3037,7 @@ public static Sequent createSequentToProveWithNewSuccedent(Node node, PosInOccur
// were not modified by the applied rule
Sequent originalSequentWithoutMethodFrame =
SymbolicExecutionSideProofUtil.computeGeneralSequentToProve(node.sequent(),
- pio != null ? pio.sequentFormula() : null);
+ pio != null ? pio.sequentLevelFormula() : null);
Set skolemTerms = newSuccedentToProve != null
? collectSkolemConstants(originalSequentWithoutMethodFrame, newSuccedentToProve)
: collectSkolemConstants(originalSequentWithoutMethodFrame, tb.parallel(updates));
@@ -3045,13 +3051,13 @@ public static Sequent createSequentToProveWithNewSuccedent(Node node, PosInOccur
newSuccedentToProve =
addLabelRecursiveToNonSkolem(factory, newSuccedentToProve, RESULT_LABEL);
}
- Sequent sequentToProve = newSuccedentToProve != null
- ? originalSequentWithoutMethodFrame
- .addFormula(new SequentFormula(newSuccedentToProve), false, true).sequent()
+ Sequent sequentToProve;
+ sequentToProve = newSuccedentToProve != null ? originalSequentWithoutMethodFrame
+ .addFormula(newSuccedentToProve, false, true).sequent()
: originalSequentWithoutMethodFrame;
if (additionalAntecedent != null) {
sequentToProve = sequentToProve
- .addFormula(new SequentFormula(additionalAntecedent), true, false).sequent();
+ .addFormula(additionalAntecedent, true, false).sequent();
}
return sequentToProve;
}
@@ -3067,10 +3073,10 @@ public static Sequent createSequentToProveWithNewSuccedent(Node node, PosInOccur
private static Sequent labelSkolemConstants(
Sequent sequent, Set constantsToLabel,
TermFactory factory) {
- for (SequentFormula sf : sequent.antecedent()) {
+ for (Term sf : sequent.antecedent()) {
int skolemEquality = checkSkolemEquality(sf);
if (skolemEquality == -1) {
- Term equality = sf.formula();
+ Term equality = sf;
if (constantsToLabel.contains(equality.sub(0))) {
Term definition =
addLabelRecursiveToNonSkolem(factory, equality.sub(1), RESULT_LABEL);
@@ -3082,11 +3088,11 @@ private static Sequent labelSkolemConstants(
Term newEquality =
factory.createTerm(equality.op(), new ImmutableArray<>(newSubs),
equality.boundVars(), equality.getLabels());
- sequent = sequent.changeFormula(new SequentFormula(newEquality),
+ sequent = sequent.changeFormula(newEquality,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), true)).sequent();
}
} else if (skolemEquality == 1) {
- Term equality = sf.formula();
+ Term equality = sf;
if (constantsToLabel.contains(equality.sub(1))) {
Term definition =
addLabelRecursiveToNonSkolem(factory, equality.sub(0), RESULT_LABEL);
@@ -3098,7 +3104,7 @@ private static Sequent labelSkolemConstants(
Term newEquality =
factory.createTerm(equality.op(), new ImmutableArray<>(newSubs),
equality.boundVars(), equality.getLabels());
- sequent = sequent.changeFormula(new SequentFormula(newEquality),
+ sequent = sequent.changeFormula(newEquality,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), true)).sequent();
}
}
@@ -3225,7 +3231,7 @@ public static boolean isSkolemConstant(Term term) {
}
/**
- * Removes all {@link SequentFormula}s with a skolem equality from the given {@link Sequent} if
+ * Removes all {@link Term}s with a skolem equality from the given {@link Sequent} if
* the skolem {@link Term} is not contained in the given {@link Collection}.
*
* @param sequent The {@link Sequent} to modify.
@@ -3236,10 +3242,10 @@ public static boolean isSkolemConstant(Term term) {
private static Sequent removeAllUnusedSkolemEqualities(Sequent sequent,
Collection skolemConstants) {
Sequent result = sequent;
- for (SequentFormula sf : sequent.antecedent()) {
+ for (Term sf : sequent.antecedent()) {
result = removeAllUnusedSkolemEqualities(result, sf, true, skolemConstants);
}
- for (SequentFormula sf : sequent.succedent()) {
+ for (Term sf : sequent.succedent()) {
result = removeAllUnusedSkolemEqualities(result, sf, false, skolemConstants);
}
return result;
@@ -3247,17 +3253,17 @@ private static Sequent removeAllUnusedSkolemEqualities(Sequent sequent,
/**
* Helper method of {@link #removeAllUnusedSkolemEqualities(Sequent, Collection)} which removes
- * the given {@link SequentFormula} if required.
+ * the given {@link Term} if required.
*
* @param sequent The {@link Sequent} to modify.
- * @param sf The {@link SequentFormula} to remove if its skolem {@link Term} is not listed.
+ * @param sf The {@link Term} to remove if its skolem {@link Term} is not listed.
* @param antecedent {@code true} antecedent, {@code false} succedent.
* @param skolemConstants The allowed skolem {@link Term}s.
- * @return The modified {@link Sequent} in which the {@link SequentFormula} might be removed.
+ * @return The modified {@link Sequent} in which the {@link Term} might be removed.
*/
- private static Sequent removeAllUnusedSkolemEqualities(Sequent sequent, SequentFormula sf,
+ private static Sequent removeAllUnusedSkolemEqualities(Sequent sequent, Term sf,
boolean antecedent, Collection skolemConstants) {
- Term term = sf.formula();
+ Term term = sf;
boolean remove = false;
if (term.op() == Equality.EQUALS) {
if (isSkolemConstant(term.sub(0))) {
@@ -3276,17 +3282,6 @@ private static Sequent removeAllUnusedSkolemEqualities(Sequent sequent, SequentF
}
}
- /**
- * Checks if the given {@link SequentFormula} is a skolem equality.
- *
- * @param sf The {@link SequentFormula} to check.
- * @return {@code -1} left side of skolem equality, {@code 0} no skolem equality, {@code 1}
- * right side of skolem equality.
- */
- public static int checkSkolemEquality(SequentFormula sf) {
- return checkSkolemEquality(sf.formula());
- }
-
/**
* Checks if the given {@link Term} is a skolem equality.
*
@@ -3427,8 +3422,8 @@ public static Term replaceSkolemConstants(Sequent sequent, Term term, Services s
private static List findSkolemReplacements(Sequent sequent, Term skolemConstant,
Term skolemEquality) {
List result = new LinkedList<>();
- for (SequentFormula sf : sequent) {
- Term term = sf.formula();
+ for (Term sf : sequent) {
+ Term term = sf;
if (term != skolemEquality) {
int skolemCheck = checkSkolemEquality(term);
if (skolemCheck == -1) {
@@ -4111,10 +4106,12 @@ public static boolean lazyComputeIsMainBranchVerified(Node node) {
Node leaf = leafsIter.next();
if (!leaf.isClosed()) {
final Term toSearch = predicate;
- SequentFormula topLevelPredicate = CollectionUtil
+ Term topLevelPredicate = CollectionUtil
.search(leaf.sequent().succedent(),
- element -> Operator.opEquals(toSearch.op(),
- element.formula().op()));
+ element -> {
+ return Operator.opEquals(toSearch.op(),
+ element.op());
+ });
if (topLevelPredicate == null) {
verified = false;
}
@@ -4151,9 +4148,11 @@ public static boolean lazyComputeIsAdditionalBranchVerified(Node node) {
for (Term term : additinalPredicates) {
additinalOperatos.add(term.op());
}
- SequentFormula topLevelPredicate =
+ Term topLevelPredicate =
CollectionUtil.search(leaf.sequent().succedent(),
- element -> additinalOperatos.contains(element.formula().op()));
+ element -> {
+ return additinalOperatos.contains(element.op());
+ });
if (topLevelPredicate == null) {
verified = false;
}
@@ -4199,8 +4198,8 @@ public static Sort lazyComputeExceptionSort(Node node, IProgramVariable exceptio
// Search final value of the exceptional variable which is used to check if the verified
// program terminates normally
ImmutableArray value = null;
- for (SequentFormula f : node.sequent().succedent()) {
- Pair, Term> updates = TermBuilder.goBelowUpdates2(f.formula());
+ for (Term f : node.sequent().succedent()) {
+ Pair, Term> updates = TermBuilder.goBelowUpdates2(f);
Iterator iter = updates.first.iterator();
while (value == null && iter.hasNext()) {
value = extractValueFromUpdate(iter.next(), exceptionVariable);
diff --git a/key.core.symbolic_execution/src/test/java/de/uka/ilkd/key/symbolic_execution/testcase/AbstractSymbolicExecutionTestCase.java b/key.core.symbolic_execution/src/test/java/de/uka/ilkd/key/symbolic_execution/testcase/AbstractSymbolicExecutionTestCase.java
index 95c6da8fe33..2b0a9703bd7 100644
--- a/key.core.symbolic_execution/src/test/java/de/uka/ilkd/key/symbolic_execution/testcase/AbstractSymbolicExecutionTestCase.java
+++ b/key.core.symbolic_execution/src/test/java/de/uka/ilkd/key/symbolic_execution/testcase/AbstractSymbolicExecutionTestCase.java
@@ -1638,7 +1638,7 @@ protected String getTryContent(Proof proof) {
Node node = proof.root();
Sequent sequent = node.sequent();
assertEquals(1, sequent.succedent().size());
- Term succedent = sequent.succedent().get(0).formula();
+ Term succedent = sequent.succedent().get(0);
assertEquals(2, succedent.arity());
Term updateApplication = succedent.subs().get(1);
assertEquals(2, updateApplication.arity());
diff --git a/key.core.testgen/src/main/java/de/uka/ilkd/key/smt/testgen/AbstractTestGenerator.java b/key.core.testgen/src/main/java/de/uka/ilkd/key/smt/testgen/AbstractTestGenerator.java
index 2fbfc7b1ce4..7ee2a1cf76a 100644
--- a/key.core.testgen/src/main/java/de/uka/ilkd/key/smt/testgen/AbstractTestGenerator.java
+++ b/key.core.testgen/src/main/java/de/uka/ilkd/key/smt/testgen/AbstractTestGenerator.java
@@ -11,7 +11,6 @@
import de.uka.ilkd.key.logic.JavaBlock;
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.UpdateApplication;
import de.uka.ilkd.key.macros.ProofMacroFinishedInfo;
@@ -283,19 +282,19 @@ private Proof createProofForTestingNoDuplicate(Node node, List otherProof
final Sequent oldSequent = node.sequent();
Sequent newSequent =
Sequent.createSequent(Semisequent.EMPTY_SEMISEQUENT, Semisequent.EMPTY_SEMISEQUENT);
- Iterator it = oldSequent.antecedent().iterator();
+ Iterator it = oldSequent.antecedent().iterator();
while (it.hasNext()) {
- final SequentFormula sf = it.next();
+ final Term sf = it.next();
// Allow updates modailities in the antecedent
- if (hasModalities(sf.formula(), false)) {
+ if (hasModalities(sf, false)) {
continue;
}
newSequent = newSequent.addFormula(sf, true, false).sequent();
}
it = oldSequent.succedent().iterator();
while (it.hasNext()) {
- final SequentFormula sf = it.next();
- if (hasModalities(sf.formula(), removePostCondition)) {
+ final Term sf = it.next();
+ if (hasModalities(sf, removePostCondition)) {
continue;
}
newSequent = newSequent.addFormula(sf, false, false).sequent();
diff --git a/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/ModelGenerator.java b/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/ModelGenerator.java
index 0b66418b71b..1d1d4deaf7d 100644
--- a/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/ModelGenerator.java
+++ b/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/ModelGenerator.java
@@ -10,7 +10,6 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Namespace;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.op.IProgramVariable;
@@ -149,7 +148,7 @@ private boolean addModelToTerm(Model m) {
if (!tmodel.equals(tb.tt())) {
Term notTerm = tb.not(tmodel);
- SequentFormula sf = new SequentFormula(notTerm);
+ Term sf = notTerm;
goal.addFormula(sf, true, true);
return true;
}
@@ -175,14 +174,14 @@ public Term sequentToTerm(Sequent s) {
final TermBuilder tb = services.getTermBuilder();
ante = ante.append(tb.tt());
- for (SequentFormula f : s.antecedent()) {
- ante = ante.append(f.formula());
+ for (Term f : s.antecedent()) {
+ ante = ante.append(f);
}
ImmutableList succ = ImmutableSLList.nil();
succ = succ.append(tb.ff());
- for (SequentFormula f : s.succedent()) {
- succ = succ.append(f.formula());
+ for (Term f : s.succedent()) {
+ succ = succ.append(f);
}
return tb.imp(tb.and(ante), tb.or(succ));
diff --git a/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/ProofInfo.java b/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/ProofInfo.java
index 9ea2b64c61c..7abfd7b8a68 100644
--- a/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/ProofInfo.java
+++ b/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/ProofInfo.java
@@ -146,7 +146,7 @@ private boolean isFalseConstant(Operator o) {
}
public Term getPO() {
- return proof.root().sequent().succedent().get(0).formula();
+ return proof.root().sequent().succedent().get(0);
}
diff --git a/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/TestCaseGenerator.java b/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/TestCaseGenerator.java
index c652b73a373..6cfc7b14f21 100644
--- a/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/TestCaseGenerator.java
+++ b/key.core.testgen/src/main/java/de/uka/ilkd/key/testgen/TestCaseGenerator.java
@@ -14,7 +14,6 @@
import de.uka.ilkd.key.java.declaration.ParameterDeclaration;
import de.uka.ilkd.key.java.declaration.VariableSpecification;
import de.uka.ilkd.key.ldt.HeapLDT;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.*;
import de.uka.ilkd.key.proof.Node;
@@ -602,17 +601,15 @@ protected String inferSort(Map typeInfMap, String progVar) {
protected Map generateTypeInferenceMap(Node n) {
HashMap typeInfMap = new HashMap<>();
- for (SequentFormula sequentFormula : n.sequent()) {
- Term t = sequentFormula.formula();
- generateTypeInferenceMapHelper(t, typeInfMap);
+ for (Term seqFml : n.sequent()) {
+ generateTypeInferenceMapHelper(seqFml, typeInfMap);
}
return typeInfMap;
}
private void generateTypeInferenceMapHelper(Term t, Map map) {
Operator op = t.op();
- if (op instanceof ProgramVariable) {
- ProgramVariable pv = (ProgramVariable) t.op();
+ if (op instanceof ProgramVariable pv) {
final String name = pv.name().toString();
if (map.containsKey(name)) {
if (map.get(name) != pv.sort()) {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/api/Matcher.java b/key.core/src/main/java/de/uka/ilkd/key/api/Matcher.java
index 9105d67b4f4..196733d7d10 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/api/Matcher.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/api/Matcher.java
@@ -7,7 +7,7 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.SchemaVariable;
import de.uka.ilkd.key.nparser.KeyAst;
import de.uka.ilkd.key.nparser.KeyIO;
@@ -85,9 +85,9 @@ public List matchPattern(String pattern, Sequent currentSeq
ImmutableArray succCand =
IfFormulaInstSeq.createList(currentSeq, false, copyServices);
- SequentFormula[] patternArray = new SequentFormula[patternSeq.size()];
+ Term[] patternArray = new Term[patternSeq.size()];
int i = 0;
- for (SequentFormula fm : patternSeq) {
+ for (Term fm : patternSeq) {
patternArray[i++] = fm;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/api/SearchNode.java b/key.core/src/main/java/de/uka/ilkd/key/api/SearchNode.java
index bf08e9862ac..973f983a845 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/api/SearchNode.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/api/SearchNode.java
@@ -3,7 +3,6 @@
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.api;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.rule.MatchConditions;
import de.uka.ilkd.key.rule.inst.SVInstantiations;
@@ -12,13 +11,13 @@
* Created by sarah on 5/2/17.
*/
public final class SearchNode {
- private final SequentFormula[] pattern;
+ private final Term[] pattern;
private final int pos;
private final int succAntPos;
private final MatchConditions mc;
- public SearchNode(SequentFormula[] pattern, int succAntPos) {
+ public SearchNode(Term[] pattern, int succAntPos) {
this.pattern = pattern;
this.pos = 0;
this.succAntPos = succAntPos;
@@ -38,7 +37,7 @@ public boolean isAntecedent() {
}
public Term getPatternTerm() {
- return pattern[pos].formula();
+ return pattern[pos];
}
public boolean isFinished() {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletAssumesModel.java b/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletAssumesModel.java
index f4d6ba8618a..e7216887766 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletAssumesModel.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletAssumesModel.java
@@ -9,7 +9,6 @@
import de.uka.ilkd.key.java.Position;
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.NamespaceSet;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.OriginTermLabel.NodeOrigin;
import de.uka.ilkd.key.logic.label.OriginTermLabel.SpecType;
@@ -41,7 +40,7 @@ public String toString(Services services) {
}
@Override
- public SequentFormula getConstrainedFormula() {
+ public Term getConstrainedFormula() {
return null;
}
};
@@ -127,7 +126,7 @@ public IfFormulaInstantiation getSelection(int pos)
new NodeOrigin(SpecType.USER_INTERACTION,
app.rule().displayName(), goal.node().serialNr()));
- return new IfFormulaInstDirect(new SequentFormula(term));
+ return new IfFormulaInstDirect(term);
} catch (RecognitionException e) {
throw new SVInstantiationParserException(manualInput,
Position.fromOneZeroBased(pos, e.charPositionInLine),
diff --git a/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletInstantiationModel.java b/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletInstantiationModel.java
index 9948b481af2..756cfe4bcfc 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletInstantiationModel.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/control/instantiation_model/TacletInstantiationModel.java
@@ -125,14 +125,14 @@ private void initIfChoiceModels() {
ImmutableArray succCand =
IfFormulaInstSeq.createList(seq, false, services);
- Iterator it = ifseq.iterator();
+ Iterator it = ifseq.iterator();
Term ifFma;
MatchConditions matchCond = app.matchConditions();
ifChoiceModel = new TacletAssumesModel[size];
for (int i = 0; i < size; i++) {
- ifFma = it.next().formula();
+ ifFma = it.next();
ifChoiceModel[i] =
new TacletAssumesModel(
ifFma, taclet().getMatcher().matchIf((i < asize ? antecCand : succCand),
diff --git a/key.core/src/main/java/de/uka/ilkd/key/informationflow/macros/AbstractFinishAuxiliaryComputationMacro.java b/key.core/src/main/java/de/uka/ilkd/key/informationflow/macros/AbstractFinishAuxiliaryComputationMacro.java
index f0afb84aea8..648f9a76e3e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/informationflow/macros/AbstractFinishAuxiliaryComputationMacro.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/informationflow/macros/AbstractFinishAuxiliaryComputationMacro.java
@@ -10,7 +10,6 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Namespace;
import de.uka.ilkd.key.logic.NamespaceSet;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermFactory;
@@ -120,11 +119,11 @@ private static Term buildFormulaFromGoal(Goal symbExecGoal) {
final TermBuilder tb = symbExecGoal.proof().getServices().getTermBuilder();
final TermFactory tf = symbExecGoal.proof().getServices().getTermFactory();
Term result = tb.tt();
- for (final SequentFormula f : symbExecGoal.sequent().antecedent()) {
- result = tb.and(result, f.formula());
+ for (final Term f : symbExecGoal.sequent().antecedent()) {
+ result = tb.and(result, f);
}
- for (final SequentFormula f : symbExecGoal.sequent().succedent()) {
- result = tb.and(result, tb.not(f.formula()));
+ for (final Term f : symbExecGoal.sequent().succedent()) {
+ result = tb.and(result, tb.not(f));
}
result = TermLabelManager.removeIrrelevantLabels(result, tf);
return result;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/informationflow/macros/SelfcompositionStateExpansionMacro.java b/key.core/src/main/java/de/uka/ilkd/key/informationflow/macros/SelfcompositionStateExpansionMacro.java
index 18daf7aa846..c514cba0579 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/informationflow/macros/SelfcompositionStateExpansionMacro.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/informationflow/macros/SelfcompositionStateExpansionMacro.java
@@ -70,8 +70,9 @@ protected Strategy createStrategy(Proof proof, PosInOccurrence posInOcc) {
protected boolean ruleApplicationInContextAllowed(RuleApp ruleApp, PosInOccurrence pio,
Goal goal) {
String ruleName = ruleApp.rule().name().toString();
- return !"andLeft".equals(ruleName)
- || !(pio.sequentFormula().formula().op() instanceof UpdateApplication);
+ if (!"andLeft".equals(ruleName))
+ return true;
+ return !(pio.sequentLevelFormula().op() instanceof UpdateApplication);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/informationflow/proof/InfFlowProof.java b/key.core/src/main/java/de/uka/ilkd/key/informationflow/proof/InfFlowProof.java
index cf2f9226bbe..f2827c91b52 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/informationflow/proof/InfFlowProof.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/informationflow/proof/InfFlowProof.java
@@ -5,7 +5,6 @@
import de.uka.ilkd.key.informationflow.po.InfFlowProofSymbols;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.proof.BuiltInRuleIndex;
import de.uka.ilkd.key.proof.Proof;
@@ -98,11 +97,11 @@ public void addGoalTemplates(Taclet t) {
ImmutableList temps = t.goalTemplates();
assert temps != null;
for (TacletGoalTemplate tgt : temps) {
- for (SequentFormula sf : tgt.sequent().antecedent().asList()) {
- addLabeledTotalTerm(sf.formula());
+ for (Term sf : tgt.sequent().antecedent().asList()) {
+ addLabeledTotalTerm(sf);
}
- for (SequentFormula sf : tgt.sequent().succedent().asList()) {
- addLabeledTotalTerm(sf.formula());
+ for (Term sf : tgt.sequent().succedent().asList()) {
+ addLabeledTotalTerm(sf);
}
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/informationflow/rule/executor/InfFlowContractAppTacletExecutor.java b/key.core/src/main/java/de/uka/ilkd/key/informationflow/rule/executor/InfFlowContractAppTacletExecutor.java
index a3a7fa718f6..a32bab1b947 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/informationflow/rule/executor/InfFlowContractAppTacletExecutor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/informationflow/rule/executor/InfFlowContractAppTacletExecutor.java
@@ -43,12 +43,13 @@ protected void addToAntec(Semisequent semi, TermLabelState termLabelState,
TacletLabelHint labelHint, SequentChangeInfo currentSequent, PosInOccurrence pos,
PosInOccurrence applicationPosInOccurrence, MatchConditions matchCond, Goal goal,
RuleApp tacletApp, Services services) {
- final ImmutableList replacements = instantiateSemisequent(semi,
+ final ImmutableList replacements = instantiateSemisequent(semi,
termLabelState, labelHint, pos, matchCond, goal, tacletApp, services);
assert replacements.size() == 1
: "information flow taclets must have " + "exactly one add!";
+ final Term replacement = replacements.iterator().next();
updateStrategyInfo(services.getProof().openEnabledGoals().head(),
- replacements.iterator().next().formula());
+ replacement);
super.addToAntec(semi, termLabelState, labelHint, currentSequent, pos,
applicationPosInOccurrence, matchCond, goal, tacletApp, services);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowContractAppTacletBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowContractAppTacletBuilder.java
index 474082a360b..82694a57efd 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowContractAppTacletBuilder.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/informationflow/rule/tacletbuilder/AbstractInfFlowContractAppTacletBuilder.java
@@ -247,9 +247,9 @@ private Taclet genInfFlowContractApplTaclet(Goal goal, ProofObligationVars appDa
// create sequents
Sequent assumesSeq =
- Sequent.createAnteSequent(new Semisequent(new SequentFormula(schemaAssumes)));
+ Sequent.createAnteSequent(new Semisequent(schemaAssumes));
Sequent replaceWithSeq =
- Sequent.createAnteSequent(new Semisequent(new SequentFormula(replaceWithTerm)));
+ Sequent.createAnteSequent(new Semisequent(replaceWithTerm));
// create taclet
InfFlowContractAppRewriteTacletBuilder tacletBuilder =
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/BoundVarsVisitor.java b/key.core/src/main/java/de/uka/ilkd/key/logic/BoundVarsVisitor.java
index da51f6c54f6..76f5407d600 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/BoundVarsVisitor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/BoundVarsVisitor.java
@@ -40,8 +40,8 @@ public void visit(Term visited) {
* visits a sequent
*/
public void visit(Sequent visited) {
- for (SequentFormula cf : visited) {
- visit(cf.formula());
+ for (Term cf : visited) {
+ visit(cf);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/FormulaChangeInfo.java b/key.core/src/main/java/de/uka/ilkd/key/logic/FormulaChangeInfo.java
index a01138a9dfb..e7c72d25703 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/FormulaChangeInfo.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/FormulaChangeInfo.java
@@ -10,10 +10,10 @@
* @param newFormula modified formula
* @see SequentChangeInfo
*/
-public record FormulaChangeInfo(PosInOccurrence positionOfModification, SequentFormula newFormula) {
+public record FormulaChangeInfo(PosInOccurrence positionOfModification, Term newFormula) {
- public SequentFormula getOriginalFormula() {
- return positionOfModification().sequentFormula();
+ public Term getOriginalFormula() {
+ return positionOfModification().sequentLevelFormula();
}
/**
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/PosInOccurrence.java b/key.core/src/main/java/de/uka/ilkd/key/logic/PosInOccurrence.java
index 0674d8b557b..aef1c55a869 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/PosInOccurrence.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/PosInOccurrence.java
@@ -4,7 +4,7 @@
package de.uka.ilkd.key.logic;
/**
- * This class describes a position in an occurrence of a term. A SequentFormula and a PosInTerm
+ * This class describes a position in an occurrence of a term. A Term and a PosInTerm
* determine an object of this class exactly.
*/
public final class PosInOccurrence {
@@ -17,7 +17,7 @@ public static PosInOccurrence findInSequent(Sequent seq, int formulaNumber, PosI
/**
* the constrained formula the pos in occurrence describes
*/
- private final SequentFormula sequentFormula;
+ private final Term sequentLevelFormula;
// saves 8 bytes (due to alignment issues) per instance if we use a
// short here instead of an int
@@ -28,7 +28,7 @@ public static PosInOccurrence findInSequent(Sequent seq, int formulaNumber, PosI
*/
private final boolean inAntec;
- /** the position in sequentFormula.formula() */
+ /** the position in Term.formula() */
private final PosInTerm posInTerm;
/**
@@ -36,20 +36,20 @@ public static PosInOccurrence findInSequent(Sequent seq, int formulaNumber, PosI
*/
private volatile Term subTermCache = null;
- public PosInOccurrence(SequentFormula sequentFormula, PosInTerm posInTerm, boolean inAntec) {
+ public PosInOccurrence(Term sequentLevelFormula, PosInTerm posInTerm, boolean inAntec) {
assert posInTerm != null;
- assert sequentFormula != null;
+ assert sequentLevelFormula != null;
this.inAntec = inAntec;
- this.sequentFormula = sequentFormula;
+ this.sequentLevelFormula = sequentLevelFormula;
this.posInTerm = posInTerm;
- this.hashCode = (short) (sequentFormula.hashCode() * 13 + posInTerm.hashCode());
+ this.hashCode = (short) (sequentLevelFormula.hashCode() * 13 + posInTerm.hashCode());
}
/**
- * returns the SequentFormula that determines the occurrence of this PosInOccurrence
+ * returns the Term that determines the occurrence of this PosInOccurrence
*/
- public SequentFormula sequentFormula() {
- return sequentFormula;
+ public Term sequentLevelFormula() {
+ return sequentLevelFormula;
}
/**
@@ -66,7 +66,7 @@ public int depth() {
* {@link de.uka.ilkd.key.logic.PosInTerm}.
*/
public PosInOccurrence down(int i) {
- return new PosInOccurrence(sequentFormula, posInTerm.down(i), inAntec);
+ return new PosInOccurrence(sequentLevelFormula, posInTerm.down(i), inAntec);
}
/**
@@ -78,7 +78,7 @@ public boolean eqEquals(Object obj) {
return false;
}
- if (!sequentFormula.equals(cmp.sequentFormula)) {
+ if (!sequentLevelFormula.equals(cmp.sequentLevelFormula)) {
return false;
}
@@ -100,7 +100,7 @@ public boolean equals(Object obj) {
// NB: the class NonDuplicateAppFeature depends on the usage
// of != in this condition
- if (sequentFormula() != cmp.sequentFormula()) {
+ if (sequentLevelFormula() != cmp.sequentLevelFormula()) {
return false;
}
@@ -139,7 +139,7 @@ public boolean isTopLevel() {
/**
* List all subterms between the root and the position this objects points to; the first term is
- * the whole term constrainedFormula().formula(), the last one
+ * the whole sequent level formula, the last one
* subTerm()
*
* @return an iterator that walks from the root of the term to the position this
@@ -151,10 +151,9 @@ public PIOPathIterator iterator() {
/**
* The usage of this method is strongly discouraged, use {@link PosInOccurrence#iterator}
- * instead. describes the exact occurrence of the referred term inside
- * {@link SequentFormula#formula()}
+ * instead. describes the exact occurrence of the referred term
*
- * @return the position in the formula of the SequentFormula of this PosInOccurrence.
+ * @return the position in the formula of the Term of this PosInOccurrence.
*/
public PosInTerm posInTerm() {
return posInTerm;
@@ -169,9 +168,9 @@ public PosInTerm posInTerm() {
* constrainedFormula(). It is not tested whether this position exists
* within p_newFormula
*/
- public PosInOccurrence replaceConstrainedFormula(SequentFormula p_newFormula) {
+ public PosInOccurrence replaceConstrainedFormula(Term p_newFormula) {
assert p_newFormula != null;
- if (p_newFormula == sequentFormula) {
+ if (p_newFormula == sequentLevelFormula) {
return this;
}
return new PosInOccurrence(p_newFormula, posInTerm, inAntec);
@@ -182,7 +181,7 @@ public PosInOccurrence replaceConstrainedFormula(SequentFormula p_newFormula) {
*/
public Term subTerm() {
if (subTermCache == null) {
- subTermCache = posInTerm.getSubTerm(sequentFormula.formula());
+ subTermCache = posInTerm.getSubTerm(sequentLevelFormula);
}
return subTermCache;
}
@@ -194,13 +193,13 @@ public PosInOccurrence topLevel() {
if (isTopLevel()) {
return this;
}
- return new PosInOccurrence(sequentFormula, PosInTerm.getTopLevel(), inAntec);
+ return new PosInOccurrence(sequentLevelFormula, PosInTerm.getTopLevel(), inAntec);
}
/** toString */
public String toString() {
- return "Term " + posInTerm() + " of " + sequentFormula();
+ return "Term " + posInTerm() + " of " + sequentLevelFormula();
}
@@ -211,7 +210,7 @@ public String toString() {
public PosInOccurrence up() {
assert !isTopLevel() : "not possible to go up from top level position";
- return new PosInOccurrence(sequentFormula, posInTerm.up(), inAntec);
+ return new PosInOccurrence(sequentLevelFormula, posInTerm.up(), inAntec);
}
@@ -244,7 +243,7 @@ public PosInOccurrence getPosInOccurrence() {
// next() faster
final PosInOccurrence pio;
- pio = new PosInOccurrence(sequentFormula, posInTerm.firstN(count - 1), inAntec);
+ pio = new PosInOccurrence(sequentLevelFormula, posInTerm.firstN(count - 1), inAntec);
return pio;
@@ -271,7 +270,7 @@ public int next() {
int res;
if (currentSubTerm == null) {
- currentSubTerm = sequentFormula.formula();
+ currentSubTerm = sequentLevelFormula;
} else {
currentSubTerm = currentSubTerm.sub(child);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/Semisequent.java b/key.core/src/main/java/de/uka/ilkd/key/logic/Semisequent.java
index a8ce511c4fb..7e494a4e5c5 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/Semisequent.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/Semisequent.java
@@ -18,12 +18,12 @@
* future versions it can be enhanced to do other simplifications. A sequent and so a semisequent
* has to be immutable.
*/
-public class Semisequent implements Iterable {
+public class Semisequent implements Iterable {
/** the empty semisequent (using singleton pattern) */
public static final Semisequent EMPTY_SEMISEQUENT = new Empty();
- /** list with the {@link SequentFormula}s of the Semisequent */
- private final ImmutableList seqList;
+ /** list with the {@link Term}s of the Semisequent */
+ private final ImmutableList seqList;
/** used by inner class Empty */
private Semisequent() {
@@ -37,7 +37,7 @@ private Semisequent() {
*
* @param seqList list of sequent formulas
*/
- public Semisequent(ImmutableList seqList) {
+ public Semisequent(ImmutableList seqList) {
assert !seqList.isEmpty();
this.seqList = seqList;
}
@@ -49,7 +49,7 @@ public Semisequent(ImmutableList seqList) {
*
* @param seqList list of sequent formulas
*/
- public Semisequent(Collection seqList) {
+ public Semisequent(Collection seqList) {
assert !seqList.isEmpty();
this.seqList = ImmutableList.fromList(seqList);
}
@@ -62,7 +62,7 @@ public Semisequent(Collection seqList) {
*
* @param seqList list of sequent formulas
*/
- public static Semisequent create(Collection seqList) {
+ public static Semisequent create(Collection seqList) {
if (seqList.isEmpty()) {
return EMPTY_SEMISEQUENT;
}
@@ -73,9 +73,9 @@ public static Semisequent create(Collection seqList) {
/**
* creates a new Semisequent with the Semisequent elements in seqList
*/
- public Semisequent(SequentFormula seqFormula) {
+ public Semisequent(Term seqFormula) {
assert seqFormula != null;
- this.seqList = ImmutableSLList.nil().append(seqFormula);
+ this.seqList = ImmutableSLList.nil().append(seqFormula);
}
@@ -84,23 +84,23 @@ public Semisequent(SequentFormula seqFormula) {
* returning same semisequent if inserting would create redundancies
*
* @param idx int encoding the place the element has to be put
- * @param sequentFormula {@link SequentFormula} to be inserted
+ * @param fml {@link Term} to be inserted
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
- public SemisequentChangeInfo insert(int idx, SequentFormula sequentFormula) {
- return removeRedundance(idx, sequentFormula);
+ public SemisequentChangeInfo insert(int idx, Term fml) {
+ return removeRedundance(idx, fml);
}
/**
* inserts the elements of the list at the specified index performing redundancy checks
*
* @param idx int encoding the place where the insertion starts
- * @param insertionList IList to be inserted starting at idx
+ * @param insertionList IList to be inserted starting at idx
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
- public SemisequentChangeInfo insert(int idx, ImmutableList insertionList) {
+ public SemisequentChangeInfo insert(int idx, ImmutableList insertionList) {
return removeRedundance(idx, insertionList);
}
@@ -108,23 +108,23 @@ public SemisequentChangeInfo insert(int idx, ImmutableList inser
* inserts element at index 0 performing redundancy checks, this may result in returning same
* semisequent if inserting would create redundancies
*
- * @param sequentFormula SequentFormula to be inserted
+ * @param fml the Term to be inserted
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
- public SemisequentChangeInfo insertFirst(SequentFormula sequentFormula) {
- return insert(0, sequentFormula);
+ public SemisequentChangeInfo insertFirst(Term fml) {
+ return insert(0, fml);
}
/**
* inserts element at index 0 performing redundancy checks, this may result in returning same
* semisequent if inserting would create redundancies
*
- * @param insertions IList to be inserted
+ * @param insertions IList to be inserted
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
- public SemisequentChangeInfo insertFirst(ImmutableList insertions) {
+ public SemisequentChangeInfo insertFirst(ImmutableList insertions) {
return insert(0, insertions);
}
@@ -132,23 +132,23 @@ public SemisequentChangeInfo insertFirst(ImmutableList insertion
* inserts element at the end of the semisequent performing redundancy checks, this may result
* in returning same semisequent if inserting would create redundancies
*
- * @param sequentFormula {@link SequentFormula} to be inserted
+ * @param fml {@link Term} to be inserted
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
- public SemisequentChangeInfo insertLast(SequentFormula sequentFormula) {
- return insert(size(), sequentFormula);
+ public SemisequentChangeInfo insertLast(Term fml) {
+ return insert(size(), fml);
}
/**
* inserts the formulas of the list at the end of the semisequent performing redundancy checks,
* this may result in returning same semisequent if inserting would create redundancies
*
- * @param insertions the IList to be inserted
+ * @param insertions the IList to be inserted
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
- public SemisequentChangeInfo insertLast(ImmutableList insertions) {
+ public SemisequentChangeInfo insertLast(ImmutableList insertions) {
return insert(size(), insertions);
}
@@ -163,21 +163,21 @@ public boolean isEmpty() {
/**
- * inserts new SequentFormula at index idx and removes duplicates, perform simplifications etc.
+ * inserts new fml at index idx and removes duplicates, perform simplifications etc.
*
* @param fci null if the formula to be added is new, otherwise an object telling which formula
- * is replaced with the new formula sequentFormula, and what are the
+ * is replaced with the new formula fml, and what are the
* differences between the two formulas
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
private SemisequentChangeInfo insertAndRemoveRedundancyHelper(int idx,
- SequentFormula sequentFormula, SemisequentChangeInfo semiCI, FormulaChangeInfo fci) {
+ Term fml, SemisequentChangeInfo semiCI, FormulaChangeInfo fci) {
// Search for equivalent formulas and weakest constraint
- ImmutableList searchList = semiCI.getFormulaList();
- final SequentFormula[] newSeqList = new SequentFormula[searchList.size()];
- SequentFormula cf;
+ ImmutableList searchList = semiCI.getFormulaList();
+ final Term[] newSeqList = new Term[searchList.size()];
+ Term cf;
int pos = -1;
while (!searchList.isEmpty()) {
@@ -185,12 +185,13 @@ private SemisequentChangeInfo insertAndRemoveRedundancyHelper(int idx,
cf = searchList.head();
searchList = searchList.tail();
- if (sequentFormula != null
- && cf.formula().equalsModProperty(sequentFormula.formula(),
- RENAMING_PROPERTY)) {
- semiCI.rejectedFormula(sequentFormula);
- return semiCI; // semisequent already contains formula
+ if (fml != null) {
+ if (cf.equalsModProperty(fml,
+ RENAMING_PROPERTY)) {
+ semiCI.rejectedFormula(fml);
+ return semiCI; // semisequent already contains formula
+ }
}
newSeqList[pos] = cf;
}
@@ -198,15 +199,15 @@ private SemisequentChangeInfo insertAndRemoveRedundancyHelper(int idx,
// compose resulting formula list
if (fci == null) {
- semiCI.addedFormula(idx, sequentFormula);
+ semiCI.addedFormula(idx, fml);
} else {
semiCI.modifiedFormula(idx, fci);
}
- final ImmutableList orig = semiCI.getFormulaList();
+ final ImmutableList orig = semiCI.getFormulaList();
pos = Math.min(idx, orig.size());
- searchList = semiCI.getFormulaList().take(pos).prepend(sequentFormula);
+ searchList = semiCI.getFormulaList().take(pos).prepend(fml);
while (pos > 0) {
--pos;
@@ -223,23 +224,23 @@ private SemisequentChangeInfo insertAndRemoveRedundancyHelper(int idx,
* . inserts new ConstrainedFormulas starting at index idx and removes duplicates, perform
* simplifications etc.
*
- * @param sequentFormulasToBeInserted the {@link ImmutableList} to be inserted
+ * @param TermsToBeInserted the {@link ImmutableList} to be inserted
* at position idx
- * @param idx an int that means insert sequentFormula at the idx-th position in the semisequent
+ * @param idx an int that means insert Term at the idx-th position in the semisequent
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
private SemisequentChangeInfo insertAndRemoveRedundancy(int idx,
- ImmutableList sequentFormulasToBeInserted, SemisequentChangeInfo sci) {
+ ImmutableList TermsToBeInserted, SemisequentChangeInfo sci) {
int pos = idx;
- ImmutableList oldFormulas = sci.getFormulaList();
+ ImmutableList oldFormulas = sci.getFormulaList();
- while (!sequentFormulasToBeInserted.isEmpty()) {
- final SequentFormula aSequentFormula = sequentFormulasToBeInserted.head();
- sequentFormulasToBeInserted = sequentFormulasToBeInserted.tail();
+ while (!TermsToBeInserted.isEmpty()) {
+ final Term aTerm = TermsToBeInserted.head();
+ TermsToBeInserted = TermsToBeInserted.tail();
- sci = insertAndRemoveRedundancyHelper(pos, aSequentFormula, sci, null);
+ sci = insertAndRemoveRedundancyHelper(pos, aTerm, sci, null);
if (sci.getFormulaList() != oldFormulas) {
pos = sci.getIndex() + 1;
@@ -253,55 +254,55 @@ private SemisequentChangeInfo insertAndRemoveRedundancy(int idx,
* . inserts new ConstrainedFormulas starting at index idx and removes duplicates, perform
* simplifications etc.
*
- * @param sequentFormula the IList to be inserted at position idx
- * @param idx an int that means insert sequentFormula at the idx-th position in the semisequent
+ * @param Term the IList to be inserted at position idx
+ * @param idx an int that means insert Term at the idx-th position in the semisequent
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
private SemisequentChangeInfo removeRedundance(int idx,
- ImmutableList sequentFormula) {
- return insertAndRemoveRedundancy(idx, sequentFormula, new SemisequentChangeInfo(seqList));
+ ImmutableList Term) {
+ return insertAndRemoveRedundancy(idx, Term, new SemisequentChangeInfo(seqList));
}
/**
- * . inserts new SequentFormula at index {@code idx} and removes duplicates, perform
+ * . inserts new fml at index {@code idx} and removes duplicates, perform
* simplifications etc.
*
- * @param sequentFormula the SequentFormula to be inserted at position idx
- * @param idx an int that means insert sequentFormula at the idx-th position in the semisequent
- * @return new Semisequent with sequentFormula at index idx and removed redundancies
+ * @param fml the fml to be inserted at position idx
+ * @param idx an int that means insert fml at the idx-th position in the semisequent
+ * @return new Semisequent with fml at index idx and removed redundancies
*/
- private SemisequentChangeInfo removeRedundance(int idx, SequentFormula sequentFormula) {
- return insertAndRemoveRedundancyHelper(idx, sequentFormula,
+ private SemisequentChangeInfo removeRedundance(int idx, Term fml) {
+ return insertAndRemoveRedundancyHelper(idx, fml,
new SemisequentChangeInfo(seqList), null);
}
/**
- * replaces the element at place idx with sequentFormula
+ * replaces the element at place idx with fml
*
* @param pos the PosInOccurrence describing the position of and within the formula below which
- * the formula differs from the new formula sequentFormula
- * @param sequentFormula the SequentFormula replacing the old element at index idx
+ * the formula differs from the new formula fml
+ * @param fml the fml replacing the old element at index idx
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
- public SemisequentChangeInfo replace(PosInOccurrence pos, SequentFormula sequentFormula) {
- final int idx = indexOf(pos.sequentFormula());
- final FormulaChangeInfo fci = new FormulaChangeInfo(pos, sequentFormula);
- return insertAndRemoveRedundancyHelper(idx, sequentFormula, remove(idx), fci);
+ public SemisequentChangeInfo replace(PosInOccurrence pos, Term fml) {
+ final int idx = indexOf(pos.sequentLevelFormula());
+ final FormulaChangeInfo fci = new FormulaChangeInfo(pos, fml);
+ return insertAndRemoveRedundancyHelper(idx, fml, remove(idx), fci);
}
/**
- * replaces the idx-th formula by sequentFormula
+ * replaces the idx-th formula by fml
*
* @param idx the int with the position of the formula to be replaced
- * @param sequentFormula the SequentFormula replacing the formula at the given position
+ * @param fml the fml replacing the formula at the given position
* @return a SemisequentChangeInfo containing the new sequent and a diff to the old one
*/
- public SemisequentChangeInfo replace(int idx, SequentFormula sequentFormula) {
- return insertAndRemoveRedundancyHelper(idx, sequentFormula, remove(idx), null);
+ public SemisequentChangeInfo replace(int idx, Term fml) {
+ return insertAndRemoveRedundancyHelper(idx, fml, remove(idx), null);
}
/**
@@ -309,14 +310,14 @@ public SemisequentChangeInfo replace(int idx, SequentFormula sequentFormula) {
* of the list to the semisequent behind the replaced formula
*
* @param pos the formula to be replaced
- * @param replacements the IList whose head replaces the element at index idx
+ * @param replacements the IList whose head replaces the element at index idx
* and the tail is added to the semisequent
* @return a semi sequent change information object with the new semisequent and information
* which formulas have been added or removed
*/
public SemisequentChangeInfo replace(PosInOccurrence pos,
- ImmutableList replacements) {
- final int idx = indexOf(pos.sequentFormula());
+ ImmutableList replacements) {
+ final int idx = indexOf(pos.sequentLevelFormula());
return insertAndRemoveRedundancy(idx, replacements, remove(idx));
}
@@ -327,7 +328,7 @@ public SemisequentChangeInfo replace(PosInOccurrence pos,
* @param replacements the new formulas
* @return change information including the resulting semisequent after the replacement
*/
- public SemisequentChangeInfo replace(int idx, ImmutableList replacements) {
+ public SemisequentChangeInfo replace(int idx, ImmutableList replacements) {
return insertAndRemoveRedundancy(idx, replacements, remove(idx));
}
@@ -346,14 +347,14 @@ public int size() {
*/
public SemisequentChangeInfo remove(int idx) {
- ImmutableList newList = seqList;
+ ImmutableList newList = seqList;
int index = 0;
if (idx < 0 || idx >= size()) {
return new SemisequentChangeInfo(seqList);
}
- final SequentFormula[] temp = new SequentFormula[idx];
+ final Term[] temp = new Term[idx];
while (index < idx) {// go to idx
temp[index] = newList.head();
@@ -362,7 +363,7 @@ public SemisequentChangeInfo remove(int idx) {
}
// remove the element that is at head of newList
- final SequentFormula removedFormula = newList.head();
+ final Term removedFormula = newList.head();
newList = newList.tail();
for (int k = index - 1; k >= 0; k--) {
@@ -377,18 +378,18 @@ public SemisequentChangeInfo remove(int idx) {
}
/**
- * returns the index of the given {@link SequentFormula} or {@code -1} if the sequent formula is
+ * returns the index of the given {@link Term} or {@code -1} if the sequent formula is
* not found. Equality of sequent formulas is checked sing the identy check (i.e.,
* ==)
*
- * @param sequentFormula the {@link SequentFormula} to look for
- * @return index of sequentFormula (-1 if not found)
+ * @param fml the {@link Term} to look for
+ * @return index of fml (-1 if not found)
*/
- public int indexOf(SequentFormula sequentFormula) {
- ImmutableList searchList = seqList;
+ public int indexOf(Term fml) {
+ ImmutableList searchList = seqList;
int index = 0;
while (!searchList.isEmpty()) {
- if (searchList.head() == sequentFormula) {
+ if (searchList.head() == fml) {
return index;
}
searchList = searchList.tail();
@@ -401,53 +402,53 @@ public int indexOf(SequentFormula sequentFormula) {
* gets the element at a specific index
*
* @param idx int representing the index of the element we want to have
- * @return {@link SequentFormula} found at index idx
+ * @return {@link Term} found at index idx
* @throws IndexOutOfBoundsException if idx is negative or greater or equal to
* {@link Sequent#size()}
*/
- public SequentFormula get(int idx) {
+ public Term get(int idx) {
if (idx < 0 || idx >= seqList.size()) {
throw new IndexOutOfBoundsException();
}
return seqList.take(idx).head();
}
- /** @return the first {@link SequentFormula} of this Semisequent */
- public SequentFormula getFirst() {
+ /** @return the first {@link Term} of this Semisequent */
+ public Term getFirst() {
return seqList.head();
}
/**
- * checks if the {@link SequentFormula} occurs in this Semisequent (identity check)
+ * checks if the {@link Term} occurs in this Semisequent (identity check)
*
- * @param sequentFormula the {@link SequentFormula} to look for
- * @return true iff. sequentFormula has been found in this Semisequent
+ * @param fml the {@link Term} to look for
+ * @return true iff. fml has been found in this Semisequent
*/
- public boolean contains(SequentFormula sequentFormula) {
- return indexOf(sequentFormula) != -1;
+ public boolean contains(Term fml) {
+ return indexOf(fml) != -1;
}
/**
- * checks if a {@link SequentFormula} is in this Semisequent (equality check)
+ * checks if a {@link Term} is in this Semisequent (equality check)
*
- * @param sequentFormula the {@link SequentFormula} to look for
- * @return true iff. sequentFormula has been found in this Semisequent
+ * @param fml the {@link Term} to look for
+ * @return true iff. fml has been found in this Semisequent
*/
- public boolean containsEqual(SequentFormula sequentFormula) {
- return seqList.contains(sequentFormula);
+ public boolean containsEqual(Term fml) {
+ return seqList.contains(fml);
}
/**
* returns iterator about the elements of the sequent
*
- * @return Iterator
+ * @return Iterator
*/
@Override
- public Iterator iterator() {
+ public Iterator iterator() {
return seqList.iterator();
}
- public ImmutableList asList() {
+ public ImmutableList asList() {
return seqList;
}
@@ -459,21 +460,17 @@ public boolean equals(Object o) {
return seqList.equals(((Semisequent) o).seqList);
}
-
@Override
public int hashCode() {
return seqList.hashCode();
}
-
/** @return String representation of this Semisequent */
@Override
public String toString() {
return seqList.toString();
}
-
-
// inner class used to represent an empty semisequent
private static class Empty extends Semisequent {
@@ -485,40 +482,40 @@ private Empty() {
* inserts the element always at index 0 ignores the first argument
*
* @param idx int encoding the place the element has to be put
- * @param sequentFormula {@link SequentFormula} to be inserted
- * @return semisequent change information object with new semisequent with sequentFormula at
+ * @param fml {@link Term} to be inserted
+ * @return semisequent change information object with new semisequent with fml at
* place idx
*/
@Override
- public SemisequentChangeInfo insert(int idx, SequentFormula sequentFormula) {
- return insertFirst(sequentFormula);
+ public SemisequentChangeInfo insert(int idx, Term fml) {
+ return insertFirst(fml);
}
/**
* inserts the element at index 0
*
- * @param sequentFormula {@link SequentFormula} to be inserted
- * @return semisequent change information object with new semisequent with sequentFormula at
+ * @param fml {@link Term} to be inserted
+ * @return semisequent change information object with new semisequent with Term at
* place idx
*/
@Override
- public SemisequentChangeInfo insertFirst(SequentFormula sequentFormula) {
+ public SemisequentChangeInfo insertFirst(Term fml) {
final SemisequentChangeInfo sci = new SemisequentChangeInfo(
- ImmutableSLList.nil().prepend(sequentFormula));
- sci.addedFormula(0, sequentFormula);
+ ImmutableSLList.nil().prepend(fml));
+ sci.addedFormula(0, fml);
return sci;
}
/**
* inserts the element at the end of the semisequent
*
- * @param sequentFormula {@link SequentFormula} to be inserted
- * @return semisequent change information object with new semisequent with sequentFormula at
+ * @param fml {@link Term} to be inserted
+ * @return semisequent change information object with new semisequent with fml at
* place idx
*/
@Override
- public SemisequentChangeInfo insertLast(SequentFormula sequentFormula) {
- return insertFirst(sequentFormula);
+ public SemisequentChangeInfo insertLast(Term fml) {
+ return insertFirst(fml);
}
@@ -533,16 +530,16 @@ public boolean isEmpty() {
}
/**
- * replaces the element at place idx with sequentFormula
+ * replaces the element at place idx with Term
*
* @param idx an int specifying the index of the element that has to be replaced
- * @param sequentFormula the {@link SequentFormula} replacing the old element at index idx
- * @return semisequent change information object with new semisequent with sequentFormula at
+ * @param fml the {@link Term} replacing the old element at index idx
+ * @return semisequent change information object with new semisequent with Term at
* place idx
*/
@Override
- public SemisequentChangeInfo replace(int idx, SequentFormula sequentFormula) {
- return insertFirst(sequentFormula);
+ public SemisequentChangeInfo replace(int idx, Term fml) {
+ return insertFirst(fml);
}
/** @return int counting the elements of this semisequent */
@@ -563,13 +560,13 @@ public SemisequentChangeInfo remove(int idx) {
}
/**
- * returns index of a {@link SequentFormula}
+ * returns index of a {@link Term}
*
- * @param sequentFormula the {@link SequentFormula} the index want to be determined
- * @return index of sequentFormula
+ * @param fml the {@link Term} the index want to be determined
+ * @return index of Term
*/
@Override
- public int indexOf(SequentFormula sequentFormula) {
+ public int indexOf(Term fml) {
return -1;
}
@@ -577,29 +574,29 @@ public int indexOf(SequentFormula sequentFormula) {
* gets the element at a specific index
*
* @param idx int representing the index of the element we want to have
- * @return {@link SequentFormula} found at index idx
+ * @return {@link Term} found at index idx
*/
@Override
- public SequentFormula get(int idx) {
+ public Term get(int idx) {
return null;
}
/**
- * @return the first SequentFormula of this Semisequent
+ * @return the first Term of this Semisequent
*/
@Override
- public SequentFormula getFirst() {
+ public Term getFirst() {
return null;
}
/**
- * checks if a {@link SequentFormula} is in this Semisequent
+ * checks if a {@link Term} is in this Semisequent
*
- * @param sequentFormula the {@link SequentFormula} to look for
- * @return true iff. sequentFormula has been found in this Semisequent
+ * @param fml the {@link Term} to look for
+ * @return true iff. Term has been found in this Semisequent
*/
@Override
- public boolean contains(SequentFormula sequentFormula) {
+ public boolean contains(Term fml) {
return false;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/SemisequentChangeInfo.java b/key.core/src/main/java/de/uka/ilkd/key/logic/SemisequentChangeInfo.java
index fdb9d8e3aa5..cd9a937f74c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/SemisequentChangeInfo.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/SemisequentChangeInfo.java
@@ -13,18 +13,18 @@
public class SemisequentChangeInfo {
/** contains the added formulas to the semisequent */
- private ImmutableList added = ImmutableSLList.nil();
+ private ImmutableList added = ImmutableSLList.nil();
/** contains the removed formulas from the semisequent */
- private ImmutableList removed = ImmutableSLList.nil();
+ private ImmutableList removed = ImmutableSLList.nil();
/** contains the modified formulas from the semisequent */
private ImmutableList modified = ImmutableSLList.nil();
/** stores the redundance free formula list of the semisequent */
- private ImmutableList modifiedSemisequent = ImmutableSLList.nil();
+ private ImmutableList modifiedSemisequent = ImmutableSLList.nil();
/**
* contains formulas that have been tried to add, but which have been rejected due to already
* existing formulas in the sequent subsuming these formulas
*/
- private ImmutableList rejected = ImmutableSLList.nil();
+ private ImmutableList rejected = ImmutableSLList.nil();
/** */
private int lastFormulaIndex = -1;
@@ -32,7 +32,7 @@ public class SemisequentChangeInfo {
public SemisequentChangeInfo() {
}
- public SemisequentChangeInfo(ImmutableList formulas) {
+ public SemisequentChangeInfo(ImmutableList formulas) {
this.modifiedSemisequent = formulas;
}
@@ -60,21 +60,21 @@ public boolean hasChanged() {
* sets the list of constrained formula containing all formulas of the semisequent after the
* operation
*/
- public void setFormulaList(ImmutableList list) {
+ public void setFormulaList(ImmutableList list) {
modifiedSemisequent = list;
}
/**
* returns the list of constrained formula of the new semisequent
*/
- public ImmutableList getFormulaList() {
+ public ImmutableList getFormulaList() {
return modifiedSemisequent;
}
/**
* logs an added formula at position idx
*/
- public void addedFormula(int idx, SequentFormula cf) {
+ public void addedFormula(int idx, Term cf) {
added = added.prepend(cf);
lastFormulaIndex = idx;
}
@@ -85,7 +85,7 @@ public void addedFormula(int idx, SequentFormula cf) {
public void modifiedFormula(int idx, FormulaChangeInfo fci) {
// This information can overwrite older records about removed
// formulas
- removed = removed.removeAll(fci.positionOfModification().sequentFormula());
+ removed = removed.removeAll(fci.positionOfModification().sequentLevelFormula());
modified = modified.prepend(fci);
lastFormulaIndex = idx;
}
@@ -93,18 +93,18 @@ public void modifiedFormula(int idx, FormulaChangeInfo fci) {
/**
* returns the list of all added constrained formulas
*
- * @return IList added to the semisequent
+ * @return IList added to the semisequent
*/
- public ImmutableList addedFormulas() {
+ public ImmutableList addedFormulas() {
return added;
}
/**
* returns the list of all removed constrained formulas
*
- * @return IList removed from the semisequent
+ * @return IList removed from the semisequent
*/
- public ImmutableList removedFormulas() {
+ public ImmutableList removedFormulas() {
return removed;
}
@@ -114,7 +114,7 @@ public ImmutableList removedFormulas() {
*
* @return list of formulas rejected due to redundancy
*/
- public ImmutableList rejectedFormulas() {
+ public ImmutableList rejectedFormulas() {
return this.rejected;
}
@@ -123,16 +123,16 @@ public ImmutableList rejectedFormulas() {
* adding formula f to the semisequent failed due to a redundance check. This means an
* equal or stronger formula is already present in the semisequent
*
- * @param f the SequentFormula
+ * @param f the Term
*/
- public void rejectedFormula(SequentFormula f) {
+ public void rejectedFormula(Term f) {
this.rejected = this.rejected.append(f);
}
/**
* returns the list of all modification positions
*
- * @return IList modified within the semisequent
+ * @return IList modified within the semisequent
*/
public ImmutableList modifiedFormulas() {
return modified;
@@ -141,7 +141,7 @@ public ImmutableList modifiedFormulas() {
/**
* logs an added formula at position idx
*/
- public void removedFormula(int idx, SequentFormula cf) {
+ public void removedFormula(int idx, Term cf) {
removed = removed.prepend(cf);
lastFormulaIndex = (lastFormulaIndex == idx) ? -1
@@ -166,7 +166,7 @@ public void combine(SemisequentChangeInfo succ) {
return;
}
- for (SequentFormula sf : succ.removed) {
+ for (Term sf : succ.removed) {
predecessor.added = predecessor.added.removeAll(sf);
boolean skip = false;
@@ -194,14 +194,14 @@ public void combine(SemisequentChangeInfo succ) {
}
}
- for (SequentFormula sf : succ.added) {
+ for (Term sf : succ.added) {
predecessor.removed = predecessor.removed.removeAll(sf);
if (!predecessor.added.contains(sf)) {
predecessor.addedFormula(succ.lastFormulaIndex, sf);
}
}
- for (SequentFormula sf : succ.rejected) {
+ for (Term sf : succ.rejected) {
if (!predecessor.rejected.contains(sf)) {
predecessor.rejectedFormula(sf);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/Sequent.java b/key.core/src/main/java/de/uka/ilkd/key/logic/Sequent.java
index a3b8424f2de..a931457f419 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/Sequent.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/Sequent.java
@@ -8,7 +8,6 @@
import java.util.Set;
import de.uka.ilkd.key.logic.label.TermLabel;
-import de.uka.ilkd.key.logic.op.QuantifiableVariable;
import org.key_project.logic.Name;
import org.key_project.util.collection.ImmutableList;
@@ -23,7 +22,7 @@
* {@link Sequent#createSuccSequent} or by inserting formulas directly into
* {@link Sequent#EMPTY_SEQUENT}.
*/
-public class Sequent implements Iterable {
+public class Sequent implements Iterable {
public static final Sequent EMPTY_SEQUENT = NILSequent.INSTANCE;
@@ -95,7 +94,7 @@ private Sequent(Semisequent antecedent, Semisequent succedent) {
* first the formulas are inserted at the beginning or end of the ante-/succedent.
* (NOTICE:Sequent determines index using identy (==) not equality.)
*
- * @param cf the SequentFormula to be added
+ * @param cf the Term to be added
* @param antec boolean selecting the correct semisequent where to insert the formulas. If set
* to true, the antecedent is taken otherwise the succedent.
* @param first boolean if true the formula is added at the beginning of the ante-/succedent,
@@ -103,7 +102,7 @@ private Sequent(Semisequent antecedent, Semisequent succedent) {
* @return a SequentChangeInfo which contains the new sequent and information which formulas
* have been added or removed
*/
- public SequentChangeInfo addFormula(SequentFormula cf, boolean antec, boolean first) {
+ public SequentChangeInfo addFormula(Term cf, boolean antec, boolean first) {
final Semisequent seq = antec ? antecedent : succedent;
@@ -117,15 +116,15 @@ public SequentChangeInfo addFormula(SequentFormula cf, boolean antec, boolean fi
* adds a formula to the sequent at the given position. (NOTICE:Sequent determines index using
* identy (==) not equality.)
*
- * @param cf a SequentFormula to be added
+ * @param cf a Term to be added
* @param p a PosInOccurrence describes position in the sequent
* @return a SequentChangeInfo which contains the new sequent and information which formulas
* have been added or removed
*/
- public SequentChangeInfo addFormula(SequentFormula cf, PosInOccurrence p) {
+ public SequentChangeInfo addFormula(Term cf, PosInOccurrence p) {
final Semisequent seq = getSemisequent(p);
- final SemisequentChangeInfo semiCI = seq.insert(seq.indexOf(p.sequentFormula()), cf);
+ final SemisequentChangeInfo semiCI = seq.insert(seq.indexOf(p.sequentLevelFormula()), cf);
return SequentChangeInfo.createSequentChangeInfo(p.isInAntec(), semiCI,
composeSequent(p.isInAntec(), semiCI.semisequent()), this);
@@ -136,7 +135,7 @@ public SequentChangeInfo addFormula(SequentFormula cf, PosInOccurrence p) {
* of first the formulas are inserted at the beginning or end of the ante-/succedent.
* (NOTICE:Sequent determines index using identity (==) not equality.)
*
- * @param insertions the IList to be added
+ * @param insertions the IList to be added
* @param antec boolean selecting the correct semisequent where to insert the formulas. If set
* to true, the antecedent is taken otherwise the succedent.
* @param first boolean if true the formulas are added at the beginning of the ante-/succedent,
@@ -144,7 +143,7 @@ public SequentChangeInfo addFormula(SequentFormula cf, PosInOccurrence p) {
* @return a SequentChangeInfo which contains the new sequent and information which formulas
* have been added or removed
*/
- public SequentChangeInfo addFormula(ImmutableList insertions, boolean antec,
+ public SequentChangeInfo addFormula(ImmutableList insertions, boolean antec,
boolean first) {
final Semisequent seq = antec ? antecedent : succedent;
@@ -160,17 +159,17 @@ public SequentChangeInfo addFormula(ImmutableList insertions, bo
* adds the formulas of list insertions to the sequent starting at position p. (NOTICE:Sequent
* determines index using identy (==) not equality.)
*
- * @param insertions a IList with the formulas to be added
+ * @param insertions a IList with the formulas to be added
* @param p the PosInOccurrence describing the position where to insert the formulas
* @return a SequentChangeInfo which contains the new sequent and information which formulas
* have been added or removed
*/
- public SequentChangeInfo addFormula(ImmutableList insertions,
+ public SequentChangeInfo addFormula(ImmutableList insertions,
PosInOccurrence p) {
final Semisequent seq = getSemisequent(p);
final SemisequentChangeInfo semiCI =
- seq.insert(seq.indexOf(p.sequentFormula()), insertions);
+ seq.insert(seq.indexOf(p.sequentLevelFormula()), insertions);
return SequentChangeInfo.createSequentChangeInfo(p.isInAntec(), semiCI,
composeSequent(p.isInAntec(), semiCI.semisequent()), this);
@@ -184,7 +183,7 @@ public SequentChangeInfo addFormula(ImmutableList insertions,
* @return a SequentChangeInfo which contains the new sequent and information which formulas
* have been added or removed
*/
- public SequentChangeInfo replaceFormula(int formulaNr, SequentFormula replacement) {
+ public SequentChangeInfo replaceFormula(int formulaNr, Term replacement) {
checkFormulaIndex(formulaNr);
formulaNr--;
boolean inAntec = formulaNr < antecedent.size();
@@ -207,12 +206,12 @@ public Semisequent antecedent() {
* replaces the formula at the given position with another one (NOTICE:Sequent determines index
* using identity (==) not equality.)
*
- * @param newCF the SequentFormula replacing the old one
+ * @param newCF the Term replacing the old one
* @param p a PosInOccurrence describes position in the sequent
* @return a SequentChangeInfo which contains the new sequent and information which formulas
* have been added or removed
*/
- public SequentChangeInfo changeFormula(SequentFormula newCF, PosInOccurrence p) {
+ public SequentChangeInfo changeFormula(Term newCF, PosInOccurrence p) {
final SemisequentChangeInfo semiCI = getSemisequent(p).replace(p, newCF);
return SequentChangeInfo.createSequentChangeInfo(p.isInAntec(), semiCI,
@@ -224,13 +223,13 @@ public SequentChangeInfo changeFormula(SequentFormula newCF, PosInOccurrence p)
* list elements to the sequent (NOTICE:Sequent determines index using identity (==) not
* equality.)
*
- * @param replacements the IList whose head replaces the formula at position p
+ * @param replacements the IList whose head replaces the formula at position p
* and adds the rest of the list behind the changed formula
* @param p a PosInOccurrence describing the position of the formula to be replaced
* @return a SequentChangeInfo which contains the new sequent and information which formulas
* have been added or removed
*/
- public SequentChangeInfo changeFormula(ImmutableList replacements,
+ public SequentChangeInfo changeFormula(ImmutableList replacements,
PosInOccurrence p) {
final SemisequentChangeInfo semiCI = getSemisequent(p).replace(p, replacements);
@@ -292,9 +291,9 @@ public boolean equals(Object o) {
* @return an integer strictly greater than zero for the position of the given sequent formula
* on the proof sequent.
*/
- public int formulaNumberInSequent(boolean inAntec, SequentFormula cfma) {
+ public int formulaNumberInSequent(boolean inAntec, Term cfma) {
int n = inAntec ? 0 : antecedent.size();
- final Iterator formIter =
+ final Iterator formIter =
inAntec ? antecedent.iterator() : succedent.iterator();
while (formIter.hasNext()) {
n++;
@@ -315,7 +314,7 @@ public int formulaNumberInSequent(boolean inAntec, SequentFormula cfma) {
*/
public int formulaNumberInSequent(PosInOccurrence pio) {
var inAntec = pio.isInAntec();
- var formula = pio.sequentFormula();
+ var formula = pio.sequentLevelFormula();
return formulaNumberInSequent(inAntec, formula);
}
@@ -326,7 +325,7 @@ public int formulaNumberInSequent(PosInOccurrence pio) {
* @param formulaNumber formula number
* @return the sequent formula at that position
*/
- public SequentFormula getFormulabyNr(int formulaNumber) {
+ public Term getFormulabyNr(int formulaNumber) {
checkFormulaIndex(formulaNumber);
if (formulaNumber <= antecedent.size()) {
return antecedent.get(formulaNumber - 1);
@@ -335,7 +334,7 @@ public SequentFormula getFormulabyNr(int formulaNumber) {
}
/**
- * returns the semisequent in which the SequentFormula described by PosInOccurrence p lies
+ * returns the semisequent in which the Term described by PosInOccurrence p lies
*/
private Semisequent getSemisequent(PosInOccurrence p) {
return p.isInAntec() ? antecedent() : succedent();
@@ -352,7 +351,7 @@ public int hashCode() {
* @return iterator about all ConstrainedFormulae of the sequent
*/
@Override
- public Iterator iterator() {
+ public Iterator iterator() {
return new SequentIterator(antecedent(), succedent());
}
@@ -376,7 +375,7 @@ public boolean numberInAntec(int formulaNumber) {
public SequentChangeInfo removeFormula(PosInOccurrence p) {
final Semisequent seq = getSemisequent(p);
- final SemisequentChangeInfo semiCI = seq.remove(seq.indexOf(p.sequentFormula()));
+ final SemisequentChangeInfo semiCI = seq.remove(seq.indexOf(p.sequentLevelFormula()));
return SequentChangeInfo.createSequentChangeInfo(p.isInAntec(),
semiCI, composeSequent(p.isInAntec(), semiCI.semisequent()), this);
@@ -406,23 +405,6 @@ public String toString() {
return antecedent().toString() + "==>" + succedent().toString();
}
- /**
- * returns true iff the given variable is bound in a formula of a SequentFormula in this
- * sequent.
- *
- * @param v the bound variable to search for
- */
- public boolean varIsBound(QuantifiableVariable v) {
- for (SequentFormula sequentFormula : this) {
- final BoundVarsVisitor bvv = new BoundVarsVisitor();
- sequentFormula.formula().execPostOrder(bvv);
- if (bvv.getBoundVariables().contains(v)) {
- return true;
- }
- }
- return false;
- }
-
private static final class NILSequent extends Sequent {
private static final NILSequent INSTANCE = new NILSequent();
@@ -435,27 +417,22 @@ public boolean isEmpty() {
}
@Override
- public Iterator iterator() {
- return ImmutableSLList.nil().iterator();
- }
-
- @Override
- public boolean varIsBound(QuantifiableVariable v) {
- return false;
+ public Iterator iterator() {
+ return ImmutableSLList.nil().iterator();
}
}
- static class SequentIterator implements Iterator {
+ static class SequentIterator implements Iterator {
/**
* The iterator over the ancedent of the proof sequent.
*/
- private final Iterator anteIt;
+ private final Iterator anteIt;
/**
* The iterator over the succedent of the proof sequent.
*/
- private final Iterator succIt;
+ private final Iterator succIt;
/**
* Constructs a new iterator over a proof sequent.
@@ -474,7 +451,7 @@ public boolean hasNext() {
}
@Override
- public SequentFormula next() {
+ public Term next() {
if (anteIt.hasNext()) {
return anteIt.next();
}
@@ -514,8 +491,8 @@ private static Set getLabelsForTermRecursively(Term term) {
*/
public Set getOccuringTermLabels() {
final Set result = new HashSet<>();
- for (final SequentFormula sf : this) {
- result.addAll(getLabelsForTermRecursively(sf.formula()));
+ for (final Term sf : this) {
+ result.addAll(getLabelsForTermRecursively(sf));
}
return result;
}
@@ -526,16 +503,16 @@ public Set getOccuringTermLabels() {
* @param form the given formula
* @return true if this sequent contains the given formula
*/
- public boolean contains(SequentFormula form) {
+ public boolean contains(Term form) {
return antecedent.contains(form) || succedent.contains(form);
}
/**
- * Returns a list containing every {@link SequentFormula} in this sequent.
+ * Returns a list containing every {@link Term} in this sequent.
*
- * @return a list containing every {@link SequentFormula} in this sequent.
+ * @return a list containing every {@link Term} in this sequent.
*/
- public ImmutableList asList() {
+ public ImmutableList asList() {
return antecedent.asList().append(succedent.asList());
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/SequentChangeInfo.java b/key.core/src/main/java/de/uka/ilkd/key/logic/SequentChangeInfo.java
index 9253b647ada..c1f9bcf163e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/SequentChangeInfo.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/SequentChangeInfo.java
@@ -148,7 +148,7 @@ public SemisequentChangeInfo getSemisequentChangeInfo(boolean antec) {
* antecedent; false means succedent)
* @return list of formulas added to the selected semisequent
*/
- public ImmutableList addedFormulas(boolean antec) {
+ public ImmutableList addedFormulas(boolean antec) {
return antec
? (antecedent != null ? antecedent.addedFormulas() : ImmutableSLList.nil())
: (succedent != null ? succedent.addedFormulas() : ImmutableSLList.nil());
@@ -160,9 +160,9 @@ public ImmutableList addedFormulas(boolean antec) {
*
* @return list of formulas added to sequent
*/
- public ImmutableList addedFormulas() {
- final ImmutableList addedFormulasAntec = addedFormulas(true);
- final ImmutableList addedFormulasSucc = addedFormulas(false);
+ public ImmutableList addedFormulas() {
+ final ImmutableList addedFormulasAntec = addedFormulas(true);
+ final ImmutableList addedFormulasSucc = addedFormulas(false);
return concatenateHelper(addedFormulasAntec, addedFormulasSucc);
@@ -177,7 +177,7 @@ public ImmutableList addedFormulas() {
* antecedent; false means succedent)
* @return list of formulas removed from the selected semisequent
*/
- public ImmutableList removedFormulas(boolean antec) {
+ public ImmutableList removedFormulas(boolean antec) {
return antec
? (antecedent != null ? antecedent.removedFormulas() : ImmutableSLList.nil())
: (succedent != null ? succedent.removedFormulas() : ImmutableSLList.nil());
@@ -189,9 +189,9 @@ public ImmutableList removedFormulas(boolean antec) {
*
* @return list of formulas removed from the sequent
*/
- public ImmutableList removedFormulas() {
- final ImmutableList removedFormulasAntec = removedFormulas(true);
- final ImmutableList removedFormulasSucc = removedFormulas(false);
+ public ImmutableList removedFormulas() {
+ final ImmutableList removedFormulasAntec = removedFormulas(true);
+ final ImmutableList removedFormulasSucc = removedFormulas(false);
return concatenateHelper(removedFormulasAntec, removedFormulasSucc);
}
@@ -231,7 +231,7 @@ public ImmutableList modifiedFormulas() {
* antecedent; false means succedent)
* @return list of formulas rejected when trying to add to the selected semisequent
*/
- public ImmutableList rejectedFormulas(boolean antec) {
+ public ImmutableList rejectedFormulas(boolean antec) {
return antec
? (antecedent != null ? antecedent.rejectedFormulas() : ImmutableSLList.nil())
: (succedent != null ? succedent.rejectedFormulas() : ImmutableSLList.nil());
@@ -242,9 +242,9 @@ public ImmutableList rejectedFormulas(boolean antec) {
*
* @return list of rejected formulas
*/
- public ImmutableList rejectedFormulas() {
- final ImmutableList rejectedFormulasAntec = rejectedFormulas(true);
- final ImmutableList rejectedFormulasSucc = rejectedFormulas(false);
+ public ImmutableList rejectedFormulas() {
+ final ImmutableList rejectedFormulasAntec = rejectedFormulas(true);
+ final ImmutableList rejectedFormulasSucc = rejectedFormulas(false);
return concatenateHelper(rejectedFormulasAntec, rejectedFormulasSucc);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/SequentFormula.java b/key.core/src/main/java/de/uka/ilkd/key/logic/SequentFormula.java
deleted file mode 100644
index 38325df369f..00000000000
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/SequentFormula.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.logic;
-
-import de.uka.ilkd.key.ldt.JavaDLTheory;
-import de.uka.ilkd.key.logic.op.AbstractTermTransformer;
-
-import org.key_project.util.EqualsModProofIrrelevancy;
-
-import static de.uka.ilkd.key.logic.equality.ProofIrrelevancyProperty.PROOF_IRRELEVANCY_PROPERTY;
-
-
-/**
- * A sequent formula is a wrapper around a formula that occurs as top level formula in a sequent.
- * SequentFormula instances have to be unique in the sequent as they are used by PosInOccurrence to
- * determine the exact position. In earlier KeY versions this class was called ConstrainedFormula as
- * it was equipped with an additional constraints. It would be interesting to add more value to this
- * class by providing a way to add additional annotations or to cache local information about the
- * formula.
- */
-public class SequentFormula implements EqualsModProofIrrelevancy {
-
- private final Term term;
-
- /**
- * Cached value for {@link #hashCode()}.
- */
- private final int hashCode;
- /**
- * Cached value for {@link #hashCodeModProofIrrelevancy()}.
- */
- private final int hashCode2;
-
- /**
- * creates a new SequentFormula
- *
- * @param term a Term of sort {@link JavaDLTheory#FORMULA}
- */
- public SequentFormula(Term term) {
- if (term.sort() != JavaDLTheory.FORMULA
- && term.sort() != AbstractTermTransformer.METASORT) {
- throw new RuntimeException("A Term instead of a formula: " + term);
- }
- this.term = term;
- this.hashCode = term.hashCode() * 13;
- this.hashCode2 = term.hashCodeModProperty(PROOF_IRRELEVANCY_PROPERTY);
- }
-
- /** @return the stored Term */
- public Term formula() {
- return term;
- }
-
- /** equal if terms and constraints are equal */
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof SequentFormula cmp) {
- return term.equals(cmp.formula());
- }
- return false;
- }
-
- /** String representation */
- public String toString() {
- return term.toString();
- }
-
- public int hashCode() {
- return hashCode;
- }
-
- @Override
- public boolean equalsModProofIrrelevancy(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof SequentFormula cmp) {
- return term.equalsModProperty(cmp.formula(), PROOF_IRRELEVANCY_PROPERTY);
- }
- return false;
- }
-
- @Override
- public int hashCodeModProofIrrelevancy() {
- return hashCode2;
- }
-}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/Term.java b/key.core/src/main/java/de/uka/ilkd/key/logic/Term.java
index 73e99f387e2..95c7cd3e1df 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/Term.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/Term.java
@@ -43,6 +43,7 @@
*/
public interface Term
extends Sorted, TermEqualsModProperty, org.key_project.logic.Term {
+
@Override
Operator op();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/label/OriginTermLabel.java b/key.core/src/main/java/de/uka/ilkd/key/logic/label/OriginTermLabel.java
index 522fd209611..a46da8949e5 100755
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/label/OriginTermLabel.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/label/OriginTermLabel.java
@@ -251,9 +251,9 @@ public static SequentChangeInfo removeOriginLabels(Sequent seq, Services service
SequentChangeInfo changes = null;
for (int i = 1; i <= seq.size(); ++i) {
- SequentFormula oldFormula = seq.getFormulabyNr(i);
- SequentFormula newFormula = new SequentFormula(
- OriginTermLabel.removeOriginLabels(oldFormula.formula(), services));
+ Term oldFormula = seq.getFormulabyNr(i);
+ Term uAssumptions = OriginTermLabel.removeOriginLabels(oldFormula, services);
+ Term newFormula = uAssumptions;
SequentChangeInfo change = seq.changeFormula(newFormula,
PosInOccurrence.findInSequent(seq, i, PosInTerm.getTopLevel()));
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/label/TermLabel.java b/key.core/src/main/java/de/uka/ilkd/key/logic/label/TermLabel.java
index a5287c1f2d1..160615c9f3c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/label/TermLabel.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/label/TermLabel.java
@@ -5,7 +5,6 @@
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.TermLabelManager.TermLabelConfiguration;
import de.uka.ilkd.key.logic.op.Modality;
@@ -57,14 +56,14 @@
*
*
* Antecedent and succedent of a {@link Sequent} are sets. The equality check if a
- * {@link SequentFormula} is already contained ignores {@link TermLabel}s. To ensure that
+ * {@link Term} is already contained ignores {@link TermLabel}s. To ensure that
* {@link TermLabel}s are not lost,
* {@link TermLabelManager#mergeLabels(de.uka.ilkd.key.java.Services,
* de.uka.ilkd.key.logic.SequentChangeInfo)}
- * merges the labels of the existing {@link SequentFormula} with those of the rejected
- * {@link SequentFormula}. How this is done in detail is implemented by a {@link TermLabelMerger}.
+ * merges the labels of the existing {@link Term} with those of the rejected
+ * {@link Term}. How this is done in detail is implemented by a {@link TermLabelMerger}.
* If no {@link TermLabelMerger} is available, the {@link TermLabel} of the rejected
- * {@link SequentFormula} are lost.
+ * {@link Term} are lost.
*
*
* To implement a new {@link TermLabel} follow the following steps:
@@ -126,7 +125,7 @@
* which works on {@link RefactoringScope#SEQUENT} to freely add or remove
* {@link TermLabel}s on any {@link Term} of the {@link Sequent}.
*
Implement a {@link TermLabelMerger} to ensure that {@link TermLabel}s are maintained
- * in case of rejected {@link SequentFormula}s.
{@link #refactorTerm(TermLabelState, Services, Term, PosInOccurrence, Rule, Goal, Object, Term)}
* : The sequent formula which contains the application term on which the rule is applied
*
{@link #refactorTerm(TermLabelState, Services, PosInOccurrence, Term, Rule, Goal, Object, Term)}
* : The current term.
@@ -955,8 +955,8 @@ protected void performUpdater(TermLabelState state, Services services,
}
/**
- * Refactors all labels on the {@link PosInOccurrence} in the given {@link Term} of a
- * {@link SequentFormula}.
+ * Refactors all labels on the {@link PosInOccurrence} in the given {@link Term} representing a
+ * sequent level formula
*
* @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
@@ -970,21 +970,21 @@ protected void performUpdater(TermLabelState state, Services services,
* @param tacletTerm The optional taclet {@link Term}.
* @return The updated application {@link Term}.
*/
- public static Term refactorSequentFormula(TermLabelState state, Services services,
- Term sequentFormula, PosInOccurrence applicationPosInOccurrence, Rule rule, Goal goal,
+ public static Term refactorTerm(TermLabelState state, Services services,
+ Term seqLevelFml, PosInOccurrence applicationPosInOccurrence, Rule rule, Goal goal,
Object hint, Term tacletTerm) {
TermLabelManager manager = getTermLabelManager(services);
if (manager != null) {
- return manager.refactorSequentFormula(state, services, sequentFormula,
+ return manager.refactorTerm(state, services, seqLevelFml,
applicationPosInOccurrence, goal, hint, rule, tacletTerm);
} else {
- return sequentFormula;
+ return seqLevelFml;
}
}
/**
- * Refactors all labels on the {@link PosInOccurrence} in the given {@link Term} of a
- * {@link SequentFormula}.
+ * Refactors all labels on the {@link PosInOccurrence} in the given {@link Term} representing
+ * a sequent level formula.
*
* @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
@@ -998,11 +998,11 @@ public static Term refactorSequentFormula(TermLabelState state, Services service
* @param tacletTerm The optional taclet {@link Term}.
* @return The updated application {@link Term}.
*/
- public Term refactorSequentFormula(TermLabelState state, Services services, Term sequentFormula,
+ public Term refactorTerm(TermLabelState state, Services services, Term seqLevelFml,
PosInOccurrence applicationPosInOccurrence, Goal goal, Object hint, Rule rule,
Term tacletTerm) {
final PosInTerm pos = applicationPosInOccurrence.posInTerm();
- final Term oldTerm = pos.getSubTerm(sequentFormula);
+ final Term oldTerm = pos.getSubTerm(seqLevelFml);
// Compute active refactorings
RefactoringsContainer refactorings = computeRefactorings(state, services,
applicationPosInOccurrence, oldTerm, rule, goal, hint, tacletTerm);
@@ -1020,7 +1020,7 @@ public Term refactorSequentFormula(TermLabelState state, Services services, Term
refactorings.childAndGrandchildRefactoringsAndParents(), services,
applicationPosInOccurrence, oldTerm, rule, goal, hint, tacletTerm);
} else {
- return sequentFormula;
+ return seqLevelFml;
}
}
@@ -1159,12 +1159,12 @@ public void refactorGoal(TermLabelState state, Services services,
Term root = replaceTerm(state, applicationPosInOccurrence, newApplicationTerm, tf,
refactorings.childAndGrandchildRefactoringsAndParents(), services,
applicationPosInOccurrence, newApplicationTerm, rule, goal, hint, tacletTerm);
- goal.changeFormula(new SequentFormula(root), applicationPosInOccurrence.topLevel());
+ goal.changeFormula(root, applicationPosInOccurrence.topLevel());
} else if (!refactorings.childAndGrandchildRefactoringsAndParents().isEmpty()) {
Term root = replaceTerm(state, applicationPosInOccurrence, applicationTerm, tf,
refactorings.childAndGrandchildRefactoringsAndParents(), services,
applicationPosInOccurrence, newApplicationTerm, rule, goal, hint, tacletTerm);
- goal.changeFormula(new SequentFormula(root), applicationPosInOccurrence.topLevel());
+ goal.changeFormula(root, applicationPosInOccurrence.topLevel());
}
// Do sequent refactoring if required
if (!refactorings.sequentRefactorings().isEmpty() && goal != null) {
@@ -1669,13 +1669,13 @@ protected void refactorSemisequent(TermLabelState state, Services services,
Object hint, Term tacletTerm, Semisequent semisequent, boolean inAntec,
Set activeRefactorings) {
if (!activeRefactorings.isEmpty()) {
- for (SequentFormula sfa : semisequent) {
+ for (Term sfa : semisequent) {
Term updatedTerm =
refactorLabelsRecursive(state, services, applicationPosInOccurrence,
- applicationTerm, rule, goal, hint, tacletTerm, sfa.formula(),
+ applicationTerm, rule, goal, hint, tacletTerm, sfa,
activeRefactorings);
- if (!sfa.formula().equals(updatedTerm)) {
- goal.changeFormula(new SequentFormula(updatedTerm),
+ if (!sfa.equals(updatedTerm)) {
+ goal.changeFormula(updatedTerm,
new PosInOccurrence(sfa, PosInTerm.getTopLevel(), inAntec));
}
}
@@ -1962,11 +1962,11 @@ public static TermLabel findInnerMostParentLabel(PosInOccurrence pio, Name termL
}
/**
- * Merges the {@link TermLabel}s of the rejected {@link SequentFormula}s into the resulting
+ * Merges the {@link TermLabel}s of the rejected {@link Term}s into the resulting
* {@link Sequent}.
*
* @param currentSequent The {@link SequentChangeInfo} which lists the rejected
- * {@link SequentFormula}s.
+ * {@link Term}s.
* @param services The {@link Services} to use.
*/
public static void mergeLabels(SequentChangeInfo currentSequent, Services services) {
@@ -1977,47 +1977,49 @@ public static void mergeLabels(SequentChangeInfo currentSequent, Services servic
}
/**
- * Merges the {@link TermLabel}s of the rejected {@link SequentFormula}s into the resulting
+ * Merges the {@link TermLabel}s of the rejected {@link Term}s into the resulting
* {@link Sequent}.
*
* @param services The {@link Services} to use.
* @param currentSequent The {@link SequentChangeInfo} which lists the rejected
- * {@link SequentFormula}s.
+ * {@link Term}s.
*/
public void mergeLabels(Services services, SequentChangeInfo currentSequent) {
- for (SequentFormula rejectedSF : currentSequent.getSemisequentChangeInfo(true)
+ for (Term rejectedSF : currentSequent.getSemisequentChangeInfo(true)
.rejectedFormulas()) {
mergeLabels(currentSequent, services, rejectedSF, true);
}
- for (final SequentFormula rejectedSF : currentSequent.getSemisequentChangeInfo(false)
+ for (final Term rejectedSF : currentSequent.getSemisequentChangeInfo(false)
.rejectedFormulas()) {
mergeLabels(currentSequent, services, rejectedSF, false);
}
}
/**
- * Merges the {@link TermLabel}s of the given {@link SequentFormula} into the resulting
+ * Merges the {@link TermLabel}s of the given {@link Term} into the resulting
* {@link Sequent}.
*
* @param currentSequent The {@link SequentChangeInfo} which lists the rejected
- * {@link SequentFormula}s.
+ * {@link Term}s.
* @param services The {@link Services} to use.
- * @param rejectedSF The rejected {@link SequentFormula} to work with.
- * @param inAntecedent {@code true} rejected {@link SequentFormula} is in antecedent,
+ * @param rejectedSF The rejected {@link Term} to work with.
+ * @param inAntecedent {@code true} rejected {@link Term} is in antecedent,
* {@code false} it is in succedent.
*/
protected void mergeLabels(SequentChangeInfo currentSequent, Services services,
- SequentFormula rejectedSF, boolean inAntecedent) {
- final Term rejectedTerm = rejectedSF.formula();
+ Term rejectedSF, boolean inAntecedent) {
+ final Term rejectedTerm = rejectedSF;
if (rejectedTerm.hasLabels()) {
- // Search existing SequentFormula
+ // Search existing Term
Semisequent s = currentSequent.getSemisequentChangeInfo(inAntecedent).semisequent();
- SequentFormula existingSF = CollectionUtil.search(s,
- element -> element.formula().equalsModProperty(rejectedTerm,
- RENAMING_PROPERTY));
+ Term existingSF = CollectionUtil.search(s,
+ element -> {
+ return element.equalsModProperty(rejectedTerm,
+ RENAMING_PROPERTY);
+ });
if (existingSF != null) {
// Create list of new labels
- Term existingTerm = existingSF.formula();
+ Term existingTerm = existingSF;
List mergedLabels = new LinkedList<>();
CollectionUtil.addAll(mergedLabels, existingTerm.getLabels());
boolean labelsChanged = false;
@@ -2039,7 +2041,7 @@ protected void mergeLabels(SequentChangeInfo currentSequent, Services services,
existingTerm.subs(), existingTerm.boundVars(),
new ImmutableArray<>(mergedLabels));
SequentChangeInfo sci =
- currentSequent.sequent().changeFormula(new SequentFormula(newTerm),
+ currentSequent.sequent().changeFormula(newTerm,
new PosInOccurrence(existingSF, PosInTerm.getTopLevel(), inAntecedent));
currentSequent.combine(sci);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/logic/package-info.java b/key.core/src/main/java/de/uka/ilkd/key/logic/package-info.java
index 6b837c99a90..a30dfb3f8b4 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/logic/package-info.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/logic/package-info.java
@@ -24,7 +24,7 @@
* {@link de.uka.ilkd.key.logic.Sequent}s consist of two {@link
* de.uka.ilkd.key.logic.Semisequent}s which represent a
* duplicate-free list of a {@link
- * de.uka.ilkd.key.logic.SequentFormula}s. The latter consist of
+ * de.uka.ilkd.key.logic.Term}s. The latter consist of
* a {@link de.uka.ilkd.key.logic.Constraint} and a {@link
* de.uka.ilkd.key.logic.Term} of a special sort {@link
* de.uka.ilkd.key.logic.sort.Sort#FORMULA}.
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/AbstractBlastingMacro.java b/key.core/src/main/java/de/uka/ilkd/key/macros/AbstractBlastingMacro.java
index e225fca54bc..18c841493e0 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/AbstractBlastingMacro.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/AbstractBlastingMacro.java
@@ -17,7 +17,6 @@
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.SortCollector;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
@@ -68,14 +67,14 @@ protected void addInvariantFormula(Goal goal) {
SortCollector sortCollector = new SortCollector();
- for (SequentFormula sf : goal.sequent()) {
- sf.formula().execPreOrder(sortCollector);
+ for (Term sf : goal.sequent()) {
+ sf.execPreOrder(sortCollector);
}
Set sorts = sortCollector.getSorts();
sorts.remove(nullSort);
- List formulae = createFormulae(goal.proof().getServices(), sorts);
- for (SequentFormula sf : formulae) {
+ List formulae = createFormulae(goal.proof().getServices(), sorts);
+ for (Term sf : formulae) {
Sequent s = goal.sequent();
Semisequent antecedent = s.antecedent();
if (!antecedent.containsEqual(sf)) {
@@ -98,8 +97,8 @@ private boolean containsSubTypes(Sort s, Set sorts) {
return false;
}
- private List createFormulae(Services services, Set sorts) {
- List result = new LinkedList<>();
+ private List createFormulae(Services services, Set sorts) {
+ List result = new LinkedList<>();
JavaInfo info = services.getJavaInfo();
SpecificationRepository spec = services.getSpecificationRepository();
@@ -132,7 +131,7 @@ private List createFormulae(Services services, Set sorts)
return result;
}
- private static void addFormulas(List result, KeYJavaType kjt, ClassAxiom c,
+ private static void addFormulas(List result, KeYJavaType kjt, ClassAxiom c,
LogicVariable o, LogicVariable h, Services services) {
TermBuilder tb = new TermBuilder(services.getTermFactory(), services);
Term exactInstance = tb.exactInstance(kjt.getSort(), tb.var(o));
@@ -162,10 +161,10 @@ private static void addFormulas(List result, KeYJavaType kjt, Cl
exactInstanceEquiv = tb.all(h, tb.all(o, exactInstanceEquiv));
instanceImpl = tb.all(h, tb.all(o, instanceImpl));
- result.add(new SequentFormula(exactInstanceEquiv));
+ result.add(exactInstanceEquiv);
if (!right.equals(tb.tt())) {
- result.add(new SequentFormula(instanceImpl));
+ result.add(instanceImpl);
}
} else if (right.op().name().equals(inv.op().name())) {
@@ -176,21 +175,17 @@ private static void addFormulas(List result, KeYJavaType kjt, Cl
exactInstanceEquiv = tb.all(h, tb.all(o, exactInstanceEquiv));
instanceImpl = tb.all(h, tb.all(o, instanceImpl));
- result.add(new SequentFormula(exactInstanceEquiv));
+ result.add(exactInstanceEquiv);
if (!left.equals(tb.tt())) {
- result.add(new SequentFormula(instanceImpl));
+ result.add(instanceImpl);
}
} else {
- Term f = t;
- f = tb.all(h, tb.all(o, f));
- result.add(new SequentFormula(f));
+ result.add(tb.all(h, tb.all(o, t)));
}
} else {
- Term f = t;
- f = tb.all(h, tb.all(o, f));
- result.add(new SequentFormula(f));
+ result.add(tb.all(h, tb.all(o, t)));
}
} catch (Exception e) {
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/FinishSymbolicExecutionUntilMergePointMacro.java b/key.core/src/main/java/de/uka/ilkd/key/macros/FinishSymbolicExecutionUntilMergePointMacro.java
index 59b6f499d5f..f9a5a8e94d7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/FinishSymbolicExecutionUntilMergePointMacro.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/FinishSymbolicExecutionUntilMergePointMacro.java
@@ -150,9 +150,9 @@ public void taskFinished(TaskFinishedInfo info) {
* @return true iff the given succedent has one formula with a break point statement.
*/
private boolean hasBreakPoint(Semisequent succedent) {
- for (SequentFormula formula : succedent.asList()) {
+ for (Term formula : succedent.asList()) {
if (blockElems.contains(JavaTools
- .getActiveStatement(MergeRuleUtils.getJavaBlockRecursive(formula.formula())))) {
+ .getActiveStatement(MergeRuleUtils.getJavaBlockRecursive(formula)))) {
return true;
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/ModalityCache.java b/key.core/src/main/java/de/uka/ilkd/key/macros/ModalityCache.java
index b55b1137bc9..99dad89cc9c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/ModalityCache.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/ModalityCache.java
@@ -6,7 +6,6 @@
import java.util.Map;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.ParameterlessTermLabel;
import de.uka.ilkd.key.logic.op.Modality;
@@ -79,8 +78,8 @@ public boolean hasModality(Sequent sequent) {
}
var result = false;
- for (SequentFormula sequentFormula : sequent) {
- if (termHasModality(sequentFormula.formula())) {
+ for (Term fml : sequent) {
+ if (termHasModality(fml)) {
result = true;
break;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/FocusCommand.java b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/FocusCommand.java
index a27f4613191..2b83dd87ccb 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/FocusCommand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/FocusCommand.java
@@ -73,23 +73,27 @@ private void hideAll(Sequent toKeep) throws ScriptException {
assert goal != null : "not null by contract of the method";
// The formulas to keep in the antecedent
- ImmutableList keepAnte = toKeep.antecedent().asList().map(SequentFormula::formula);
- ImmutableList ante = goal.sequent().antecedent().asList();
+ ImmutableList keepAnte = toKeep.antecedent().asList().map(term1 -> term1);
+ ImmutableList ante = goal.sequent().antecedent().asList();
- for (SequentFormula seqFormula : ante) {
+ for (Term seqFormula : ante) {
// This means "!keepAnte.contains(seqFormula.formula)" but with equality mod renaming!
if (!keepAnte.exists(
- it -> it.equalsModProperty(seqFormula.formula(), RENAMING_PROPERTY))) {
+ it -> {
+ return it.equalsModProperty(seqFormula, RENAMING_PROPERTY);
+ })) {
Taclet tac = getHideTaclet("left");
makeTacletApp(goal, seqFormula, tac, true);
}
}
- ImmutableList keepSucc = toKeep.succedent().asList().map(SequentFormula::formula);
- ImmutableList succ = goal.sequent().succedent().asList();
- for (SequentFormula seqFormula : succ) {
+ ImmutableList keepSucc = toKeep.succedent().asList().map(term -> term);
+ ImmutableList succ = goal.sequent().succedent().asList();
+ for (Term seqFormula : succ) {
if (!keepSucc.exists(
- it -> it.equalsModProperty(seqFormula.formula(), RENAMING_PROPERTY))) {
+ it -> {
+ return it.equalsModProperty(seqFormula, RENAMING_PROPERTY);
+ })) {
Taclet tac = getHideTaclet("right");
makeTacletApp(goal, seqFormula, tac, false);
}
@@ -110,7 +114,7 @@ private Taclet getHideTaclet(String pos) {
* @param tac the taclet top apply (either hide_left or hide_right)
* @param antec whether the formula is in the antecedent
*/
- private void makeTacletApp(Goal g, SequentFormula toHide, Taclet tac, boolean antec) {
+ private void makeTacletApp(Goal g, Term toHide, Taclet tac, boolean antec) {
// hide rules only applicable to top-level terms/sequent formulas
PosInTerm pit = PosInTerm.getTopLevel();
@@ -126,7 +130,7 @@ private void makeTacletApp(Goal g, SequentFormula toHide, Taclet tac, boolean an
TacletApp app =
PosTacletApp.createPosTacletApp((FindTaclet) tac, inst, pio, proof.getServices());
- app = app.addCheckedInstantiation(sv, toHide.formula(), proof.getServices(), true);
+ app = app.addCheckedInstantiation(sv, toHide, proof.getServices(), true);
g.apply(app);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/HideCommand.java b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/HideCommand.java
index 85edd078c0b..f1458b91d73 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/HideCommand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/HideCommand.java
@@ -5,11 +5,7 @@
import java.util.Map;
-import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.PosInTerm;
-import de.uka.ilkd.key.logic.Semisequent;
-import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.*;
import de.uka.ilkd.key.logic.op.SchemaVariable;
import de.uka.ilkd.key.macros.scripts.meta.Option;
import de.uka.ilkd.key.proof.Goal;
@@ -56,11 +52,11 @@ public void execute(Parameters args) throws ScriptException, InterruptedExceptio
Taclet hideLeft =
state.getProof().getEnv().getInitConfigForEnvironment().lookupActiveTaclet(HIDE_LEFT);
- for (SequentFormula s : args.sequent.antecedent()) {
+ for (Term s : args.sequent.antecedent()) {
TacletApp app = NoPosTacletApp.createNoPosTacletApp(hideLeft);
- SequentFormula s2 = find(s, goal.sequent().antecedent());
+ Term s2 = find(s, goal.sequent().antecedent());
SchemaVariable sv = app.uninstantiatedVars().iterator().next();
- app = app.addCheckedInstantiation(sv, s2.formula(), service, true);
+ app = app.addCheckedInstantiation(sv, s2, service, true);
app = app.setPosInOccurrence(new PosInOccurrence(s2, PosInTerm.getTopLevel(), true),
service);
goal.apply(app);
@@ -68,20 +64,20 @@ public void execute(Parameters args) throws ScriptException, InterruptedExceptio
Taclet hideRight =
state.getProof().getEnv().getInitConfigForEnvironment().lookupActiveTaclet(HIDE_RIGHT);
- for (SequentFormula s : args.sequent.succedent()) {
+ for (Term s : args.sequent.succedent()) {
TacletApp app = NoPosTacletApp.createNoPosTacletApp(hideRight);
- SequentFormula s2 = find(s, goal.sequent().succedent());
+ Term s2 = find(s, goal.sequent().succedent());
SchemaVariable sv = app.uninstantiatedVars().iterator().next();
- app = app.addCheckedInstantiation(sv, s2.formula(), service, true);
+ app = app.addCheckedInstantiation(sv, s2, service, true);
app = app.setPosInOccurrence(new PosInOccurrence(s2, PosInTerm.getTopLevel(), false),
service);
goal.apply(app);
}
}
- private SequentFormula find(SequentFormula sf, Semisequent semiseq) throws ScriptException {
- for (SequentFormula s : semiseq) {
- if (s.formula().equalsModProperty(sf.formula(), TERM_LABELS_PROPERTY)) {
+ private Term find(Term sf, Semisequent semiseq) throws ScriptException {
+ for (Term s : semiseq) {
+ if (s.equalsModProperty(sf, TERM_LABELS_PROPERTY)) {
return s;
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/InstantiateCommand.java b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/InstantiateCommand.java
index 41ee9436a12..0b676600f19 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/InstantiateCommand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/InstantiateCommand.java
@@ -109,19 +109,21 @@ private ImmutableList findAllTacletApps(Parameters p, EngineState sta
index.autoModeStopped();
ImmutableList allApps = ImmutableSLList.nil();
- for (SequentFormula sf : g.node().sequent().antecedent()) {
- if (p.formula != null
- && !sf.formula().equalsModProperty(p.formula, RENAMING_PROPERTY)) {
- continue;
+ for (Term sf : g.node().sequent().antecedent()) {
+ if (p.formula != null) {
+ if (!sf.equalsModProperty(p.formula, RENAMING_PROPERTY)) {
+ continue;
+ }
}
allApps = allApps.append(index.getTacletAppAtAndBelow(filter,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), true), services));
}
- for (SequentFormula sf : g.node().sequent().succedent()) {
- if (p.formula != null
- && !sf.formula().equalsModProperty(p.formula, RENAMING_PROPERTY)) {
- continue;
+ for (Term sf : g.node().sequent().succedent()) {
+ if (p.formula != null) {
+ if (!sf.equalsModProperty(p.formula, RENAMING_PROPERTY)) {
+ continue;
+ }
}
allApps = allApps.append(index.getTacletAppAtAndBelow(filter,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), false), services));
@@ -149,8 +151,8 @@ private void computeFormula(Parameters params, Goal goal) throws ScriptException
Node n = goal.node();
Sequent seq = n.sequent();
int occ = params.occ;
- for (SequentFormula form : seq.antecedent().asList()) {
- Term term = form.formula();
+ for (Term form : seq.antecedent().asList()) {
+ Term term = form;
Term stripped = stripUpdates(term);
if (stripped.op() == Quantifier.ALL) {
String varName = stripped.boundVars().get(0).name().toString();
@@ -164,8 +166,8 @@ private void computeFormula(Parameters params, Goal goal) throws ScriptException
}
}
- for (SequentFormula form : seq.succedent().asList()) {
- Term term = form.formula();
+ for (Term form : seq.succedent().asList()) {
+ Term term = form;
Term stripped = stripUpdates(term);
if (stripped.op() == Quantifier.EX) {
String varName = stripped.boundVars().get(0).name().toString();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/MacroCommand.java b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/MacroCommand.java
index 2a431b1cad5..d0e5299907b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/MacroCommand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/MacroCommand.java
@@ -9,9 +9,7 @@
import de.uka.ilkd.key.control.AbstractUserInterfaceControl;
import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.PosInTerm;
-import de.uka.ilkd.key.logic.Sequent;
+import de.uka.ilkd.key.logic.*;
import de.uka.ilkd.key.macros.ProofMacro;
import de.uka.ilkd.key.macros.ProofMacroFinishedInfo;
import de.uka.ilkd.key.macros.scripts.meta.Option;
@@ -129,8 +127,9 @@ public static PosInOccurrence extractMatchingPio(final Sequent sequent, final St
boolean matched = false;
for (int i = 1; i < sequent.size() + 1; i++) {
+ Term fml = sequent.getFormulabyNr(i);
final boolean matchesRegex = formatTermString(
- LogicPrinter.quickPrintTerm(sequent.getFormulabyNr(i).formula(), services))
+ LogicPrinter.quickPrintTerm(fml, services))
.matches(".*" + matchRegEx + ".*");
if (matchesRegex) {
if (matched) {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/RewriteCommand.java b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/RewriteCommand.java
index 4c15504162b..2863889ee48 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/RewriteCommand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/RewriteCommand.java
@@ -111,21 +111,23 @@ private ImmutableList findAllTacletApps(Parameters p, EngineState sta
// filter taclets that are applicable on the given formula
// filter taclets that are applicable on the given formula in the antecedent
- for (SequentFormula sf : g.node().sequent().antecedent()) {
+ for (Term sf : g.node().sequent().antecedent()) {
- if (p.formula != null
- && !sf.formula().equalsModProperty(p.formula, RENAMING_PROPERTY)) {
- continue;
+ if (p.formula != null) {
+ if (!sf.equalsModProperty(p.formula, RENAMING_PROPERTY)) {
+ continue;
+ }
}
allApps = allApps.append(index.getTacletAppAtAndBelow(filter,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), true), services));
}
// filter taclets that are applicable on the given formula in the succedent
- for (SequentFormula sf : g.node().sequent().succedent()) {
- if (p.formula != null
- && !sf.formula().equalsModProperty(p.formula, RENAMING_PROPERTY)) {
- continue;
+ for (Term sf : g.node().sequent().succedent()) {
+ if (p.formula != null) {
+ if (!sf.equalsModProperty(p.formula, RENAMING_PROPERTY)) {
+ continue;
+ }
}
allApps = allApps.append(index.getTacletAppAtAndBelow(filter,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), false), services));
@@ -159,7 +161,7 @@ private List findAndExecReplacement(Parameters p,
RewriteTaclet rw = (RewriteTaclet) pta.taclet();
if (pta.complete()) {
- SequentFormula rewriteResult = rw.getExecutor().getRewriteResult(
+ Term rewriteResult = rw.getExecutor().getRewriteResult(
goalold, null, goalold.proof().getServices(), pta);
executeRewriteTaclet(p, pta, goalold, rewriteResult);
@@ -187,8 +189,8 @@ private List findAndExecReplacement(Parameters p,
* @param rewriteResult
*/
private void executeRewriteTaclet(Parameters p, PosTacletApp pta, Goal goalold,
- SequentFormula rewriteResult) {
- if (rewriteResult.formula().equals(p.replace)
+ Term rewriteResult) {
+ if (rewriteResult.equals(p.replace)
|| getTermAtPos(rewriteResult, pta.posInOccurrence()).equals(p.replace)) {
failposInOccs.remove(pta.posInOccurrence());
succposInOccs.add(pta.posInOccurrence());
@@ -207,13 +209,13 @@ private void executeRewriteTaclet(Parameters p, PosTacletApp pta, Goal goalold,
* @param pio PosInOccurrence of the to be returned term
* @return term at pio
*/
- public Term getTermAtPos(SequentFormula sf, PosInOccurrence pio) {
+ public Term getTermAtPos(Term sf, PosInOccurrence pio) {
if (pio.isTopLevel()) {
- return sf.formula();
+ return sf;
} else {
PosInTerm pit = pio.posInTerm();
- return getSubTerm(sf.formula(), pit.iterator());
+ return getSubTerm(sf, pit.iterator());
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/RuleCommand.java b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/RuleCommand.java
index a107e4c8c96..b1d07c04693 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/RuleCommand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/RuleCommand.java
@@ -254,7 +254,7 @@ private ImmutableList findBuiltInRuleApps(Parameters p, EngineS
final BuiltInRuleAppIndex index = g.ruleAppIndex().builtInRuleAppIndex();
ImmutableList allApps = ImmutableSLList.nil();
- for (SequentFormula sf : g.node().sequent().antecedent()) {
+ for (Term sf : g.node().sequent().antecedent()) {
if (!isFormulaSearchedFor(p, sf, services)) {
continue;
}
@@ -263,7 +263,7 @@ private ImmutableList findBuiltInRuleApps(Parameters p, EngineS
index.getBuiltInRule(g, new PosInOccurrence(sf, PosInTerm.getTopLevel(), true)));
}
- for (SequentFormula sf : g.node().sequent().succedent()) {
+ for (Term sf : g.node().sequent().succedent()) {
if (!isFormulaSearchedFor(p, sf, services)) {
continue;
}
@@ -285,7 +285,7 @@ private ImmutableList findAllTacletApps(Parameters p, EngineState sta
index.autoModeStopped();
ImmutableList allApps = ImmutableSLList.nil();
- for (SequentFormula sf : g.node().sequent().antecedent()) {
+ for (Term sf : g.node().sequent().antecedent()) {
if (!isFormulaSearchedFor(p, sf, services)) {
continue;
}
@@ -294,7 +294,7 @@ private ImmutableList findAllTacletApps(Parameters p, EngineState sta
new PosInOccurrence(sf, PosInTerm.getTopLevel(), true), services));
}
- for (SequentFormula sf : g.node().sequent().succedent()) {
+ for (Term sf : g.node().sequent().succedent()) {
if (!isFormulaSearchedFor(p, sf, services)) {
continue;
}
@@ -307,21 +307,21 @@ private ImmutableList findAllTacletApps(Parameters p, EngineState sta
}
/**
- * Returns true iff the given {@link SequentFormula} either matches the
+ * Returns true iff the given {@link Term} either matches the
* {@link Parameters#formula} parameter or its String representation matches the
* {@link Parameters#matches} regex. If both parameters are not supplied, always returns true.
*
* @param p The {@link Parameters} object.
- * @param sf The {@link SequentFormula} to check.
+ * @param sf The {@link Term} to check.
* @return true if sf matches.
*/
- private boolean isFormulaSearchedFor(Parameters p, SequentFormula sf, Services services)
+ private boolean isFormulaSearchedFor(Parameters p, Term sf, Services services)
throws ScriptException {
final boolean satisfiesFormulaParameter =
- p.formula != null && sf.formula().equalsModProperty(p.formula, RENAMING_PROPERTY);
+ p.formula != null && sf.equalsModProperty(p.formula, RENAMING_PROPERTY);
final boolean satisfiesMatchesParameter = p.matches != null
- && formatTermString(LogicPrinter.quickPrintTerm(sf.formula(), services))
+ && formatTermString(LogicPrinter.quickPrintTerm(sf, services))
.matches(".*" + p.matches + ".*");
return (p.formula == null && p.matches == null) || satisfiesFormulaParameter
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/SelectCommand.java b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/SelectCommand.java
index f43592bde92..e62b8222786 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/SelectCommand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/SelectCommand.java
@@ -11,7 +11,6 @@
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.macros.scripts.meta.Option;
import de.uka.ilkd.key.proof.Goal;
@@ -134,8 +133,8 @@ private boolean contains(Sequent seq, Term formula) {
}
private boolean contains(Semisequent semiseq, Term formula) {
- for (SequentFormula sf : semiseq.asList()) {
- if (sf.formula().equalsModProperty(formula, RENAMING_PROPERTY)) {
+ for (Term sf : semiseq.asList()) {
+ if (sf.equalsModProperty(formula, RENAMING_PROPERTY)) {
return true;
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/UnhideCommand.java b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/UnhideCommand.java
index 1a1bfcf4055..4399ad0beba 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/UnhideCommand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/macros/scripts/UnhideCommand.java
@@ -59,10 +59,14 @@ public void execute(Parameters args) throws ScriptException, InterruptedExceptio
Goal goal = state.getFirstOpenAutomaticGoal();
Set antes = new HashSet<>();
- args.sequent.antecedent().forEach(sf -> antes.add(sf.formula()));
+ args.sequent.antecedent().forEach(sf -> {
+ antes.add(sf);
+ });
Set succs = new HashSet<>();
- args.sequent.succedent().forEach(sf -> succs.add(sf.formula()));
+ args.sequent.succedent().forEach(sf -> {
+ succs.add(sf);
+ });
RuleAppIndex index = goal.ruleAppIndex();
ImmutableList apps = index.getNoFindTaclet(FILTER, service);
diff --git a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ExpressionBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ExpressionBuilder.java
index 1d638f33534..dab8f44a1a1 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ExpressionBuilder.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ExpressionBuilder.java
@@ -559,13 +559,13 @@ public Object visitTermorseq(KeYParser.TermorseqContext ctx) {
if (head != null && ss != null) {
// A sequent with only head in the antecedent.
Semisequent ant = Semisequent.EMPTY_SEMISEQUENT;
- ant = ant.insertFirst(new SequentFormula(head)).semisequent();
+ ant = ant.insertFirst(head).semisequent();
return Sequent.createSequent(ant, ss);
}
if (head != null && s != null) {
// A sequent. Prepend head to the antecedent.
Semisequent newAnt = s.antecedent();
- newAnt = newAnt.insertFirst(new SequentFormula(head)).semisequent();
+ newAnt = newAnt.insertFirst(head).semisequent();
return Sequent.createSequent(newAnt, s.succedent());
}
if (ss != null) {
@@ -583,7 +583,7 @@ public Semisequent visitSemisequent(KeYParser.SemisequentContext ctx) {
}
Term head = accept(ctx.term());
if (head != null) {
- ss = ss.insertFirst(new SequentFormula(head)).semisequent();
+ ss = ss.insertFirst(head).semisequent();
}
return ss;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ProblemFinder.java b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ProblemFinder.java
index 02b4702e60d..dfbc3c110b1 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ProblemFinder.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/ProblemFinder.java
@@ -104,7 +104,7 @@ public ProblemFinder(Services services, NamespaceSet nss) {
if (obj instanceof Sequent s)
return s;
if (obj instanceof Term t)
- return Sequent.createSuccSequent(new Semisequent(new SequentFormula(t)));
+ return Sequent.createSuccSequent(new Semisequent(t));
return null;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java
index 3e558815f71..05f0191628e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java
@@ -151,7 +151,7 @@ public Taclet visitTaclet(KeYParser.TacletContext ctx) {
}
TacletBuilder> b = createTacletBuilderFor(null, RewriteTaclet.NONE, ctx);
currentTBuilder.push(b);
- SequentFormula sform = new SequentFormula(form);
+ Term sform = form;
Semisequent semi = new Semisequent(sform);
Sequent addSeq = Sequent.createAnteSequent(semi);
ImmutableList noTaclets = ImmutableSLList.nil();
@@ -322,8 +322,9 @@ private TacletBuilder extends Taclet> createDeconstructorEQTaclet(
var res = schemaVariables[argIndex];
tacletBuilder.setFind(tb.func(function, tb.var(x)));
+ Term uAssumptions = tb.equals(tb.var(x), tb.func(consFn, args));
tacletBuilder.setIfSequent(Sequent.createAnteSequent(
- new Semisequent(new SequentFormula(tb.equals(tb.var(x), tb.func(consFn, args))))));
+ new Semisequent(uAssumptions)));
tacletBuilder.addTacletGoalTemplate(new RewriteTacletGoalTemplate(tb.var(res)));
tacletBuilder.setApplicationRestriction(RewriteTaclet.SAME_UPDATE_LEVEL);
@@ -350,7 +351,7 @@ private TacletBuilder extends Taclet> createInductionTaclet(
var use = tb.all(qvar, tb.var(phi));
var useCase = new TacletGoalTemplate(
- Sequent.createAnteSequent(new Semisequent(new SequentFormula(use))),
+ Sequent.createAnteSequent(new Semisequent(use)),
ImmutableSLList.nil());
useCase.setName("Use case of " + ctx.name.getText());
cases.add(useCase);
@@ -364,7 +365,7 @@ private TacletGoalTemplate createGoalDtConstructor(KeYParser.Datatype_constructo
VariableSV qvar, Term var, Sort sort) {
var constr = createQuantifiedFormula(it, qvar, var, sort);
var goal = new TacletGoalTemplate(
- Sequent.createSuccSequent(new Semisequent(new SequentFormula(constr))),
+ Sequent.createSuccSequent(new Semisequent(constr)),
ImmutableSLList.nil());
goal.setName(it.getText());
return goal;
@@ -393,7 +394,7 @@ private RewriteTacletBuilder createAxiomTaclet(
var axiom = tb.equals(find, tb.and(cases));
var goal = new TacletGoalTemplate(
- Sequent.createAnteSequent(new Semisequent(new SequentFormula(axiom))),
+ Sequent.createAnteSequent(new Semisequent(axiom)),
ImmutableSLList.nil());
tacletBuilder.addTacletGoalTemplate(goal);
@@ -474,8 +475,9 @@ private RewriteTacletBuilder createConstructorSplit(
for (int i = 0; i < args.length; i++) {
args[i] = variables.get(context.argName.get(i).getText());
}
+ Term uAssumptions = tb.equals(tb.var(phi), tb.func(func, args));
Semisequent antec =
- new Semisequent(new SequentFormula(tb.equals(tb.var(phi), tb.func(func, args))));
+ new Semisequent(uAssumptions);
Sequent addedSeq = Sequent.createAnteSequent(antec);
TacletGoalTemplate goal = new TacletGoalTemplate(addedSeq, ImmutableSLList.nil());
goal.setName("#var = " + context.name.getText());
@@ -757,14 +759,14 @@ public ImmutableList visitTacletlist(KeYParser.TacletlistContext ctx) {
if (findSeq.isEmpty()) {
return new NoFindTacletBuilder();
} else if (findSeq.antecedent().size() == 1 && findSeq.succedent().isEmpty()) {
- Term findFma = findSeq.antecedent().get(0).formula();
+ Term findFma = findSeq.antecedent().get(0);
AntecTacletBuilder b = new AntecTacletBuilder();
b.setFind(findFma);
b.setIgnoreTopLevelUpdates(
(applicationRestriction & RewriteTaclet.IN_SEQUENT_STATE) == 0);
return b;
} else if (findSeq.antecedent().isEmpty() && findSeq.succedent().size() == 1) {
- Term findFma = findSeq.succedent().get(0).formula();
+ Term findFma = findSeq.succedent().get(0);
SuccTacletBuilder b = new SuccTacletBuilder();
b.setFind(findFma);
b.setIgnoreTopLevelUpdates(
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/HideSequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/HideSequentPrintFilter.java
index cf6c0156476..1e5667184c7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/HideSequentPrintFilter.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/HideSequentPrintFilter.java
@@ -7,7 +7,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.pp.IdentitySequentPrintFilter.IdentityFilterEntry;
import org.key_project.util.collection.ImmutableSLList;
@@ -32,7 +32,7 @@ public HideSequentPrintFilter(SequentViewLogicPrinter lp, boolean regex) {
@Override
protected void filterSequent() {
- Iterator it;
+ Iterator it;
if (antec != null) {
// Result has already been computed. No need to recompute.
@@ -53,7 +53,7 @@ protected void filterSequent() {
antec = ImmutableSLList.nil();
it = originalSequent.antecedent().iterator();
while (it.hasNext()) {
- SequentFormula sf = it.next();
+ Term sf = it.next();
lp.reset();
lp.printConstrainedFormula(sf);
String formString = lp.result();
@@ -66,7 +66,7 @@ protected void filterSequent() {
succ = ImmutableSLList.nil();
it = originalSequent.succedent().iterator();
while (it.hasNext()) {
- SequentFormula sf = it.next();
+ Term sf = it.next();
lp.reset();
lp.printConstrainedFormula(sf);
String formString = lp.result();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/IdentitySequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/IdentitySequentPrintFilter.java
index ae73d537ebb..6230c2ea20b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/IdentitySequentPrintFilter.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/IdentitySequentPrintFilter.java
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.pp;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import org.key_project.util.collection.ImmutableList;
@@ -24,11 +24,11 @@ protected void filterSequent() {
/**
*
- * @param sequentFormula the formula to filter
+ * @param fml the formula to filter
* @return the FilterEntry from the formula
*/
- protected SequentPrintFilterEntry filterFormula(SequentFormula sequentFormula) {
- return new IdentityFilterEntry(sequentFormula);
+ protected SequentPrintFilterEntry filterFormula(Term fml) {
+ return new IdentityFilterEntry(fml);
}
/**
@@ -60,14 +60,14 @@ public static class IdentityFilterEntry implements SequentPrintFilterEntry {
/**
* the original Formula being filtered
*/
- final SequentFormula originalFormula;
+ final Term originalFormula;
/**
* constructor
*
* @param originalFormula the original formula to be filtered
*/
- IdentityFilterEntry(SequentFormula originalFormula) {
+ IdentityFilterEntry(Term originalFormula) {
this.originalFormula = originalFormula;
}
@@ -76,7 +76,7 @@ public static class IdentityFilterEntry implements SequentPrintFilterEntry {
*
* @return the original formula
*/
- public SequentFormula getFilteredFormula() {
+ public Term getFilteredFormula() {
return originalFormula;
}
@@ -85,7 +85,7 @@ public SequentFormula getFilteredFormula() {
*
* @return the original formula
*/
- public SequentFormula getOriginalFormula() {
+ public Term getOriginalFormula() {
return originalFormula;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/InitialPositionTable.java b/key.core/src/main/java/de/uka/ilkd/key/pp/InitialPositionTable.java
index 33a568bcc7b..854726f7709 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/InitialPositionTable.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/InitialPositionTable.java
@@ -5,7 +5,7 @@
import de.uka.ilkd.key.logic.IntIterator;
import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
@@ -13,7 +13,7 @@
/**
* An InitialPositionTable is a PositionTable that describes the beginning of the element/subelement
* relationship. Thus, an InitialPositionTable describes the information on where the
- * {@link SequentFormula}e of a sequent are located. It is the root of the tree of PositionTables
+ * {@link Term}e of a sequent are located. It is the root of the tree of PositionTables
* and may be asked for a PosInSequent for a given index position and a given Sequent.
*
*
@@ -80,7 +80,7 @@ private PosInSequent getTopPIS(ImmutableList posList, SequentPrintFilte
/**
* Returns the path for a given PosInOccurrence. This is built up from the initial 0, the number
- * of the SequentFormula in the sequent, the position in the constrained formula, and possibly
+ * of the Term in the sequent, the position in the constrained formula, and possibly
* inside a Metavariable instantiation.
*
* @param pio the given PosInOccurrence
@@ -90,7 +90,7 @@ private PosInSequent getTopPIS(ImmutableList posList, SequentPrintFilte
public ImmutableList pathForPosition(PosInOccurrence pio, SequentPrintFilter filter) {
ImmutableList p = ImmutableSLList.nil();
p = prependPathInFormula(p, pio);
- int index = indexOfCfma(pio.sequentFormula(), filter);
+ int index = indexOfCfma(pio.sequentLevelFormula(), filter);
if (index == -1) {
return null;
}
@@ -116,7 +116,7 @@ private ImmutableList prependPathInFormula(ImmutableList p,
* @param filter the current filter
* @return the index of the given formula in the sequent as printed
*/
- private int indexOfCfma(SequentFormula cfma, SequentPrintFilter filter) {
+ private int indexOfCfma(Term cfma, SequentPrintFilter filter) {
ImmutableList list =
filter.getFilteredAntec().append(filter.getFilteredSucc());
int k;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/LogicPrinter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/LogicPrinter.java
index 11deca874c7..0ab328fcaf8 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/LogicPrinter.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/LogicPrinter.java
@@ -751,8 +751,8 @@ public void printSemisequent(ImmutableList formulas) {
*
* @param cfma the constrained formula to be printed
*/
- public void printConstrainedFormula(SequentFormula cfma) {
- printTerm(cfma.formula());
+ public void printConstrainedFormula(Term cfma) {
+ printTerm(cfma);
}
/**
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/PosInSequent.java b/key.core/src/main/java/de/uka/ilkd/key/pp/PosInSequent.java
index ce8f82b1e2a..93a17a13cc6 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/PosInSequent.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/PosInSequent.java
@@ -31,11 +31,11 @@ public static PosInSequent createSequentPos() {
}
/**
- * creates a PosInSequent that points to a SequentFormula described by a PosInOccurrence.
- * Additionally a boolean indicates whether the the whole SequentFormula or just the formula is
+ * creates a PosInSequent that points to a Term described by a PosInOccurrence.
+ * Additionally a boolean indicates whether the the whole Term or just the formula is
* meant.
*
- * @param posInOcc the PositionInOccurrence describing the SequentFormula and maybe a subterm of
+ * @param posInOcc the PositionInOccurrence describing the Term and maybe a subterm of
* its formula.
*/
public static PosInSequent createCfmaPos(PosInOccurrence posInOcc) {
@@ -92,7 +92,7 @@ public Range getFirstJavaStatementRange() {
/**
- * returns the PosInOccurrence if the PosInSequent marks a SequentFormula or parts of it, null
+ * returns the PosInOccurrence if the PosInSequent marks a Term or parts of it, null
* otherwise.
*/
public PosInOccurrence getPosInOccurrence() {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/PositionTable.java b/key.core/src/main/java/de/uka/ilkd/key/pp/PositionTable.java
index 1ffebb4e6d7..1ba59a1e63e 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/PositionTable.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/PositionTable.java
@@ -5,7 +5,7 @@
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.PosInTerm;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
@@ -44,7 +44,7 @@ public class PositionTable {
private final int rows;
/**
- * creates a new PositionTable with the number of subterms (or number of SequentFormula in a
+ * creates a new PositionTable with the number of subterms (or number of Term in a
* Semisequent, or the number of Semisequents in a Sequent, etc.)
*
* @param rows the number of direct sub-elements in the term whose position information is
@@ -243,7 +243,7 @@ protected PosInSequent getSequentPIS(ImmutableList posList,
// This can raise a NPE sporadically. (MU 19)
// This raises an NPE repeatably (JS/MU 21) #1650
- SequentFormula cfma = filterEntry.getOriginalFormula();
+ Term cfma = filterEntry.getOriginalFormula();
PosInOccurrence currentPos = new PosInOccurrence(cfma, PosInTerm.getTopLevel(),
filter.getOriginalSequent().antecedent().contains(cfma));
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/RegroupSequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/RegroupSequentPrintFilter.java
index b2ec7475952..85ad34827a4 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/RegroupSequentPrintFilter.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/RegroupSequentPrintFilter.java
@@ -7,7 +7,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.pp.IdentitySequentPrintFilter.IdentityFilterEntry;
import org.key_project.util.collection.ImmutableSLList;
@@ -33,7 +33,7 @@ public RegroupSequentPrintFilter(SequentViewLogicPrinter lp, boolean regex) {
@Override
protected void filterSequent() {
- Iterator it;
+ Iterator it;
if (searchString == null || searchString.length() < 3) {
filterIdentity();
@@ -48,7 +48,7 @@ protected void filterSequent() {
antec = ImmutableSLList.nil();
it = originalSequent.antecedent().iterator();
while (it.hasNext()) {
- SequentFormula sf = it.next();
+ Term sf = it.next();
lp.reset();
lp.printConstrainedFormula(sf);
String formString = lp.result();
@@ -63,7 +63,7 @@ protected void filterSequent() {
succ = ImmutableSLList.nil();
it = originalSequent.succedent().iterator();
while (it.hasNext()) {
- SequentFormula sf = it.next();
+ Term sf = it.next();
lp.reset();
lp.printConstrainedFormula(sf);
String formString = lp.result();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java
index 0018fe2a215..4d54c77793a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java
@@ -6,7 +6,7 @@
import java.util.Iterator;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.pp.IdentitySequentPrintFilter.IdentityFilterEntry;
import org.key_project.util.collection.ImmutableList;
@@ -83,7 +83,7 @@ public ImmutableList getFilteredSucc() {
*/
protected void filterIdentity() {
antec = ImmutableSLList.nil();
- Iterator it = originalSequent.antecedent().iterator();
+ Iterator it = originalSequent.antecedent().iterator();
while (it.hasNext()) {
antec = antec.append(new IdentityFilterEntry(it.next()));
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilterEntry.java b/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilterEntry.java
index dd1e2b42fad..91129b4dc5f 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilterEntry.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilterEntry.java
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.pp;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
/**
@@ -15,11 +15,11 @@ public interface SequentPrintFilterEntry {
/**
* Formula to display
*/
- SequentFormula getFilteredFormula();
+ Term getFilteredFormula();
/**
* Original formula from sequent
*/
- SequentFormula getOriginalFormula();
+ Term getOriginalFormula();
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/pp/ShowSelectedSequentPrintFilter.java b/key.core/src/main/java/de/uka/ilkd/key/pp/ShowSelectedSequentPrintFilter.java
index 9ac6e9acc4b..ac229e5c847 100755
--- a/key.core/src/main/java/de/uka/ilkd/key/pp/ShowSelectedSequentPrintFilter.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/pp/ShowSelectedSequentPrintFilter.java
@@ -4,7 +4,7 @@
package de.uka.ilkd.key.pp;
import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
@@ -65,25 +65,26 @@ public static final class Entry implements SequentPrintFilterEntry {
/**
* The filtered formula, i.e., the formula at {@code pos}.
*/
- private final SequentFormula filtered;
+ private final Term filtered;
/**
* The origin formula, i.e., the formula at {@code pos.getTopLevel()}.
*/
- private final SequentFormula original;
+ private final Term original;
private Entry(PosInOccurrence pos) {
- filtered = new SequentFormula(pos.subTerm());
- original = pos.sequentFormula();
+ Term uAssumptions = pos.subTerm();
+ filtered = uAssumptions;
+ original = pos.sequentLevelFormula();
}
@Override
- public SequentFormula getFilteredFormula() {
+ public Term getFilteredFormula() {
return filtered;
}
@Override
- public SequentFormula getOriginalFormula() {
+ public Term getOriginalFormula() {
return original;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleAppIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleAppIndex.java
index 350d9f0d849..4b65c4f88f9 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleAppIndex.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/BuiltInRuleAppIndex.java
@@ -87,13 +87,13 @@ private void scanSimplificationRule(ImmutableList rules, Goal goal,
final Node node = goal.node();
final Sequent seq = node.sequent();
- for (final SequentFormula sf : (antec ? seq.antecedent() : seq.succedent())) {
+ for (final Term sf : (antec ? seq.antecedent() : seq.succedent())) {
scanSimplificationRule(rules, goal, antec, sf, listener);
}
}
private void scanSimplificationRule(ImmutableList rules, Goal goal, boolean antec,
- SequentFormula cfma, NewRuleListener listener) {
+ Term cfma, NewRuleListener listener) {
final PosInOccurrence pos = new PosInOccurrence(cfma, PosInTerm.getTopLevel(), antec);
ImmutableList subrules = ImmutableSLList.nil();
while (!rules.isEmpty()) {
@@ -145,9 +145,9 @@ public void sequentChanged(Goal goal, SequentChangeInfo sci, NewRuleListener lis
private void scanAddedFormulas(Goal goal, boolean antec, SequentChangeInfo sci,
NewRuleListener listener) {
- ImmutableList cfmas = sci.addedFormulas(antec);
+ ImmutableList cfmas = sci.addedFormulas(antec);
while (!cfmas.isEmpty()) {
- final SequentFormula cfma = cfmas.head();
+ final Term cfma = cfmas.head();
scanSimplificationRule(index.rules(), goal, antec, cfma, listener);
cfmas = cfmas.tail();
}
@@ -160,7 +160,7 @@ private void scanModifiedFormulas(Goal goal, boolean antec, SequentChangeInfo sc
while (!fcis.isEmpty()) {
final FormulaChangeInfo fci = fcis.head();
- final SequentFormula cfma = fci.newFormula();
+ final Term cfma = fci.newFormula();
scanSimplificationRule(index.rules(), goal, antec, cfma, listener);
fcis = fcis.tail();
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/FormulaTagManager.java b/key.core/src/main/java/de/uka/ilkd/key/proof/FormulaTagManager.java
index b71df3fa24a..415d2d1869c 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/FormulaTagManager.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/FormulaTagManager.java
@@ -102,7 +102,7 @@ private void updateTags(SequentChangeInfo sci, boolean p_antec, Goal p_goal) {
}
private void addTags(SequentChangeInfo sci, boolean p_antec, Goal p_goal) {
- for (SequentFormula constrainedFormula : sci.addedFormulas(p_antec)) {
+ for (Term constrainedFormula : sci.addedFormulas(p_antec)) {
final PosInOccurrence pio =
new PosInOccurrence(constrainedFormula, PosInTerm.getTopLevel(), p_antec);
createNewTag(pio, p_goal);
@@ -110,7 +110,7 @@ private void addTags(SequentChangeInfo sci, boolean p_antec, Goal p_goal) {
}
private void removeTags(SequentChangeInfo sci, boolean p_antec, Goal p_goal) {
- for (SequentFormula constrainedFormula : sci.removedFormulas(p_antec)) {
+ for (Term constrainedFormula : sci.removedFormulas(p_antec)) {
final PosInOccurrence pio =
new PosInOccurrence(constrainedFormula, PosInTerm.getTopLevel(), p_antec);
removeTag(pio);
@@ -148,7 +148,7 @@ private void createNewTags(Goal p_goal, boolean p_antec) {
final Sequent seq = p_goal.sequent();
final Semisequent ss = p_antec ? seq.antecedent() : seq.succedent();
- for (SequentFormula s : ss) {
+ for (Term s : ss) {
final PosInOccurrence pio = new PosInOccurrence(s, PosInTerm.getTopLevel(), p_antec);
createNewTag(pio, p_goal);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java b/key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java
index 9885acd6145..48e08240c3b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java
@@ -379,10 +379,10 @@ public void setSequent(SequentChangeInfo sci) {
* adds a formula to the sequent before the given position and informs the rule application
* index about this change
*
- * @param cf the SequentFormula to be added
+ * @param cf the Term to be added
* @param p PosInOccurrence encodes the position
*/
- public void addFormula(SequentFormula cf, PosInOccurrence p) {
+ public void addFormula(Term cf, PosInOccurrence p) {
setSequent(sequent().addFormula(cf, p));
}
@@ -390,12 +390,12 @@ public void addFormula(SequentFormula cf, PosInOccurrence p) {
* adds a formula to the antecedent or succedent of a sequent. Either at its front or back and
* informs the rule application index about this change
*
- * @param cf the SequentFormula to be added
- * @param inAntec boolean true(false) if SequentFormula has to be added to antecedent
+ * @param cf the Term to be added
+ * @param inAntec boolean true(false) if Term has to be added to antecedent
* (succedent)
* @param first boolean true if at the front, if false then cf is added at the back
*/
- public void addFormula(SequentFormula cf, boolean inAntec, boolean first) {
+ public void addFormula(Term cf, boolean inAntec, boolean first) {
setSequent(sequent().addFormula(cf, inAntec, first));
}
@@ -403,10 +403,10 @@ public void addFormula(SequentFormula cf, boolean inAntec, boolean first) {
* replaces a formula at the given position and informs the rule application index about this
* change
*
- * @param cf the SequentFormula replacing the old one
+ * @param cf the Term replacing the old one
* @param p the PosInOccurrence encoding the position
*/
- public void changeFormula(SequentFormula cf, PosInOccurrence p) {
+ public void changeFormula(Term cf, PosInOccurrence p) {
setSequent(sequent().changeFormula(cf, p));
}
@@ -607,10 +607,10 @@ public ImmutableList apply(final RuleApp ruleApp) {
* caught.
*/
NamespaceSet originalNamespaces = getLocalNamespaces();
- Services overlayServices = proof.getServices().getOverlay(originalNamespaces);
final ImmutableList goalList;
var time = System.nanoTime();
try {
+ Services overlayServices = proof.getServices().getOverlay(originalNamespaces);
goalList = ruleApp.execute(this, overlayServices);
} finally {
PERF_APP_EXECUTE.getAndAdd(System.nanoTime() - time);
@@ -702,12 +702,12 @@ public void makeLocalNamespacesFrom(NamespaceSet ns) {
public List getAllBuiltInRuleApps() {
final BuiltInRuleAppIndex index = ruleAppIndex().builtInRuleAppIndex();
LinkedList ruleApps = new LinkedList<>();
- for (SequentFormula sf : node().sequent().antecedent()) {
+ for (Term sf : node().sequent().antecedent()) {
ImmutableList t =
index.getBuiltInRule(this, new PosInOccurrence(sf, PosInTerm.getTopLevel(), true));
t.forEach(ruleApps::add);
}
- for (SequentFormula sf : node().sequent().succedent()) {
+ for (Term sf : node().sequent().succedent()) {
ImmutableList t =
index.getBuiltInRule(this, new PosInOccurrence(sf, PosInTerm.getTopLevel(), false));
t.forEach(ruleApps::add);
@@ -725,13 +725,13 @@ protected boolean filter(Taclet taclet) {
return true;
}
};
- for (SequentFormula sf : node().sequent().antecedent()) {
+ for (Term sf : node().sequent().antecedent()) {
ImmutableList tacletAppAtAndBelow = index.getTacletAppAtAndBelow(filter,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), true), services);
tacletAppAtAndBelow.forEach(allApps::add);
}
- for (SequentFormula sf : node().sequent().succedent()) {
+ for (Term sf : node().sequent().succedent()) {
ImmutableList tacletAppAtAndBelow = index.getTacletAppAtAndBelow(filter,
new PosInOccurrence(sf, PosInTerm.getTopLevel(), false), services);
tacletAppAtAndBelow.forEach(allApps::add);
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/ProgVarReplacer.java b/key.core/src/main/java/de/uka/ilkd/key/proof/ProgVarReplacer.java
index 730707056a3..bbf6a42dad3 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/ProgVarReplacer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/ProgVarReplacer.java
@@ -144,9 +144,8 @@ public SVInstantiations replace(SVInstantiations insts) {
result = result.replace(sv, newA, services);
}
} else if (ie instanceof TermInstantiation) {
- Term t = (Term) inst;
- Term newT = replace(t);
- if (newT != t) {
+ Term newT = replace((Term) inst);
+ if (newT != inst) {
result = result.replace(sv, newT, services);
}
} else {
@@ -183,11 +182,11 @@ public SemisequentChangeInfo replace(Semisequent s) {
SemisequentChangeInfo result = new SemisequentChangeInfo();
result.setFormulaList(s.asList());
- final Iterator it = s.iterator();
+ final Iterator it = s.iterator();
for (int formulaNumber = 0; it.hasNext(); formulaNumber++) {
- final SequentFormula oldcf = it.next();
- final SequentFormula newcf = replace(oldcf);
+ final Term oldcf = it.next();
+ final Term newcf = replace(oldcf);
if (newcf != oldcf) {
result.combine(result.semisequent().replace(formulaNumber, newcf));
@@ -197,22 +196,6 @@ public SemisequentChangeInfo replace(Semisequent s) {
return result;
}
-
- /**
- * replaces in a constrained formula
- */
- public SequentFormula replace(SequentFormula cf) {
- SequentFormula result = cf;
-
- final Term newFormula = replace(cf.formula());
-
- if (newFormula != cf.formula()) {
- result = new SequentFormula(newFormula);
- }
- return result;
- }
-
-
private Term replaceProgramVariable(Term t) {
final ProgramVariable pv = (ProgramVariable) t.op();
ProgramVariable o = map.get(pv);
@@ -222,7 +205,6 @@ private Term replaceProgramVariable(Term t) {
return t;
}
-
private Term standardReplace(Term t) {
Term result = t;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/Proof.java b/key.core/src/main/java/de/uka/ilkd/key/proof/Proof.java
index 1fb6157a6c0..e8121005091 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/Proof.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/Proof.java
@@ -242,7 +242,7 @@ public Proof(String name, Sequent problem, String header, InitConfig initConfig,
public Proof(String name, Term problem, String header, InitConfig initConfig) {
this(name,
Sequent.createSuccSequent(
- Semisequent.EMPTY_SEMISEQUENT.insert(0, new SequentFormula(problem)).semisequent()),
+ Semisequent.EMPTY_SEMISEQUENT.insert(0, problem).semisequent()),
initConfig.createTacletIndex(), initConfig.createBuiltInRuleIndex(), initConfig);
problemHeader = header;
}
@@ -490,7 +490,6 @@ public ImmutableList openEnabledGoals() {
return filterEnabledGoals(openGoals);
}
-
/**
* filter those goals from a list which are enabled
*
@@ -509,15 +508,14 @@ private ImmutableList filterEnabledGoals(ImmutableList goals) {
return enabledGoals;
}
-
/**
* removes the given goal and adds the new goals in list
*
* @param oldGoal the old goal that has to be removed from list
- * @param newGoals the IList with the new goals that were result of a rule application on
- * goal
+ * @param newGoals the Iterable with the new goals that were result of a rule application
+ * on goal
*/
- public void replace(Goal oldGoal, ImmutableList newGoals) {
+ public void replace(Goal oldGoal, Iterable newGoals) {
openGoals = openGoals.removeAll(oldGoal);
if (closed()) {
@@ -632,6 +630,21 @@ public void add(ImmutableList goals) {
fireProofGoalsAdded(goals);
}
+ /**
+ * adds a list with new goals to the list of open goals
+ *
+ * @param goals the Iterable to be prepended
+ */
+ public void add(Iterable goals) {
+ ImmutableList addGoals;
+ if (goals instanceof ImmutableList asList) {
+ addGoals = asList;
+ } else {
+ addGoals = ImmutableList.fromList(goals);
+ }
+ add(addGoals);
+ }
+
/**
* returns true if the root node is marked as closed and all goals have been removed
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/SemisequentTacletAppIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/SemisequentTacletAppIndex.java
index f70243418f7..4a8c236ee6b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/SemisequentTacletAppIndex.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/SemisequentTacletAppIndex.java
@@ -24,7 +24,7 @@ public class SemisequentTacletAppIndex {
public static final AtomicLong PERF_ADD = new AtomicLong();
public static final AtomicLong PERF_REMOVE = new AtomicLong();
- private ImmutableMap termIndices =
+ private ImmutableMap termIndices =
DefaultImmutableMap.nilMap();
private TermTacletAppIndexCacheSet indexCaches;
@@ -38,10 +38,10 @@ public class SemisequentTacletAppIndex {
* Add indices for the given formulas to the map termIndices. Existing entries are
* replaced with the new indices. Note: destructive, use only when constructing new index
*/
- private void addTermIndices(ImmutableList cfmas, Services services,
+ private void addTermIndices(ImmutableList cfmas, Services services,
TacletIndex tacletIndex, NewRuleListener listener) {
while (!cfmas.isEmpty()) {
- final SequentFormula cfma = cfmas.head();
+ final Term cfma = cfmas.head();
cfmas = cfmas.tail();
addTermIndex(cfma, services, tacletIndex, listener);
}
@@ -51,7 +51,7 @@ private void addTermIndices(ImmutableList cfmas, Services servic
* Add an index for the given formula to the map termIndices. An existing entry is
* replaced with the new one. Note: destructive, use only when constructing new index
*/
- private void addTermIndex(SequentFormula cfma, Services services,
+ private void addTermIndex(Term cfma, Services services,
TacletIndex tacletIndex, NewRuleListener listener) {
final PosInOccurrence pos = new PosInOccurrence(cfma, PosInTerm.getTopLevel(), antec);
termIndices = termIndices.put(cfma, TermTacletAppIndex.create(pos, services, tacletIndex,
@@ -63,7 +63,7 @@ private void addTermIndex(SequentFormula cfma, Services services,
* termIndices, by adding the taclets that are selected by filter
* Note: destructive, use only when constructing new index
*/
- private void addTaclets(RuleFilter filter, SequentFormula cfma, Services services,
+ private void addTaclets(RuleFilter filter, Term cfma, Services services,
TacletIndex tacletIndex, NewRuleListener listener) {
final TermTacletAppIndex oldIndex = termIndices.get(cfma);
assert oldIndex != null : "Term index that is supposed to be updated " + "does not exist";
@@ -78,8 +78,8 @@ private void addTaclets(RuleFilter filter, SequentFormula cfma, Services service
* Remove the indices for the given formulas from the map termIndices. Note:
* destructive, use only when constructing new index
*/
- private void removeTermIndices(ImmutableList cfmas) {
- for (SequentFormula cfma : cfmas) {
+ private void removeTermIndices(ImmutableList cfmas) {
+ for (Term cfma : cfmas) {
removeTermIndex(cfma);
}
}
@@ -88,7 +88,7 @@ private void removeTermIndices(ImmutableList cfmas) {
* Remove the index for the given formula from the map termIndices. Note:
* destructive, use only when constructing new index
*/
- private void removeTermIndex(SequentFormula cfma) {
+ private void removeTermIndex(Term cfma) {
termIndices = termIndices.remove(cfma);
}
@@ -102,7 +102,7 @@ private List removeFormulas(ImmutableList
var oldIndices = new ArrayList(infos.size());
for (FormulaChangeInfo info : infos) {
- final SequentFormula oldFor = info.getOriginalFormula();
+ final Term oldFor = info.getOriginalFormula();
oldIndices.add(termIndices.get(oldFor));
removeTermIndex(oldFor);
@@ -125,7 +125,7 @@ private void updateTermIndices(List oldIndices,
while (infoIt.hasNext()) {
final FormulaChangeInfo info = infoIt.next();
- final SequentFormula newFor = info.newFormula();
+ final Term newFor = info.newFormula();
final TermTacletAppIndex oldIndex = oldIndexIt.next();
if (oldIndex == null)
@@ -184,7 +184,7 @@ public SemisequentTacletAppIndex copy() {
* Get term index for the formula to which position pos points
*/
private TermTacletAppIndex getTermIndex(PosInOccurrence pos) {
- return termIndices.get(pos.sequentFormula());
+ return termIndices.get(pos.sequentLevelFormula());
}
/**
@@ -240,7 +240,7 @@ public SemisequentTacletAppIndex sequentChanged(SequentChangeInfo sci, Services
public SemisequentTacletAppIndex addTaclets(RuleFilter filter, Services services,
TacletIndex tacletIndex, NewRuleListener listener) {
final SemisequentTacletAppIndex result = copy();
- final Iterator it = termIndices.keyIterator();
+ final Iterator it = termIndices.keyIterator();
while (it.hasNext()) {
result.addTaclets(filter, it.next(), services, tacletIndex, listener);
@@ -254,8 +254,8 @@ public SemisequentTacletAppIndex addTaclets(RuleFilter filter, Services services
* taclet app.
*/
void reportRuleApps(NewRuleListener l) {
- for (final ImmutableMapEntry entry : termIndices) {
- final SequentFormula cfma = entry.key();
+ for (final ImmutableMapEntry entry : termIndices) {
+ final Term cfma = entry.key();
final TermTacletAppIndex index = entry.value();
final PosInOccurrence pio = new PosInOccurrence(cfma, PosInTerm.getTopLevel(), antec);
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndex.java b/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndex.java
index 1af43522d9f..5b044a194db 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndex.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/TermTacletAppIndex.java
@@ -91,9 +91,9 @@ private static ImmutableList getFindTaclet(PosInOccurrence pos,
/**
- * collects all AntecedentTaclet instantiations for the given heuristics and SequentFormula
+ * collects all AntecedentTaclet instantiations for the given heuristics and Term
*
- * @param pos the PosInOccurrence of the SequentFormula the taclets have to be connected to (pos
+ * @param pos the PosInOccurrence of the Term the taclets have to be connected to (pos
* must point to the top level formula, i.e. pos.isTopLevel() must be true)
* @param services the Services object encapsulating information about the java datastructures
* like (static)types etc.
@@ -105,9 +105,9 @@ private static ImmutableList antecTaclet(PosInOccurrence pos, Ru
}
/**
- * collects all SuccedentTaclet instantiations for the given heuristics and SequentFormula
+ * collects all SuccedentTaclet instantiations for the given heuristics and Term
*
- * @param pos the PosInOccurrence of the SequentFormula the taclets have to be connected to (pos
+ * @param pos the PosInOccurrence of the Term the taclets have to be connected to (pos
* must point to the top level formula, i.e. pos.isTopLevel() must be true)
* @param services the Services object encapsulating information about the java datastructures
* like (static)types etc.
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/delayedcut/DelayedCutProcessor.java b/key.core/src/main/java/de/uka/ilkd/key/proof/delayedcut/DelayedCutProcessor.java
index cd0b76007b2..ee89b1abafc 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/delayedcut/DelayedCutProcessor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/delayedcut/DelayedCutProcessor.java
@@ -186,7 +186,7 @@ protected boolean filter(Taclet taclet) {
*/
private ImmutableList hide(DelayedCut cut, Goal goal) {
- SequentFormula sf = getSequentFormula(goal, cut.isDecisionPredicateInAntecendet());
+ Term sf = getTerm(goal, cut.isDecisionPredicateInAntecendet());
PosInOccurrence pio =
new PosInOccurrence(sf, PosInTerm.getTopLevel(), cut.isDecisionPredicateInAntecendet());
@@ -208,9 +208,9 @@ private int getGoalForHiding(ImmutableList goals, DelayedCut cut) {
String side = cut.isDecisionPredicateInAntecendet() ? "TRUE" : "FALSE";
if (goal[i].node().getNodeInfo().getBranchLabel().endsWith(side)) {
- SequentFormula formula =
- getSequentFormula(goal[i], cut.isDecisionPredicateInAntecendet());
- if (formula.formula() == cut.getFormula()) {
+ Term formula =
+ getTerm(goal[i], cut.isDecisionPredicateInAntecendet());
+ if (formula == cut.getFormula()) {
return i;
}
}
@@ -223,7 +223,7 @@ private String getHideTacletName(DelayedCut cut) {
return cut.isDecisionPredicateInAntecendet() ? HIDE_LEFT_TACLET : HIDE_RIGHT_TACLET;
}
- private SequentFormula getSequentFormula(Goal goal, boolean decPredInAnte) {
+ private Term getTerm(Goal goal, boolean decPredInAnte) {
return decPredInAnte ? goal.sequent().antecedent().get(DEC_PRED_INDEX)
: goal.sequent().succedent().get(DEC_PRED_INDEX);
@@ -390,7 +390,7 @@ private PosInOccurrence translate(NodeGoalPair pair, TermServices services) {
}
int formulaNumber =
pair.node.sequent().formulaNumberInSequent(oldRuleApp.posInOccurrence().isInAntec(),
- oldRuleApp.posInOccurrence().sequentFormula());
+ oldRuleApp.posInOccurrence().sequentLevelFormula());
return PosInOccurrence.findInSequent(pair.goal.sequent(), formulaNumber,
oldRuleApp.posInOccurrence().posInTerm());
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/init/ProblemInitializer.java b/key.core/src/main/java/de/uka/ilkd/key/proof/init/ProblemInitializer.java
index 4c089e3a4b5..0b2c712662f 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/init/ProblemInitializer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/init/ProblemInitializer.java
@@ -17,7 +17,6 @@
import de.uka.ilkd.key.ldt.HeapLDT;
import de.uka.ilkd.key.logic.Namespace;
import de.uka.ilkd.key.logic.NamespaceSet;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.OriginTermLabelFactory;
import de.uka.ilkd.key.logic.op.*;
@@ -377,8 +376,8 @@ private void populateNamespaces(Term term, NamespaceSet namespaces, Goal rootGoa
private void populateNamespaces(Proof proof) {
final NamespaceSet namespaces = proof.getNamespaces();
final Goal rootGoal = proof.openGoals().head();
- for (SequentFormula cf : proof.root().sequent()) {
- populateNamespaces(cf.formula(), namespaces, rootGoal);
+ for (Term cf : proof.root().sequent()) {
+ populateNamespaces(cf, namespaces, rootGoal);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java b/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java
index b40ef0409c1..7992e507085 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/io/IntermediateProofReplayer.java
@@ -495,7 +495,7 @@ private TacletApp constructTacletApp(TacletAppIntermediate currInterm, Goal curr
NamespaceSet nss = currGoal.getLocalNamespaces();
Term term = parseTerm(ifFormulaStr, proof, nss.variables(), nss.programVariables(),
nss.functions());
- ifFormulaList = ifFormulaList.append(new IfFormulaInstDirect(new SequentFormula(term)));
+ ifFormulaList = ifFormulaList.append(new IfFormulaInstDirect(term));
}
if (!ourApp.ifInstsCorrectSize(ifFormulaList)) {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/io/OutputStreamProofSaver.java b/key.core/src/main/java/de/uka/ilkd/key/proof/io/OutputStreamProofSaver.java
index 9bfd785e9e4..cf4e70129e7 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/io/OutputStreamProofSaver.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/io/OutputStreamProofSaver.java
@@ -172,8 +172,8 @@ public void save(OutputStream out) throws IOException {
strategyProperties.put(StrategyProperties.INF_FLOW_CHECK_PROPERTY,
StrategyProperties.INF_FLOW_CHECK_TRUE);
strategySettings.setActiveStrategyProperties(strategyProperties);
- for (final SequentFormula s : proof.root().sequent().succedent().asList()) {
- ((InfFlowProof) proof).addLabeledTotalTerm(s.formula());
+ for (final Term s : proof.root().sequent().succedent().asList()) {
+ ((InfFlowProof) proof).addLabeledTotalTerm(s);
}
} else {
strategyProperties.put(StrategyProperties.INF_FLOW_CHECK_PROPERTY,
@@ -694,7 +694,8 @@ public static String posInOccurrence2Proof(Sequent seq, PosInOccurrence pos) {
if (pos == null) {
return "";
}
- return " (formula \"" + seq.formulaNumberInSequent(pos.isInAntec(), pos.sequentFormula())
+ return " (formula \""
+ + seq.formulaNumberInSequent(pos.isInAntec(), pos.sequentLevelFormula())
+ "\")" + posInTerm2Proof(pos.posInTerm());
}
@@ -754,15 +755,16 @@ public String ifFormulaInsts(Node node, ImmutableList l)
StringBuilder s = new StringBuilder();
for (final IfFormulaInstantiation aL : l) {
if (aL instanceof IfFormulaInstSeq) {
- final SequentFormula f = aL.getConstrainedFormula();
+ final Term f = aL.getConstrainedFormula();
s.append(" (ifseqformula \"")
.append(node.sequent()
.formulaNumberInSequent(((IfFormulaInstSeq) aL).inAntec(), f))
.append("\")");
} else if (aL instanceof IfFormulaInstDirect) {
+ Term fml = aL.getConstrainedFormula();
final String directInstantiation =
- printTerm(aL.getConstrainedFormula().formula(), node.proof().getServices());
+ printTerm(fml, node.proof().getServices());
s.append(" (ifdirectformula \"").append(escapeCharacters(directInstantiation))
.append("\")");
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinIsApplicable.java b/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinIsApplicable.java
index 2568f3fe8cd..072a2aa0474 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinIsApplicable.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinIsApplicable.java
@@ -7,7 +7,6 @@
import java.util.List;
import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.op.UpdateApplication;
@@ -87,8 +86,8 @@ private ProspectivePartner areProspectivePartners(Goal g1, PosInOccurrence pio,
referenceFormula.op() instanceof UpdateApplication ? referenceFormula.sub(1)
: referenceFormula;
- for (SequentFormula sf : g2.sequent().succedent()) {
- Term formula = sf.formula();
+ for (Term sf : g2.sequent().succedent()) {
+ Term formula = sf;
Term update2 = tb.skip();
if (formula.op() instanceof UpdateApplication
&& !formula.equalsModProperty(referenceFormula, RENAMING_PROPERTY)) {
@@ -98,7 +97,8 @@ private ProspectivePartner areProspectivePartners(Goal g1, PosInOccurrence pio,
}
if (formula.equalsModProperty(referenceFormula, RENAMING_PROPERTY)) {
- return new ProspectivePartner(referenceFormula, g1.node(), pio.sequentFormula(),
+ return new ProspectivePartner(referenceFormula, g1.node(),
+ pio.sequentLevelFormula(),
update1, g2.node(), sf, update2);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinProcessor.java b/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinProcessor.java
index 48bf81f8d66..8f8429f1d06 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinProcessor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/join/JoinProcessor.java
@@ -115,15 +115,15 @@ private void processJoin() {
}
private void orRight(Goal goal) {
- SequentFormula sf = goal.sequent().succedent().get(0);
+ Term sf = goal.sequent().succedent().get(0);
PosInOccurrence pio = new PosInOccurrence(sf, PosInTerm.getTopLevel(), false);
apply(new String[] { OR_RIGHT_TACLET }, goal, pio);
}
- private SequentFormula findFormula(Sequent sequent, Term content, boolean antecedent) {
- for (SequentFormula sf : (antecedent ? sequent.antecedent() : sequent.succedent())) {
- if (sf.formula().equals(content)) {
+ private Term findFormula(Sequent sequent, Term content, boolean antecedent) {
+ for (Term sf : (antecedent ? sequent.antecedent() : sequent.succedent())) {
+ if (sf.equals(content)) {
return sf;
}
}
@@ -132,7 +132,7 @@ private SequentFormula findFormula(Sequent sequent, Term content, boolean antece
private Goal simplifyUpdate(Goal goal, DelayedCut cut) {
- SequentFormula sf = findFormula(goal.sequent(), cut.getFormula(), false);
+ Term sf = findFormula(goal.sequent(), cut.getFormula(), false);
PosInOccurrence pio = new PosInOccurrence(sf, PosInTerm.getTopLevel().down(0), false);
Goal result = apply(SIMPLIFY_UPDATE, goal, pio).head();
@@ -203,10 +203,12 @@ private Term createPhi() {
partner.getSequent(1).succedent(), partner.getCommonFormula());
Collection commonGamma = computeCommonFormulas(partner.getSequent(0).antecedent(),
partner.getSequent(1).antecedent(), partner.getCommonFormula());
+ Term partnerFormula = partner.getFormula(0);
Collection delta1 = computeDifference(partner.getSequent(0).succedent(), commonDelta,
- partner.getFormula(0).formula());
+ partnerFormula);
+ Term formula = partner.getFormula(1);
Collection delta2 = computeDifference(partner.getSequent(1).succedent(), commonDelta,
- partner.getFormula(1).formula());
+ formula);
Collection gamma1 =
computeDifference(partner.getSequent(0).antecedent(), commonGamma, null);
@@ -262,9 +264,9 @@ private Collection createConstrainedTerms(Collection terms, Term pre
private Collection computeCommonFormulas(Semisequent s1, Semisequent s2, Term exclude) {
TreeSet formulas1 = createTree(s1, exclude);
TreeSet result = createTree();
- for (SequentFormula sf : s2) {
- if (formulas1.contains(sf.formula())) {
- result.add(sf.formula());
+ for (Term sf : s2) {
+ if (formulas1.contains(sf)) {
+ result.add(sf);
}
}
return result;
@@ -273,9 +275,11 @@ private Collection computeCommonFormulas(Semisequent s1, Semisequent s2, T
private Collection computeDifference(Semisequent s, Collection excludeSet,
Term exclude) {
LinkedList result = new LinkedList<>();
- for (SequentFormula sf : s) {
- if (sf.formula() != exclude && !excludeSet.contains(sf.formula())) {
- result.add(sf.formula());
+ for (Term sf : s) {
+ if (sf != exclude) {
+ if (!excludeSet.contains(sf)) {
+ result.add(sf);
+ }
}
}
return result;
@@ -283,9 +287,9 @@ private Collection computeDifference(Semisequent s, Collection exclu
private TreeSet createTree(Semisequent semisequent, Term exclude) {
TreeSet set = createTree();
- for (SequentFormula sf : semisequent) {
- if (sf.formula() != exclude) {
- set.add(sf.formula());
+ for (Term sf : semisequent) {
+ if (sf != exclude) {
+ set.add(sf);
}
}
return set;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/join/LateApplicationCheck.java b/key.core/src/main/java/de/uka/ilkd/key/proof/join/LateApplicationCheck.java
index 1b9db61523b..076c8782067 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/join/LateApplicationCheck.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/join/LateApplicationCheck.java
@@ -7,7 +7,7 @@
import java.util.List;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.proof.Node;
import de.uka.ilkd.key.proof.delayedcut.ApplicationCheck;
@@ -27,8 +27,8 @@ public List check(Node node, Node cutNode, ApplicationCheck check) {
private List check(ApplicationCheck check, Sequent sequent, Node cutNode) {
List conflicts = new LinkedList<>();
- for (SequentFormula sf : sequent) {
- String result = check.check(cutNode, sf.formula());
+ for (Term sf : sequent) {
+ String result = check.check(cutNode, sf);
if (result != null) {
conflicts.add(result);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/join/ProspectivePartner.java b/key.core/src/main/java/de/uka/ilkd/key/proof/join/ProspectivePartner.java
index f7a26bc2dce..4d54f573f9f 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/join/ProspectivePartner.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/join/ProspectivePartner.java
@@ -4,7 +4,6 @@
package de.uka.ilkd.key.proof.join;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.proof.Node;
@@ -16,11 +15,11 @@
public class ProspectivePartner {
private final Term[] updates = new Term[2];
private final Term commonFormula;
- private final SequentFormula[] formula = new SequentFormula[2];
+ private final Term[] formula = new Term[2];
private final Node[] nodes = new Node[2];
private Term commonPredicate = null;
private Node commonParent = null;
- private SequentFormula formulaForHiding = null;
+ private Term formulaForHiding = null;
/**
* Constructs a new prospective partner object, i.e. a structure comprising the information
@@ -35,8 +34,8 @@ public class ProspectivePartner {
* @param formula2 The second join formula.
* @param update2 The second symbolic state.
*/
- public ProspectivePartner(Term commonFormula, Node node1, SequentFormula formula1, Term update1,
- Node node2, SequentFormula formula2, Term update2) {
+ public ProspectivePartner(Term commonFormula, Node node1, Term formula1, Term update1,
+ Node node2, Term formula2, Term update2) {
super();
this.commonFormula = commonFormula;
formula[0] = formula1;
@@ -72,15 +71,15 @@ public void setCommonParent(Node commonParent) {
if (commonParent.getAppliedRuleApp() != null
&& commonParent.getAppliedRuleApp().posInOccurrence() != null) {
setFormulaForHiding(
- commonParent.getAppliedRuleApp().posInOccurrence().sequentFormula());
+ commonParent.getAppliedRuleApp().posInOccurrence().sequentLevelFormula());
}
}
- private void setFormulaForHiding(SequentFormula formulaForHiding) {
+ private void setFormulaForHiding(Term formulaForHiding) {
this.formulaForHiding = formulaForHiding;
}
- public SequentFormula getFormulaForHiding() {
+ public Term getFormulaForHiding() {
return formulaForHiding;
}
@@ -92,7 +91,7 @@ public Sequent getSequent(int index) {
return getNode(index).sequent();
}
- public SequentFormula getFormula(int i) {
+ public Term getFormula(int i) {
return formula[i];
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java b/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java
index 396590b0fc6..a11a6d47007 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java
@@ -189,7 +189,8 @@ private static Taclet getUnlimitedToLimitedTaclet(IObserverFunction limited,
// create taclet
final RewriteTacletBuilder tacletBuilder = new RewriteTacletBuilder<>();
tacletBuilder.setFind(tb.func(unlimited, subs));
- final SequentFormula cf = new SequentFormula(tb.equals(limitedTerm, unlimitedTerm));
+ Term uAssumptions = tb.equals(limitedTerm, unlimitedTerm);
+ final Term cf = uAssumptions;
final Sequent addedSeq =
Sequent.createAnteSequent(Semisequent.EMPTY_SEMISEQUENT.insertFirst(cf).semisequent());
tacletBuilder.addTacletGoalTemplate(new RewriteTacletGoalTemplate(addedSeq,
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeReplacement.java b/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeReplacement.java
index 46f9447818b..6d1c9f0b213 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeReplacement.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/proofevent/NodeReplacement.java
@@ -12,7 +12,7 @@
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent;
import de.uka.ilkd.key.logic.SequentChangeInfo;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.proof.Node;
import org.key_project.util.collection.ImmutableList;
@@ -55,7 +55,7 @@ private void addNodeChanges() {
}
private void addNodeChange(SequentChangeInfo p_sci) {
- Iterator it;
+ Iterator it;
Iterator it2;
// ---
@@ -72,13 +72,13 @@ private void addNodeChange(SequentChangeInfo p_sci) {
// Information about modified formulas is currently not used
it2 = p_sci.modifiedFormulas(true).iterator();
while (it2.hasNext()) {
- addRemovedChange(it2.next().positionOfModification().sequentFormula(), true);
+ addRemovedChange(it2.next().positionOfModification().sequentLevelFormula(), true);
}
// Information about modified formulas is currently not used
it2 = p_sci.modifiedFormulas(false).iterator();
while (it2.hasNext()) {
- addRemovedChange(it2.next().positionOfModification().sequentFormula(), false);
+ addRemovedChange(it2.next().positionOfModification().sequentLevelFormula(), false);
}
it = p_sci.addedFormulas(true).iterator();
@@ -119,7 +119,7 @@ private void addNodeChange(SequentChangeInfo p_sci) {
}
- private void addAddedChange(SequentFormula p_cf, boolean p_inAntec) {
+ private void addAddedChange(Term p_cf, boolean p_inAntec) {
Sequent oldS = parent.sequent();
Semisequent oldSS = (p_inAntec ? oldS.antecedent() : oldS.succedent());
Sequent newS = node.sequent();
@@ -140,7 +140,7 @@ private void addAddedChange(SequentFormula p_cf, boolean p_inAntec) {
* @param p_cf
* @param p_inAntec
*/
- private void addAddedRedundantChange(SequentFormula p_cf, boolean p_inAntec) {
+ private void addAddedRedundantChange(Term p_cf, boolean p_inAntec) {
final PosInOccurrence pio = new PosInOccurrence(p_cf, PosInTerm.getTopLevel(), p_inAntec);
addNodeChange(new NodeRedundantAddChange(pio));
@@ -149,7 +149,7 @@ private void addAddedRedundantChange(SequentFormula p_cf, boolean p_inAntec) {
- private void addRemovedChange(SequentFormula p_cf, boolean p_inAntec) {
+ private void addRemovedChange(Term p_cf, boolean p_inAntec) {
Sequent oldS = parent.sequent();
Semisequent oldSS = (p_inAntec ? oldS.antecedent() : oldS.succedent());
@@ -165,7 +165,7 @@ private void addNodeChange(NodeChange p_nc) {
changes = changes.prepend(p_nc);
}
- private void removeNodeChanges(SequentFormula p_cf, boolean p_inAntec) {
+ private void removeNodeChanges(Term p_cf, boolean p_inAntec) {
Iterator it = changes.iterator();
changes = ImmutableSLList.nil();
NodeChange oldNC;
@@ -176,7 +176,7 @@ private void removeNodeChanges(SequentFormula p_cf, boolean p_inAntec) {
if (oldNC instanceof NodeChangeARFormula) {
oldPio = oldNC.getPos();
- if (oldPio.isInAntec() == p_inAntec && oldPio.sequentFormula().equals(p_cf)) {
+ if (oldPio.isInAntec() == p_inAntec && oldPio.sequentLevelFormula().equals(p_cf)) {
continue;
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/proof/replay/AbstractProofReplayer.java b/key.core/src/main/java/de/uka/ilkd/key/proof/replay/AbstractProofReplayer.java
index 48538a003f3..278b897a38b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/proof/replay/AbstractProofReplayer.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/proof/replay/AbstractProofReplayer.java
@@ -14,8 +14,8 @@
import de.uka.ilkd.key.logic.PosInTerm;
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
+import de.uka.ilkd.key.logic.equality.ProofIrrelevancyProperty;
import de.uka.ilkd.key.logic.op.SchemaVariable;
import de.uka.ilkd.key.proof.Goal;
import de.uka.ilkd.key.proof.Node;
@@ -304,10 +304,10 @@ private TacletApp constructTacletApp(Node originalStep, Goal currGoal) {
if (oldFormulaPioSpec.second) {
ifFormulaList = ifFormulaList.append(
new IfFormulaInstSeq(currGoal.sequent(), oldFormulaPio.isInAntec(),
- newPio.sequentFormula()));
+ newPio.sequentLevelFormula()));
} else {
ifFormulaList = ifFormulaList.append(
- new IfFormulaInstDirect(newPio.sequentFormula()));
+ new IfFormulaInstDirect(newPio.sequentLevelFormula()));
}
}
@@ -333,11 +333,12 @@ private TacletApp constructTacletApp(Node originalStep, Goal currGoal) {
* @return the formula in the sequent, or null if not found
*/
private PosInOccurrence findInNewSequent(PosInOccurrence oldPos, Sequent newSequent) {
- SequentFormula oldFormula = oldPos.sequentFormula();
+ Term oldFormula = oldPos.sequentLevelFormula();
Semisequent semiSeq = oldPos.isInAntec() ? newSequent.antecedent()
: newSequent.succedent();
- for (SequentFormula newFormula : semiSeq.asList()) {
- if (newFormula.equalsModProofIrrelevancy(oldFormula)) {
+ for (Term newFormula : semiSeq.asList()) {
+ if (newFormula.equalsModProperty(oldFormula,
+ ProofIrrelevancyProperty.PROOF_IRRELEVANCY_PROPERTY)) {
return oldPos.replaceConstrainedFormula(newFormula);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/prover/impl/ApplyStrategy.java b/key.core/src/main/java/de/uka/ilkd/key/prover/impl/ApplyStrategy.java
index 05b6f74d9dd..5d69be261c3 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/prover/impl/ApplyStrategy.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/prover/impl/ApplyStrategy.java
@@ -267,9 +267,9 @@ private ProofTreeListener prepareStrategy(Proof proof, ImmutableList goals
ProofTreeListener treeListener = new ProofTreeAdapter() {
@Override
public void proofGoalsAdded(ProofTreeEvent e) {
- ImmutableList newGoals = e.getGoals();
+ Iterable newGoals = e.getGoals();
// Check for a closed goal ...
- if (newGoals.size() == 0) {
+ if (!newGoals.iterator().hasNext()) {
// No new goals have been generated ...
closedGoals++;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBlockContractRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBlockContractRule.java
index 69078b2e908..e0d749cd175 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBlockContractRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBlockContractRule.java
@@ -24,7 +24,6 @@
import de.uka.ilkd.key.java.statement.JavaStatement;
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.ProgramElementName;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermServices;
@@ -294,7 +293,7 @@ protected static Term buildInfFlowPostAssumption(ProofObligationVars instVars,
return afterAssumptions;
}
- static SequentFormula buildBodyPreservesSequent(InfFlowPOSnippetFactory f, InfFlowProof proof) {
+ static Term buildBodyPreservesSequent(InfFlowPOSnippetFactory f, InfFlowProof proof) {
Term selfComposedExec =
f.create(InfFlowPOSnippetFactory.Snippet.SELFCOMPOSED_BLOCK_WITH_PRE_RELATION);
Term post = f.create(InfFlowPOSnippetFactory.Snippet.INF_FLOW_INPUT_OUTPUT_RELATION);
@@ -304,7 +303,7 @@ static SequentFormula buildBodyPreservesSequent(InfFlowPOSnippetFactory f, InfFl
tb.imp(tb.label(selfComposedExec, ParameterlessTermLabel.SELF_COMPOSITION_LABEL), post);
proof.addLabeledIFSymbol(selfComposedExec);
- return new SequentFormula(finalTerm);
+ return finalTerm;
}
private static ProofObligationVars generateProofObligationVariables(
@@ -347,7 +346,7 @@ private static void addProofObligation(final Goal infFlowGoal, final InfFlowProo
InfFlowPOSnippetFactory infFlowFactory =
POSnippetFactory.getInfFlowFactory(contract, ifVars.c1, ifVars.c2, ec, services);
- final SequentFormula poFormula = buildBodyPreservesSequent(infFlowFactory, proof);
+ final Term poFormula = buildBodyPreservesSequent(infFlowFactory, proof);
// add proof obligation to goal
infFlowGoal.addFormula(poFormula, false, true);
@@ -399,7 +398,7 @@ protected void setUpInfFlowPartOfUsageGoal(final Goal usageGoal,
tb.applySequential(new Term[] { contextUpdate, remembranceUpdate },
tb.and(infFlowValitidyData.preAssumption,
tb.apply(anonymisationUpdate, infFlowValitidyData.postAssumption)));
- usageGoal.addFormula(new SequentFormula(uAssumptions), true, false);
+ usageGoal.addFormula(uAssumptions, true, false);
}
protected InfFlowValidityData setUpInfFlowValidityGoal(final Goal infFlowGoal,
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBuiltInRuleApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBuiltInRuleApp.java
index cc0f21552f8..7b58514ee7b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBuiltInRuleApp.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/AbstractBuiltInRuleApp.java
@@ -9,6 +9,7 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.PosInOccurrence;
+import de.uka.ilkd.key.logic.equality.ProofIrrelevancyProperty;
import de.uka.ilkd.key.logic.op.LocationVariable;
import de.uka.ilkd.key.proof.Goal;
@@ -55,7 +56,7 @@ public BuiltInRule rule() {
}
/**
- * returns the PositionInOccurrence (representing a SequentFormula and a position in the
+ * returns the PositionInOccurrence (representing a Term and a position in the
* corresponding formula) of this rule application
*/
@Override
@@ -171,7 +172,8 @@ public boolean equalsModProofIrrelevancy(Object obj) {
@Override
public int hashCodeModProofIrrelevancy() {
return Objects.hash(rule(), getHeapContext(),
- posInOccurrence().sequentFormula().hashCodeModProofIrrelevancy(),
+ ProofIrrelevancyProperty.PROOF_IRRELEVANCY_PROPERTY
+ .hashCodeModThisProperty(posInOccurrence().sequentLevelFormula()),
posInOccurrence().posInTerm());
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/AuxiliaryContractBuilders.java b/key.core/src/main/java/de/uka/ilkd/key/rule/AuxiliaryContractBuilders.java
index f9a3830a721..794b40aff16 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/AuxiliaryContractBuilders.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/AuxiliaryContractBuilders.java
@@ -1354,7 +1354,7 @@ public Term setUpWdGoal(final Goal goal, final BlockContract contract, final Ter
services.getSpecificationRepository().addWdStatement(bwd);
final LocationVariable heapAtPre = variables.remembranceHeaps.get(heap);
final Term anon = anonHeap != null ? services.getTermBuilder().func(anonHeap) : null;
- final SequentFormula wdBlock = bwd.generateSequent(variables.self, variables.exception,
+ final Term wdBlock = bwd.generateSequent(variables.self, variables.exception,
variables.result, heap, heapAtPre, anon, localIns, update, anonUpdate, services);
if (goal != null) {
@@ -1362,7 +1362,7 @@ public Term setUpWdGoal(final Goal goal, final BlockContract contract, final Ter
goal.changeFormula(wdBlock, occurrence);
}
- return wdBlock.formula();
+ return wdBlock;
}
/**
@@ -1393,8 +1393,9 @@ public Term setUpValidityGoal(final Goal goal, final Term[] updates,
Term term;
if (goal != null) {
+ Term uAssumptions = tb.applySequential(updates, tb.and(assumptions));
goal.addFormula(
- new SequentFormula(tb.applySequential(updates, tb.and(assumptions))), true,
+ uAssumptions, true,
false);
ImmutableArray labels = TermLabelManager.instantiateLabels(
@@ -1407,7 +1408,7 @@ public Term setUpValidityGoal(final Goal goal, final Term[] updates,
term = tb.applySequential(updates,
tb.prog(instantiation.modality().kind(), newJavaBlock, newPost, labels));
- goal.changeFormula(new SequentFormula(term), occurrence);
+ goal.changeFormula(term, occurrence);
TermLabelManager.refactorGoal(termLabelState, services, occurrence,
application.rule(), goal, null, null);
addInfFlow(goal);
@@ -1511,7 +1512,7 @@ public Term setUpLoopValidityGoal(final Goal goal, final LoopContract contract,
if (goal != null) {
goal.setBranchLabel("Validity");
addInfFlow(goal);
- goal.changeFormula(new SequentFormula(term), occurrence);
+ goal.changeFormula(term, occurrence);
}
return term;
}
@@ -1531,7 +1532,7 @@ public void setUpPreconditionGoal(final Goal goal, final Term update,
fullPrecondition =
TermLabelManager.refactorTerm(termLabelState, services, null, fullPrecondition,
rule, goal, BlockContractInternalRule.FULL_PRECONDITION_TERM_HINT, null);
- goal.changeFormula(new SequentFormula(fullPrecondition), occurrence);
+ goal.changeFormula(fullPrecondition, occurrence);
TermLabelManager.refactorGoal(termLabelState, services, occurrence, application.rule(),
goal, null, null);
}
@@ -1548,9 +1549,10 @@ public void setUpUsageGoal(final Goal goal, final Term[] updates,
final TermBuilder tb = services.getTermBuilder();
goal.setBranchLabel("Usage");
Term uAssumptions = tb.applySequential(updates, tb.and(assumptions));
- goal.addFormula(new SequentFormula(uAssumptions), true, false);
+ goal.addFormula(uAssumptions, true, false);
+ Term uAssumptions1 = tb.applySequential(updates, buildUsageFormula(goal));
goal.changeFormula(
- new SequentFormula(tb.applySequential(updates, buildUsageFormula(goal))),
+ uAssumptions1,
occurrence);
TermLabelManager.refactorGoal(termLabelState, services, occurrence, application.rule(),
goal, null, null);
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/BlockContractInternalRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/BlockContractInternalRule.java
index a37634a71cb..38daf66ab23 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/BlockContractInternalRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/BlockContractInternalRule.java
@@ -10,7 +10,6 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermServices;
@@ -355,7 +354,8 @@ private void setUpValidityGoal(final ImmutableList result, final boolean i
updates[1], updates[2], tb);
} else {
// nothing to prove -> set up trivial goal
- validityGoal.addFormula(new SequentFormula(tb.tt()), false, true);
+ Term uAssumptions = tb.tt();
+ validityGoal.addFormula(uAssumptions, false, true);
}
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/BoundUniquenessChecker.java b/key.core/src/main/java/de/uka/ilkd/key/rule/BoundUniquenessChecker.java
index 5b20688062a..d25d73c54c2 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/BoundUniquenessChecker.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/BoundUniquenessChecker.java
@@ -7,7 +7,6 @@
import java.util.LinkedHashSet;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.QuantifiableVariable;
@@ -52,8 +51,8 @@ public void addTerm(Term term) {
* @param seq the Sequent with the formulas to add
*/
public void addAll(Sequent seq) {
- for (final SequentFormula cf : seq) {
- terms = terms.prepend(cf.formula());
+ for (final Term cf : seq) {
+ terms = terms.prepend(cf);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstDirect.java b/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstDirect.java
index 710c9da1949..dc9fcca4607 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstDirect.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstDirect.java
@@ -4,7 +4,7 @@
package de.uka.ilkd.key.rule;
import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.proof.io.ProofSaver;
@@ -17,16 +17,16 @@ public class IfFormulaInstDirect implements IfFormulaInstantiation {
/**
* Simply the formula
*/
- private final SequentFormula cf;
+ private final Term cf;
- public IfFormulaInstDirect(SequentFormula p_cf) {
+ public IfFormulaInstDirect(Term p_cf) {
cf = p_cf;
}
/**
* @return the cf this is pointing to
*/
- public SequentFormula getConstrainedFormula() {
+ public Term getConstrainedFormula() {
return cf;
}
@@ -48,6 +48,6 @@ public int hashCode() {
}
public String toString(Services services) {
- return ProofSaver.printAnything(cf.formula(), services);
+ return ProofSaver.printAnything(cf, services);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstSeq.java b/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstSeq.java
index d70b9e1a529..c082aa270b2 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstSeq.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstSeq.java
@@ -4,11 +4,7 @@
package de.uka.ilkd.key.rule;
import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.PosInTerm;
-import de.uka.ilkd.key.logic.Semisequent;
-import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.*;
import de.uka.ilkd.key.proof.io.OutputStreamProofSaver;
import org.key_project.util.collection.ImmutableArray;
@@ -25,9 +21,9 @@ public class IfFormulaInstSeq implements IfFormulaInstantiation {
*/
private final Sequent seq;
private final boolean antec; // formula is in antecedent?
- private final SequentFormula cf;
+ private final Term cf;
- public IfFormulaInstSeq(Sequent p_seq, boolean antec, SequentFormula p_cf) {
+ public IfFormulaInstSeq(Sequent p_seq, boolean antec, Term p_cf) {
seq = p_seq;
this.antec = antec;
cf = p_cf;
@@ -43,7 +39,7 @@ public IfFormulaInstSeq(Sequent seq, int formulaNr) {
* @return the cf this is pointing to
*/
@Override
- public SequentFormula getConstrainedFormula() {
+ public Term getConstrainedFormula() {
return cf;
}
@@ -93,7 +89,7 @@ public String toString() {
@Override
public String toString(Services services) {
- return OutputStreamProofSaver.printAnything(cf.formula(), services);
+ return OutputStreamProofSaver.printAnything(cf, services);
}
@Override
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstantiation.java b/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstantiation.java
index 9abb3fc3b5a..a7ab7433c88 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstantiation.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/IfFormulaInstantiation.java
@@ -4,7 +4,8 @@
package de.uka.ilkd.key.rule;
import de.uka.ilkd.key.java.Services;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
+import de.uka.ilkd.key.logic.equality.ProofIrrelevancyProperty;
import org.key_project.util.EqualsModProofIrrelevancy;
@@ -18,7 +19,7 @@ public interface IfFormulaInstantiation extends EqualsModProofIrrelevancy {
/**
* @return the cf this is pointing to
*/
- SequentFormula getConstrainedFormula();
+ Term getConstrainedFormula();
String toString(Services services);
@@ -27,11 +28,13 @@ default boolean equalsModProofIrrelevancy(Object obj) {
if (!(obj instanceof IfFormulaInstantiation that)) {
return false;
}
- return getConstrainedFormula().equalsModProofIrrelevancy(that.getConstrainedFormula());
+ return getConstrainedFormula().equalsModProperty(that.getConstrainedFormula(),
+ ProofIrrelevancyProperty.PROOF_IRRELEVANCY_PROPERTY);
}
@Override
default int hashCodeModProofIrrelevancy() {
- return getConstrainedFormula().hashCodeModProofIrrelevancy();
+ return getConstrainedFormula()
+ .hashCodeModProperty(ProofIrrelevancyProperty.PROOF_IRRELEVANCY_PROPERTY);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/JmlAssertRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/JmlAssertRule.java
index 87b9131b154..b3f641c0a87 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/JmlAssertRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/JmlAssertRule.java
@@ -158,7 +158,8 @@ public IBuiltInRuleApp createApp(PosInOccurrence occurrence, TermServices servic
private void setUpValidityRule(Goal goal, PosInOccurrence occurrence, Term update,
Term condition, TermBuilder tb) {
goal.setBranchLabel("Validity");
- goal.changeFormula(new SequentFormula(tb.apply(update, condition)), occurrence);
+ Term uAssumptions = tb.apply(update, condition);
+ goal.changeFormula(uAssumptions, occurrence);
}
private void setUpUsageGoal(Goal goal, PosInOccurrence occurrence, Term update, Term target,
@@ -169,7 +170,7 @@ private void setUpUsageGoal(Goal goal, PosInOccurrence occurrence, Term update,
tb.imp(condition,
tb.prog(((Modality) target.op()).kind(), javaBlock, target.sub(0), null)));
- goal.changeFormula(new SequentFormula(newTerm), occurrence);
+ goal.changeFormula(newTerm, occurrence);
}
@Override
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/LoopApplyHeadRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/LoopApplyHeadRule.java
index c2ed88a8cde..728bb34a756 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/LoopApplyHeadRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/LoopApplyHeadRule.java
@@ -9,7 +9,6 @@
import de.uka.ilkd.key.java.visitor.ProgramElementReplacer;
import de.uka.ilkd.key.logic.JavaBlock;
import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermServices;
@@ -96,9 +95,9 @@ public class LoopApplyHeadRule implements BuiltInRule {
}
Goal result = goal.split(1).head();
+ Term uAssumptions = tb.apply(update, tb.prog(modality.kind(), newJavaBlock, target.sub(0)));
result.changeFormula(
- new SequentFormula(
- tb.apply(update, tb.prog(modality.kind(), newJavaBlock, target.sub(0)))),
+ uAssumptions,
ruleApp.pio);
return ImmutableSLList.nil().append(goal);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/LoopScopeInvariantRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/LoopScopeInvariantRule.java
index 3ae2aaed6cb..1e35409edc0 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/LoopScopeInvariantRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/LoopScopeInvariantRule.java
@@ -21,7 +21,6 @@
import de.uka.ilkd.key.logic.JavaBlock;
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.ProgramPrefix;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.label.ParameterlessTermLabel;
@@ -240,9 +239,9 @@ private void constructPresrvAndUCGoal(Services services, RuleApp ruleApp, Goal p
uBeforeLoopDefAnonVariant, invTerm);
presrvAndUCGoal.setBranchLabel("Invariant Preserved and Used");
- presrvAndUCGoal.addFormula(new SequentFormula(uAnonInv), true, false);
- presrvAndUCGoal.addFormula(new SequentFormula(wellFormedAnon), true, false);
- presrvAndUCGoal.changeFormula(new SequentFormula(newFormula), ruleApp.posInOccurrence());
+ presrvAndUCGoal.addFormula(uAnonInv, true, false);
+ presrvAndUCGoal.addFormula(wellFormedAnon, true, false);
+ presrvAndUCGoal.changeFormula(newFormula, ruleApp.posInOccurrence());
}
// -------------------------------------------------------------------------
@@ -323,7 +322,7 @@ private ProgramElement newProgram(Services services, final While loop,
}
/**
- * Creates the {@link SequentFormula} for the "initially valid" goal.
+ * Creates the {@link Term} for the "initially valid" goal.
*
* @param termLabelState The {@link TermLabelState}.
* @param inst The {@link Instantiation} for this rule application.
@@ -331,9 +330,9 @@ private ProgramElement newProgram(Services services, final While loop,
* @param reachableState The reachable state formula.
* @param services The {@link Services} object.
* @param initGoal The goal containing the "initially valid" PO.
- * @return The {@link SequentFormula} for the "initially valid" goal.
+ * @return The {@link Term} for the "initially valid" goal.
*/
- private SequentFormula initFormula(TermLabelState termLabelState, Instantiation inst,
+ private Term initFormula(TermLabelState termLabelState, Instantiation inst,
final Term invTerm, Term reachableState, Services services, Goal initGoal) {
final TermBuilder tb = services.getTermBuilder();
@@ -341,7 +340,7 @@ private SequentFormula initFormula(TermLabelState termLabelState, Instantiation
sfTerm = TermLabelManager.refactorTerm(termLabelState, services, null, sfTerm, this,
initGoal, INITIAL_INVARIANT_ONLY_HINT, null);
- return new SequentFormula(sfTerm);
+ return sfTerm;
}
/**
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/NoPosTacletApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/NoPosTacletApp.java
index 2b6434e380e..df86c6ca0c0 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/NoPosTacletApp.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/NoPosTacletApp.java
@@ -282,7 +282,7 @@ protected ImmutableSet contextVars(SchemaVariable sv) {
/**
- * returns the PositionInOccurrence (representing a SequentFormula and a position in the
+ * returns the PositionInOccurrence (representing a Term and a position in the
* corresponding formula)
*
* @return the PosInOccurrence
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/ObserverToUpdateRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/ObserverToUpdateRule.java
index cc891e61ce6..420e20450d0 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/ObserverToUpdateRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/ObserverToUpdateRule.java
@@ -18,7 +18,6 @@
import de.uka.ilkd.key.java.reference.TypeReference;
import de.uka.ilkd.key.logic.JavaBlock;
import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermServices;
@@ -194,8 +193,9 @@ private ImmutableList applyForModelFields(Goal goal, ModelFieldInstantiati
// ---- create "Null Reference" branch
if (nullGoal != null) {
final Term actualSelfNotNull = tb.not(tb.equals(inst.receiver, tb.NULL()));
+ Term uAssumptions = tb.apply(inst.update, actualSelfNotNull, null);
nullGoal.changeFormula(
- new SequentFormula(tb.apply(inst.update, actualSelfNotNull, null)),
+ uAssumptions,
ruleApp.posInOccurrence());
}
@@ -215,7 +215,8 @@ private ImmutableList applyForModelFields(Goal goal, ModelFieldInstantiati
Term update = tb.elementary(lhs,
makeCall(services, inst.observerSymbol, inst.receiver, ImmutableList.of()));
Term normalPost = tb.apply(update, modTerm);
- contGoal.changeFormula(new SequentFormula(tb.apply(inst.update, normalPost, null)),
+ Term uAssumptions = tb.apply(inst.update, normalPost, null);
+ contGoal.changeFormula(uAssumptions,
ruleApp.posInOccurrence());
TermLabelManager.refactorGoal(termLabelState, services, ruleApp.posInOccurrence(), this,
@@ -255,7 +256,8 @@ private ImmutableList applyForMethods(Goal goal, Instantiation inst, Servi
// ---- create "Null Reference" branch
if (nullGoal != null) {
final Term actualSelfNotNull = tb.not(tb.equals(inst.actualSelf, tb.NULL()));
- nullGoal.changeFormula(new SequentFormula(tb.apply(inst.u, actualSelfNotNull, null)),
+ Term uAssumptions = tb.apply(inst.u, actualSelfNotNull, null);
+ nullGoal.changeFormula(uAssumptions,
ruleApp.posInOccurrence());
}
@@ -273,7 +275,8 @@ private ImmutableList applyForMethods(Goal goal, Instantiation inst, Servi
Term update =
tb.elementary(lhs, makeCall(services, inst.pm, inst.actualSelf, inst.actualParams));
Term normalPost = tb.apply(update, modTerm);
- contGoal.changeFormula(new SequentFormula(tb.apply(inst.u, normalPost, null)),
+ Term uAssumptions = tb.apply(inst.u, normalPost, null);
+ contGoal.changeFormula(uAssumptions,
ruleApp.posInOccurrence());
TermLabelManager.refactorGoal(termLabelState, services, ruleApp.posInOccurrence(), this,
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java b/key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java
index feec9a03cae..19d726d810b 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/OneStepSimplifier.java
@@ -15,7 +15,6 @@
import de.uka.ilkd.key.logic.PosInTerm;
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermServices;
import de.uka.ilkd.key.logic.label.TermLabel;
@@ -83,7 +82,7 @@ public static final class Protocol extends ArrayList {
.append("update_apply").append("update_join").append("elimQuantifier");
private static final boolean[] bottomUp = { false, false, true, true, true, false };
- private final Map applicabilityCache =
+ private final Map applicabilityCache =
new LRUCache<>(APPLICABILITY_CACHE_SIZE);
private Proof lastProof;
@@ -241,7 +240,7 @@ public boolean isShutdown() {
*
* @param protocol
*/
- private SequentFormula simplifyPos(Goal goal, Services services, PosInOccurrence pos,
+ private Term simplifyPos(Goal goal, Services services, PosInOccurrence pos,
int indexNr, Protocol protocol) {
final ImmutableList apps =
indices[indexNr].getRewriteTaclet(pos, TacletFilter.TRUE, services);
@@ -257,13 +256,13 @@ private SequentFormula simplifyPos(Goal goal, Services services, PosInOccurrence
}
}
RewriteTaclet taclet = (RewriteTaclet) app.rule();
- SequentFormula result =
+ Term result =
taclet.getRewriteResult(goal, new TermLabelState(), services, app);
if (protocol != null) {
protocol.add(app);
}
return result;
- // TODO Idea: return new Pair(null, null);
+ // TODO Idea: return new Pair(null, null);
}
return null;
}
@@ -275,10 +274,10 @@ private SequentFormula simplifyPos(Goal goal, Services services, PosInOccurrence
*
* @param protocol
*/
- private SequentFormula simplifySub(Goal goal, Services services, PosInOccurrence pos,
+ private Term simplifySub(Goal goal, Services services, PosInOccurrence pos,
int indexNr, Protocol protocol) {
for (int i = 0, n = pos.subTerm().arity(); i < n; i++) {
- SequentFormula result =
+ Term result =
simplifyPosOrSub(goal, services, pos.down(i), indexNr, protocol);
if (result != null) {
return result;
@@ -294,14 +293,14 @@ private SequentFormula simplifySub(Goal goal, Services services, PosInOccurrence
*
* @param protocol
*/
- private SequentFormula simplifyPosOrSub(Goal goal, Services services, PosInOccurrence pos,
+ private Term simplifyPosOrSub(Goal goal, Services services, PosInOccurrence pos,
int indexNr, Protocol protocol) {
final Term term = pos.subTerm();
if (notSimplifiableCaches[indexNr].get(term) != null) {
return null;
}
- SequentFormula result;
+ Term result;
if (bottomUp[indexNr]) {
result = simplifySub(goal, services, pos, indexNr, protocol);
if (result == null) {
@@ -376,20 +375,20 @@ private Term replaceKnownHelper(Map map, Te
* (hardcoded here). The context formulas available for replace-known are passed in as
* "context". The positions of the actually used context formulas are passed out as "ifInsts".
*/
- private SequentFormula replaceKnown(Services services, SequentFormula cf, boolean inAntecedent,
+ private Term replaceKnown(Services services, Term cf, boolean inAntecedent,
Map context,
/* out */ List ifInsts, Protocol protocol, Goal goal,
RuleApp ruleApp) {
if (context == null) {
return null;
}
- final Term formula = cf.formula();
+ final Term formula = cf;
final Term simplifiedFormula = replaceKnownHelper(context, formula, inAntecedent, ifInsts,
protocol, services, goal, ruleApp);
if (simplifiedFormula.equals(formula)) {
return null;
} else {
- return new SequentFormula(simplifiedFormula);
+ return simplifiedFormula;
}
}
@@ -406,18 +405,18 @@ private RuleApp makeReplaceKnownTacletApp(Term formula, boolean inAntecedent,
SVInstantiations svi = SVInstantiations.EMPTY_SVINSTANTIATIONS;
FormulaSV sv = SchemaVariableFactory.createFormulaSV(new Name("b"));
- svi.add(sv, pio.sequentFormula().formula(), lastProof.getServices());
+ svi.add(sv, pio.sequentLevelFormula(), lastProof.getServices());
PosInOccurrence applicatinPIO =
- new PosInOccurrence(new SequentFormula(formula), PosInTerm.getTopLevel(), // TODO: This
- // should be
- // the precise
- // sub term
+ new PosInOccurrence(formula, PosInTerm.getTopLevel(), // TODO: This
+ // should be
+ // the precise
+ // sub term
inAntecedent); // It is required to create a new PosInOccurrence because formula and
// pio.constrainedFormula().formula() are only equals module
// renamings and term labels
ImmutableList ifInst = ImmutableSLList.nil();
- ifInst = ifInst.append(new IfFormulaInstDirect(pio.sequentFormula()));
+ ifInst = ifInst.append(new IfFormulaInstDirect(pio.sequentLevelFormula()));
TacletApp ta = PosTacletApp.createPosTacletApp(taclet, svi, ifInst, applicatinPIO,
lastProof.getServices());
return ta;
@@ -429,11 +428,11 @@ private RuleApp makeReplaceKnownTacletApp(Term formula, boolean inAntecedent,
*
* @param protocol
*/
- private SequentFormula simplifyConstrainedFormula(Services services, SequentFormula cf,
+ private Term simplifyConstrainedFormula(Services services, Term cf,
boolean inAntecedent, Map context,
/* out */ List ifInsts, Protocol protocol, Goal goal,
RuleApp ruleApp) {
- SequentFormula result =
+ Term result =
replaceKnown(services, cf, inAntecedent, context, ifInsts, protocol, goal, ruleApp);
if (result != null) {
return result;
@@ -461,24 +460,28 @@ private Instantiation computeInstantiation(Services services, PosInOccurrence os
// collect context formulas (potential if-insts for replace-known)
final Map context =
new LinkedHashMap<>();
- final SequentFormula cf = ossPIO.sequentFormula();
- for (SequentFormula ante : seq.antecedent()) {
- if (!ante.equals(cf) && ante.formula().op() != Junctor.TRUE) {
- context.put(new TermReplacementKey(ante.formula()),
- new PosInOccurrence(ante, PosInTerm.getTopLevel(), true));
+ final Term cf = ossPIO.sequentLevelFormula();
+ for (Term ante : seq.antecedent()) {
+ if (!ante.equals(cf)) {
+ if (ante.op() != Junctor.TRUE) {
+ context.put(new TermReplacementKey(ante),
+ new PosInOccurrence(ante, PosInTerm.getTopLevel(), true));
+ }
}
}
- for (SequentFormula succ : seq.succedent()) {
- if (!succ.equals(cf) && succ.formula().op() != Junctor.FALSE) {
- context.put(new TermReplacementKey(succ.formula()),
- new PosInOccurrence(succ, PosInTerm.getTopLevel(), false));
+ for (Term succ : seq.succedent()) {
+ if (!succ.equals(cf)) {
+ if (succ.op() != Junctor.FALSE) {
+ context.put(new TermReplacementKey(succ),
+ new PosInOccurrence(succ, PosInTerm.getTopLevel(), false));
+ }
}
}
final List ifInsts = new ArrayList<>(seq.size());
// simplify as long as possible
- ImmutableList list = ImmutableSLList.nil();
- SequentFormula simplifiedCf = cf;
+ ImmutableList list = ImmutableSLList.nil();
+ Term simplifiedCf = cf;
while (true) {
simplifiedCf = simplifyConstrainedFormula(services, simplifiedCf, ossPIO.isInAntec(),
context, ifInsts, protocol, goal, ruleApp);
@@ -500,14 +503,14 @@ private Instantiation computeInstantiation(Services services, PosInOccurrence os
/**
* Tells whether the passed formula can be simplified
*/
- private synchronized boolean applicableTo(Services services, SequentFormula cf,
+ private synchronized boolean applicableTo(Services services, Term cf,
boolean inAntecedent, Goal goal, RuleApp ruleApp) {
final Boolean b = applicabilityCache.get(cf);
if (b != null) {
return b;
} else {
// try one simplification step without replace-known
- final SequentFormula simplifiedCf = simplifyConstrainedFormula(services, cf,
+ final Term simplifiedCf = simplifyConstrainedFormula(services, cf,
inAntecedent, null, null, null, goal, ruleApp);
final boolean result = simplifiedCf != null && !simplifiedCf.equals(cf);
applicabilityCache.put(cf, result);
@@ -572,7 +575,8 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) {
}
// applicable to the formula?
- return applicableTo(goal.proof().getServices(), pio.sequentFormula(), pio.isInAntec(), goal,
+ return applicableTo(goal.proof().getServices(), pio.sequentLevelFormula(), pio.isInAntec(),
+ goal,
null);
}
@@ -594,21 +598,21 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) {
if (((OneStepSimplifierRuleApp) ruleApp).shouldRestrictAssumeInsts()
&& !disableOSSRestriction) {
ImmutableList ifInsts = ((OneStepSimplifierRuleApp) ruleApp).ifInsts();
- ImmutableList anteFormulas = ImmutableSLList.nil();
- ImmutableList succFormulas = ImmutableSLList.nil();
+ ImmutableList anteFormulas = ImmutableSLList.nil();
+ ImmutableList succFormulas = ImmutableSLList.nil();
if (ifInsts != null) {
for (PosInOccurrence it : ifInsts) {
if (it.isInAntec()) {
- anteFormulas = anteFormulas.prepend(it.sequentFormula());
+ anteFormulas = anteFormulas.prepend(it.sequentLevelFormula());
} else {
- succFormulas = succFormulas.prepend(it.sequentFormula());
+ succFormulas = succFormulas.prepend(it.sequentLevelFormula());
}
}
}
if (pos.isInAntec()) {
- anteFormulas = anteFormulas.prepend(pos.sequentFormula());
+ anteFormulas = anteFormulas.prepend(pos.sequentLevelFormula());
} else {
- succFormulas = succFormulas.prepend(pos.sequentFormula());
+ succFormulas = succFormulas.prepend(pos.sequentLevelFormula());
}
Semisequent antecedent = anteFormulas.isEmpty() ? Semisequent.EMPTY_SEMISEQUENT
: new Semisequent(anteFormulas);
@@ -673,11 +677,11 @@ public Set getCapturedTaclets() {
// -------------------------------------------------------------------------
private static final class Instantiation {
- private final SequentFormula cf;
+ private final Term cf;
private final int numAppliedRules;
private final ImmutableList ifInsts;
- public Instantiation(SequentFormula cf, int numAppliedRules,
+ public Instantiation(Term cf, int numAppliedRules,
ImmutableList ifInsts) {
assert numAppliedRules >= 0;
this.cf = cf;
@@ -685,7 +689,7 @@ public Instantiation(SequentFormula cf, int numAppliedRules,
this.ifInsts = ifInsts;
}
- public SequentFormula getCf() {
+ public Term getCf() {
return cf;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/PosTacletApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/PosTacletApp.java
index 6c5d92442ad..0baf6550866 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/PosTacletApp.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/PosTacletApp.java
@@ -10,6 +10,7 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.Term;
+import de.uka.ilkd.key.logic.equality.ProofIrrelevancyProperty;
import de.uka.ilkd.key.logic.op.QuantifiableVariable;
import de.uka.ilkd.key.logic.op.SchemaVariable;
import de.uka.ilkd.key.rule.inst.SVInstantiations;
@@ -277,7 +278,7 @@ public boolean complete() {
}
/**
- * returns the PositionInOccurrence (representing a SequentFormula and a position in the
+ * returns the PositionInOccurrence (representing a Term and a position in the
* corresponding formula)
*
* @return the PosInOccurrence
@@ -319,7 +320,8 @@ public boolean equalsModProofIrrelevancy(Object o) {
@Override
public int hashCodeModProofIrrelevancy() {
return Objects.hash(super.hashCodeModProofIrrelevancy(),
- pos.sequentFormula().hashCodeModProofIrrelevancy(),
+ ProofIrrelevancyProperty.PROOF_IRRELEVANCY_PROPERTY
+ .hashCodeModThisProperty(pos.sequentLevelFormula()),
pos.posInTerm());
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/QueryExpand.java b/key.core/src/main/java/de/uka/ilkd/key/rule/QueryExpand.java
index 492c155c269..3ffe39389eb 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/QueryExpand.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/QueryExpand.java
@@ -88,7 +88,7 @@ public class QueryExpand implements BuiltInRule {
tb.addRuleSet(new RuleSet(new Name("concrete")));
// move the query call directly to the succedent. Use box instead of diamond?
- g.addFormula(new SequentFormula(queryEval.first), true, true);
+ g.addFormula(queryEval.first, true, true);
g.addTaclet(tb.getTaclet(), SVInstantiations.EMPTY_SVINSTANTIATIONS, true);
return newGoal;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/RewriteTaclet.java b/key.core/src/main/java/de/uka/ilkd/key/rule/RewriteTaclet.java
index 6e506a3f31b..696e7405cf2 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/RewriteTaclet.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/RewriteTaclet.java
@@ -258,7 +258,7 @@ public RewriteTacletExecutor extends RewriteTaclet> getExecutor() {
return (RewriteTacletExecutor extends RewriteTaclet>) executor;
}
- public SequentFormula getRewriteResult(Goal goal, TermLabelState termLabelState,
+ public Term getRewriteResult(Goal goal, TermLabelState termLabelState,
Services services, TacletApp app) {
return getExecutor().getRewriteResult(goal, termLabelState, services, app);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/Rule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/Rule.java
index af71ed4c8ec..09f069deb69 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/Rule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/Rule.java
@@ -39,5 +39,7 @@ ImmutableList apply(Goal goal, Services services, RuleApp ruleApp)
/**
* returns the display name of the rule
*/
- String displayName();
+ default String displayName() {
+ return name().toString();
+ }
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/RuleAbortException.java b/key.core/src/main/java/de/uka/ilkd/key/rule/RuleAbortException.java
index 96e67cb4ea9..e10f101bd10 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/RuleAbortException.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/RuleAbortException.java
@@ -10,9 +10,7 @@
* This Exception signals the abort of a rule Application
*
*/
-
-
-public class RuleAbortException extends Exception {
+public class RuleAbortException extends RuntimeException {
private static final long serialVersionUID = -645034125571021135L;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/RuleApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/RuleApp.java
index 8c505c74360..c55bd34bd9a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/RuleApp.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/RuleApp.java
@@ -23,7 +23,7 @@ public interface RuleApp extends EqualsModProofIrrelevancy {
Rule rule();
/**
- * returns the PositionInOccurrence (representing a SequentFormula and a position in the
+ * returns the PositionInOccurrence (representing a Term and a position in the
* corresponding formula) of this rule application
*/
PosInOccurrence posInOccurrence();
@@ -33,11 +33,10 @@ public interface RuleApp extends EqualsModProofIrrelevancy {
* instantiated
*
* @param goal the Goal where to apply the rule
- * @param services the Services encapsulating all java information
* @return list of new created goals
*/
- @Nullable
- ImmutableList execute(Goal goal, Services services);
+ // @Nullable
+ // ImmutableList execute(G goal);
/**
* returns true if all variables are instantiated
@@ -46,6 +45,17 @@ public interface RuleApp extends EqualsModProofIrrelevancy {
*/
boolean complete();
+ /**
+ * applies the specified rule at the specified position if all schema variables have been
+ * instantiated
+ *
+ * @param goal the Goal where to apply the rule
+ * @param services the Services encapsulating all java information
+ * @return list of new created goals
+ */
+ @Nullable
+ ImmutableList execute(Goal goal, Services services);
+
/**
* @return user-friendly name for this rule-application
*/
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/SVNameCorrespondenceCollector.java b/key.core/src/main/java/de/uka/ilkd/key/rule/SVNameCorrespondenceCollector.java
index b86aa18d2bf..dfe05eb9e5a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/SVNameCorrespondenceCollector.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/SVNameCorrespondenceCollector.java
@@ -7,7 +7,6 @@
import de.uka.ilkd.key.logic.DefaultVisitor;
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.JFunction;
import de.uka.ilkd.key.logic.op.SchemaVariable;
@@ -84,8 +83,8 @@ public ImmutableMap getCorrespondences() {
* @param semiseq the Semisequent to visit
*/
private void visit(Semisequent semiseq) {
- for (SequentFormula cf : semiseq) {
- cf.formula().execPostOrder(this);
+ for (Term cf : semiseq) {
+ cf.execPostOrder(this);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/SetStatementRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/SetStatementRule.java
index 6e29239f3eb..94082faab59 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/SetStatementRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/SetStatementRule.java
@@ -113,7 +113,7 @@ public IBuiltInRuleApp createApp(PosInOccurrence occurrence, TermServices servic
Term newTerm = tb.apply(update, tb.apply(newUpdate, term));
ImmutableList result = goal.split(1);
- result.head().changeFormula(new SequentFormula(newTerm), occurrence);
+ result.head().changeFormula(newTerm, occurrence);
return result;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/Taclet.java b/key.core/src/main/java/de/uka/ilkd/key/rule/Taclet.java
index 5f61d57f92b..f110d474dd5 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/Taclet.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/Taclet.java
@@ -7,6 +7,7 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.*;
+import de.uka.ilkd.key.logic.equality.ProofIrrelevancyProperty;
import de.uka.ilkd.key.logic.label.TermLabel;
import de.uka.ilkd.key.logic.op.Operator;
import de.uka.ilkd.key.logic.op.QuantifiableVariable;
@@ -492,10 +493,14 @@ public boolean equalsModProofIrrelevancy(Object o) {
|| (ifSequent != null && t2.ifSequent == null)) {
return false;
} else {
- ImmutableList if1 = ifSequent.asList();
- ImmutableList if2 = t2.ifSequent.asList();
- while (!if1.isEmpty() && !if2.isEmpty()
- && if1.head().equalsModProofIrrelevancy(if2.head())) {
+ ImmutableList if1 = ifSequent.asList();
+ ImmutableList if2 = t2.ifSequent.asList();
+ while (!if1.isEmpty() && !if2.isEmpty()) {
+ Term term = if1.head();
+ Term head = if2.head();
+ if (!(boolean) ProofIrrelevancyProperty.PROOF_IRRELEVANCY_PROPERTY
+ .equalsModThisProperty(term, head))
+ break;
if1 = if1.tail();
if2 = if2.tail();
}
@@ -529,7 +534,9 @@ public int hashCode() {
@Override
public int hashCodeModProofIrrelevancy() {
if (hashcode2 == 0) {
- hashcode2 = ifSequent.getFormulabyNr(1).hashCodeModProofIrrelevancy();
+ Term term = ifSequent.getFormulabyNr(1);
+ hashcode2 =
+ ProofIrrelevancyProperty.PROOF_IRRELEVANCY_PROPERTY.hashCodeModThisProperty(term);
if (hashcode2 == 0) {
hashcode2 = -1;
}
@@ -740,8 +747,8 @@ public Set collectSchemaVars() {
private void collectSchemaVarsHelper(Sequent s, OpCollector oc) {
- for (SequentFormula cf : s) {
- cf.formula().execPostOrder(oc);
+ for (Term cf : s) {
+ cf.execPostOrder(oc);
}
}
@@ -762,9 +769,9 @@ public static class TacletLabelHint {
private final Sequent sequent;
/**
- * The optional {@link SequentFormula} contained in {@link #getSequent()}.
+ * The optional {@link Term} contained in {@link #getSequent()}.
*/
- private final SequentFormula sequentFormula;
+ private final Term seqFormula;
/**
* The optional replace {@link Term} of the taclet.
@@ -788,7 +795,7 @@ public TacletLabelHint(TacletOperation tacletOperation, Sequent sequent) {
assert sequent != null;
this.tacletOperation = tacletOperation;
this.sequent = sequent;
- this.sequentFormula = null;
+ this.seqFormula = null;
this.term = null;
}
@@ -796,30 +803,30 @@ public TacletLabelHint(TacletOperation tacletOperation, Sequent sequent) {
* Constructor creating a hint indicating
* {@link TacletOperation#REPLACE_TERM} as the currently performed operation.
*
- * @param term The optional replace {@link Term} of the taclet.
+ * @param replaceTerm The optional replace {@link Term} of the taclet.
*/
- public TacletLabelHint(Term term) {
- assert term != null;
+ public TacletLabelHint(Term replaceTerm) {
+ assert replaceTerm != null;
this.tacletOperation = TacletOperation.REPLACE_TERM;
this.sequent = null;
- this.sequentFormula = null;
- this.term = term;
+ this.seqFormula = null;
+ this.term = seqFormula;
}
/**
* Constructor.
*
* @param labelHint The previous {@link TacletLabelHint} which is now specialised.
- * @param sequentFormula The optional {@link SequentFormula} contained in
+ * @param formula The optional {@link Term} contained in
* {@link #getSequent()}.
*/
- public TacletLabelHint(TacletLabelHint labelHint, SequentFormula sequentFormula) {
+ public TacletLabelHint(TacletLabelHint labelHint, Term formula) {
assert labelHint != null;
assert !TacletOperation.REPLACE_TERM.equals(labelHint.getTacletOperation());
- assert sequentFormula != null;
+ assert formula != null;
this.tacletOperation = labelHint.getTacletOperation();
this.sequent = labelHint.getSequent();
- this.sequentFormula = sequentFormula;
+ this.seqFormula = formula;
this.term = labelHint.getTerm();
}
@@ -842,12 +849,12 @@ public Sequent getSequent() {
}
/**
- * Returns the optional {@link SequentFormula} contained in {@link #getSequent()}.
+ * Returns the optional {@link Term} contained in {@link #getSequent()}.
*
- * @return The optional {@link SequentFormula} contained in {@link #getSequent()}.
+ * @return The optional {@link Term} contained in {@link #getSequent()}.
*/
- public SequentFormula getSequentFormula() {
- return sequentFormula;
+ public Term getSeqFormula() {
+ return seqFormula;
}
/**
@@ -883,7 +890,7 @@ public Term getTerm() {
@Override
public String toString() {
return tacletOperation + ", sequent = " + sequent + ", sequent formula = "
- + sequentFormula + ", term = " + term;
+ + seqFormula + ", term = " + term;
}
/**
@@ -894,20 +901,20 @@ public String toString() {
public enum TacletOperation {
/**
* Add clause of a {@link Taclet} applied to the antecedent. Available information are
- * {@link TacletLabelHint#getSequent()} and {@link TacletLabelHint#getSequentFormula()}.
+ * {@link TacletLabelHint#getSequent()} and {@link TacletLabelHint#getSeqFormula()}.
*/
ADD_ANTECEDENT,
/**
* Add clause of a {@link Taclet} applied to the succedent. Available information are
- * {@link TacletLabelHint#getSequent()} and {@link TacletLabelHint#getSequentFormula()}.
+ * {@link TacletLabelHint#getSequent()} and {@link TacletLabelHint#getSeqFormula()}.
*/
ADD_SUCCEDENT,
/**
* Replace clause of a {@link Taclet} provides a {@link Sequent} and currently
* additional adds to the antecedent are performed. Available information are
- * {@link TacletLabelHint#getSequent()} and {@link TacletLabelHint#getSequentFormula()}.
+ * {@link TacletLabelHint#getSequent()} and {@link TacletLabelHint#getSeqFormula()}.
*/
REPLACE_TO_ANTECEDENT,
@@ -915,7 +922,7 @@ public enum TacletOperation {
* Replace clause of a {@link Taclet} provides a {@link Sequent} and currently the
* current {@link PosInOccurrence} on the succedent is modified. Available information
* are {@link TacletLabelHint#getSequent()} and
- * {@link TacletLabelHint#getSequentFormula()}.
+ * {@link TacletLabelHint#getSeqFormula()}.
*/
REPLACE_AT_SUCCEDENT,
@@ -923,21 +930,21 @@ public enum TacletOperation {
* Replace clause of a {@link Taclet} provides a {@link Sequent} and currently the
* current {@link PosInOccurrence} on the antecedent is modified. Available information
* are {@link TacletLabelHint#getSequent()} and
- * {@link TacletLabelHint#getSequentFormula()}.
+ * {@link TacletLabelHint#getSeqFormula()}.
*/
REPLACE_AT_ANTECEDENT,
/**
* Replace clause of a {@link Taclet} provides a {@link Sequent} and currently
* additional adds to the succedent are performed. Available information are
- * {@link TacletLabelHint#getSequent()} and {@link TacletLabelHint#getSequentFormula()}.
+ * {@link TacletLabelHint#getSequent()} and {@link TacletLabelHint#getSeqFormula()}.
*/
REPLACE_TO_SUCCEDENT,
/**
* Replace clause of a {@link Taclet} provides a {@link Term} which is currently used to
* modify the {@link PosInOccurrence}. Available information are
- * {@link TacletLabelHint#getTerm()}.
+ * {@link TacletLabelHint#getSeqFormula()}.
*/
REPLACE_TERM
}
@@ -955,7 +962,7 @@ public enum TacletOperation {
*/
@Override
public @NonNull ImmutableList apply(Goal goal, Services services, RuleApp tacletApp) {
- return getExecutor().apply(goal, services, tacletApp);
+ return getExecutor().apply((Goal) goal, services, tacletApp);
}
public TacletExecutor extends Taclet> getExecutor() {
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/TacletApp.java b/key.core/src/main/java/de/uka/ilkd/key/rule/TacletApp.java
index a98632eb8ef..feecc41cc5d 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/TacletApp.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/TacletApp.java
@@ -236,8 +236,8 @@ private static Term getTermBelowQuantifier(SchemaVariable varSV, Term term) {
* @return the term below the given quantifier in the find and if-parts of the Taclet
*/
private static Term getTermBelowQuantifier(Taclet taclet, SchemaVariable varSV) {
- for (SequentFormula sequentFormula : taclet.ifSequent()) {
- Term result = getTermBelowQuantifier(varSV, sequentFormula.formula());
+ for (Term assumesFml : taclet.ifSequent()) {
+ Term result = getTermBelowQuantifier(varSV, assumesFml);
if (result != null) {
return result;
}
@@ -895,7 +895,7 @@ public ImmutableList findIfFormulaInstantiations(Sequent seq, Service
* @return a list of tacletapps with the found if formula instantiations
*/
private ImmutableList findIfFormulaInstantiationsHelp(
- ImmutableList ruleSuccTail, ImmutableList ruleAntecTail,
+ ImmutableList ruleSuccTail, ImmutableList ruleAntecTail,
ImmutableArray instSucc,
ImmutableArray instAntec,
ImmutableList instAlreadyMatched, MatchConditions matchCond,
@@ -918,8 +918,8 @@ private ImmutableList findIfFormulaInstantiationsHelp(
}
// Match the current formula
- IfMatchResult mr = taclet().getMatcher().matchIf(instSucc, ruleSuccTail.head().formula(),
- matchCond, services);
+ Term fml = ruleSuccTail.head();
+ IfMatchResult mr = taclet().getMatcher().matchIf(instSucc, fml, matchCond, services);
// For each matching formula call the method again to match
// the remaining terms
@@ -935,10 +935,10 @@ private ImmutableList findIfFormulaInstantiationsHelp(
return res;
}
- private ImmutableList createSemisequentList(Semisequent p_ss) {
- ImmutableList res = ImmutableSLList.nil();
+ private ImmutableList createSemisequentList(Semisequent p_ss) {
+ ImmutableList res = ImmutableSLList.nil();
- for (SequentFormula p_s : p_ss) {
+ for (Term p_s : p_ss) {
res = res.prepend(p_s);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/TacletSchemaVariableCollector.java b/key.core/src/main/java/de/uka/ilkd/key/rule/TacletSchemaVariableCollector.java
index 04d610c2326..60356bf5e21 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/TacletSchemaVariableCollector.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/TacletSchemaVariableCollector.java
@@ -10,7 +10,6 @@
import de.uka.ilkd.key.logic.JavaBlock;
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.TermLabel;
import de.uka.ilkd.key.logic.op.*;
@@ -159,8 +158,8 @@ public boolean contains(SchemaVariable var) {
* @param semiseq the Semisequent to visit
*/
private void visit(Semisequent semiseq) {
- for (SequentFormula aSemiseq : semiseq) {
- aSemiseq.formula().execPostOrder(this);
+ for (Term aSemiseq : semiseq) {
+ aSemiseq.execPostOrder(this);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java
index 20c4103252c..26c7109e5a8 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java
@@ -56,8 +56,8 @@ private UseDependencyContractRule() {
private static List getEqualityDefs(Term term, Sequent seq) {
final List result = new LinkedList<>();
- for (SequentFormula cf : seq.antecedent()) {
- final Term formula = cf.formula();
+ for (Term cf : seq.antecedent()) {
+ final Term formula = cf;
if (formula.op() instanceof Equality && formula.sub(1).equals(term)) {
result.add(formula.sub(0));
}
@@ -69,8 +69,8 @@ private static List getEqualityDefs(Term term, Sequent seq) {
private static List> getEqualityDefsAndPos(Term term, Sequent seq) {
final List> result =
new LinkedList<>();
- for (SequentFormula cf : seq.antecedent()) {
- final Term formula = cf.formula();
+ for (Term cf : seq.antecedent()) {
+ final Term formula = cf;
if (formula.op() instanceof Equality && formula.sub(1).equals(term)) {
final PosInOccurrence pos = new PosInOccurrence(cf, PosInTerm.getTopLevel(), true);
result.add(new Pair<>(formula.sub(0), pos));
@@ -83,8 +83,8 @@ private static List> getEqualityDefsAndPos(Term term
private ImmutableSet addEqualDefs(ImmutableSet terms, Goal g) {
ImmutableList result = ImmutableSLList.nil();
- for (SequentFormula cf : g.sequent().antecedent()) {
- final Term formula = cf.formula();
+ for (Term cf : g.sequent().antecedent()) {
+ final Term formula = cf;
if (formula.op() instanceof Equality && terms.contains(formula.sub(1))) {
result = result.prepend(formula.sub(0));
}
@@ -234,11 +234,11 @@ private static void collectBaseOccsHelper(Term focus, PosInOccurrence pos,
private static Map collectBaseOccs(Term focus, Sequent seq) {
assert focus.op() instanceof IObserverFunction;
final Map result = new LinkedHashMap<>();
- for (SequentFormula cf : seq.antecedent()) {
+ for (Term cf : seq.antecedent()) {
final PosInOccurrence pos = new PosInOccurrence(cf, PosInTerm.getTopLevel(), true);
collectBaseOccsHelper(focus, pos, result);
}
- for (SequentFormula cf : seq.succedent()) {
+ for (Term cf : seq.succedent()) {
final PosInOccurrence pos = new PosInOccurrence(cf, PosInTerm.getTopLevel(), false);
collectBaseOccsHelper(focus, pos, result);
}
@@ -537,7 +537,7 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) {
final ImmutableList result = goal.split(1);
final Term termWithBaseHeap = TB.func(target, subs);
final Term implication = TB.imp(cutFormula, TB.equals(focus, termWithBaseHeap));
- result.head().addFormula(new SequentFormula(implication), true, false);
+ result.head().addFormula(implication, true, false);
return result;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/UseOperationContractRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/UseOperationContractRule.java
index ddad13b73f7..5bdc4d06df1 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/UseOperationContractRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/UseOperationContractRule.java
@@ -40,7 +40,6 @@
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.PosInProgram;
import de.uka.ilkd.key.logic.ProgramPrefix;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermFactory;
@@ -430,13 +429,13 @@ private static void applyInfFlow(Goal goal, final FunctionalOperationContract co
Taclet informationFlowContractApp = ifContractBuilder.buildTaclet(goal);
// add term and taclet to post goal
- goal.addFormula(new SequentFormula(contractApplPredTerm), true, false);
+ goal.addFormula(contractApplPredTerm, true, false);
goal.addTaclet(informationFlowContractApp, SVInstantiations.EMPTY_SVINSTANTIATIONS, true);
// information flow proofs might get easier if we add the (proved)
// method contract precondition as an assumption to the post goal
// (in case the precondition cannot be proved easily)
- goal.addFormula(new SequentFormula(finalPreTerm), true, false);
+ goal.addFormula(finalPreTerm, true, false);
final InfFlowProof proof = (InfFlowProof) goal.proof();
proof.addIFSymbol(contractApplPredTerm);
proof.addIFSymbol(informationFlowContractApp);
@@ -745,7 +744,7 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) {
finalPreTerm = TermLabelManager.refactorTerm(termLabelState, services, null, finalPreTerm,
this, preGoal, FINAL_PRE_TERM_HINT, null);
- preGoal.changeFormula(new SequentFormula(finalPreTerm), ruleApp.posInOccurrence());
+ preGoal.changeFormula(finalPreTerm, ruleApp.posInOccurrence());
TermLabelManager.refactorGoal(termLabelState, services, ruleApp.posInOccurrence(), this,
preGoal, null, null);
@@ -769,10 +768,11 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) {
new ImmutableArray<>(inst.progPost.sub(0)), null,
inst.progPost.getLabels()))),
null);
- postGoal.addFormula(new SequentFormula(wellFormedAnon), true, false);
- postGoal.changeFormula(new SequentFormula(tb.apply(inst.u, normalPost, null)),
+ postGoal.addFormula(wellFormedAnon, true, false);
+ Term uAssumptions2 = tb.apply(inst.u, normalPost, null);
+ postGoal.changeFormula(uAssumptions2,
ruleApp.posInOccurrence());
- postGoal.addFormula(new SequentFormula(postAssumption), true, false);
+ postGoal.addFormula(postAssumption, true, false);
applyInfFlow(postGoal, contract, inst, contractSelf, contractParams, contractResult,
tb.var(excVar), mby, atPreUpdates, finalPreTerm, anonUpdateDatas, services);
@@ -791,15 +791,17 @@ public boolean isApplicable(Goal goal, PosInOccurrence pio) {
null);
final Term excPost =
globalDefs == null ? originalExcPost : tb.apply(globalDefs, originalExcPost);
- excPostGoal.addFormula(new SequentFormula(wellFormedAnon), true, false);
- excPostGoal.changeFormula(new SequentFormula(tb.apply(inst.u, excPost, null)),
+ excPostGoal.addFormula(wellFormedAnon, true, false);
+ Term uAssumptions1 = tb.apply(inst.u, excPost, null);
+ excPostGoal.changeFormula(uAssumptions1,
ruleApp.posInOccurrence());
- excPostGoal.addFormula(new SequentFormula(excPostAssumption), true, false);
+ excPostGoal.addFormula(excPostAssumption, true, false);
// create "Null Reference" branch
if (nullGoal != null) {
final Term actualSelfNotNull = tb.not(tb.equals(inst.actualSelf, tb.NULL()));
- nullGoal.changeFormula(new SequentFormula(tb.apply(inst.u, actualSelfNotNull, null)),
+ Term uAssumptions = tb.apply(inst.u, actualSelfNotNull, null);
+ nullGoal.changeFormula(uAssumptions,
ruleApp.posInOccurrence());
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java
index 008099a3094..b4a1515d858 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/WhileInvariantRule.java
@@ -34,7 +34,6 @@
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.ProgramElementName;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermServices;
@@ -414,7 +413,7 @@ private static void setUpInfFlowPartOfUseGoal(final InfFlowData infData, final T
final Term infFlowAssumptions = tb.apply(infData.updates.first, tb.and(beforeAssumptions,
tb.apply(infData.updates.second, tb.and(afterAssumptions, infData.applPredTerm))));
- goal.addFormula(new SequentFormula(infFlowAssumptions), true, false);
+ goal.addFormula(infFlowAssumptions, true, false);
goal.addTaclet(infData.infFlowApp, SVInstantiations.EMPTY_SVINSTANTIATIONS, true);
final InfFlowProof proof = (InfFlowProof) goal.proof();
proof.addIFSymbol(infData.applPredTerm);
@@ -464,7 +463,7 @@ private static InfFlowData setUpInfFlowValidityGoal(Goal infFlowGoal,
final Term finalTerm =
tb.imp(tb.label(selfComposedExec, ParameterlessTermLabel.SELF_COMPOSITION_LABEL), post);
((InfFlowProof) infFlowGoal.proof()).addLabeledIFSymbol(selfComposedExec);
- infFlowGoal.addFormula(new SequentFormula(finalTerm), false, true);
+ infFlowGoal.addFormula(finalTerm, false, true);
return infFlowData;
}
@@ -545,13 +544,13 @@ private Term bodyTerm(TermLabelState termLabelState, Services services, RuleApp
}
- private SequentFormula initFormula(TermLabelState termLabelState, Instantiation inst,
+ private Term initFormula(TermLabelState termLabelState, Instantiation inst,
final Term invTerm, Term reachableState, Services services, Goal initGoal) {
final TermBuilder tb = services.getTermBuilder();
Term sfTerm = tb.apply(inst.u, tb.and(invTerm, reachableState), null);
sfTerm = TermLabelManager.refactorTerm(termLabelState, services, null, sfTerm, this,
initGoal, INITIAL_INVARIANT_ONLY_HINT, null);
- return new SequentFormula(sfTerm);
+ return sfTerm;
}
private Term useCaseFormula(TermLabelState termLabelState, Services services, RuleApp ruleApp,
@@ -614,15 +613,16 @@ private void prepareBodyPreservesBranch(TermLabelState termLabelState, Services
final Term[] uBeforeLoopDefAnonVariant, final Term uAnonInv) {
final TermBuilder tb = services.getTermBuilder();
bodyGoal.setBranchLabel(BODY_PRESERVES_INVARIANT_LABEL);
- bodyGoal.addFormula(new SequentFormula(wellFormedAnon), true, false);
+ bodyGoal.addFormula(wellFormedAnon, true, false);
- bodyGoal.addFormula(new SequentFormula(uAnonInv), true, false);
+ bodyGoal.addFormula(uAnonInv, true, false);
Term guardTrueBody = bodyTerm(termLabelState, services, ruleApp, applicationSequent, inst,
invTerm, frameCondition, variantPO, bodyGoal, guardJb, guardTrueTerm);
+ Term uAssumptions = tb.applySequential(uBeforeLoopDefAnonVariant, guardTrueBody);
bodyGoal.changeFormula(
- new SequentFormula(tb.applySequential(uBeforeLoopDefAnonVariant, guardTrueBody)),
+ uAssumptions,
ruleApp.posInOccurrence());
}
@@ -632,13 +632,14 @@ private void prepareUseCaseBranch(TermLabelState termLabelState, Services servic
final JavaBlock guardJb, final Term guardFalseTerm, final Term[] uAnon,
final Term uAnonInv) {
useGoal.setBranchLabel("Use Case");
- useGoal.addFormula(new SequentFormula(wellFormedAnon), true, false);
- useGoal.addFormula(new SequentFormula(uAnonInv), true, false);
+ useGoal.addFormula(wellFormedAnon, true, false);
+ useGoal.addFormula(uAnonInv, true, false);
final TermBuilder tb = services.getTermBuilder();
Term guardFalseRestPsi = useCaseFormula(termLabelState, services, ruleApp, inst, useGoal,
guardJb, guardFalseTerm);
- useGoal.changeFormula(new SequentFormula(tb.applySequential(uAnon, guardFalseRestPsi)),
+ Term uAssumptions = tb.applySequential(uAnon, guardFalseRestPsi);
+ useGoal.changeFormula(uAssumptions,
ruleApp.posInOccurrence());
}
@@ -696,7 +697,7 @@ private void setupWdGoal(final Goal goal, final LoopSpecification inv, final Ter
self = null;
}
services.getSpecificationRepository().addWdStatement(lwd);
- final SequentFormula wdInv =
+ final Term wdInv =
lwd.generateSequent(self, heap, anonHeap, localIns, update, localAnonUpdate, services);
goal.changeFormula(wdInv, pio);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/AntecTacletExecutor.java b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/AntecTacletExecutor.java
index 2033daf4d37..311577b10eb 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/AntecTacletExecutor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/AntecTacletExecutor.java
@@ -7,7 +7,7 @@
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.Sequent;
import de.uka.ilkd.key.logic.SequentChangeInfo;
-import de.uka.ilkd.key.logic.SequentFormula;
+import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.TermLabelState;
import de.uka.ilkd.key.proof.Goal;
import de.uka.ilkd.key.rule.AntecTaclet;
@@ -60,7 +60,7 @@ matchCond, new TacletLabelHint(TacletOperation.REPLACE_AT_ANTECEDENT, replWith),
/**
* applies the {@code add}-expressions of taclet goal descriptions
*
- * @param add the {@link Sequent} with the uninstantiated {@link SequentFormula}'s to be added
+ * @param add the {@link Sequent} with the uninstantiated {@link Term}'s to be added
* to the goal's sequent
* @param termLabelState The {@link TermLabelState} of the current rule application.
* @param currentSequent the {@link SequentChangeInfo} which is the current (intermediate)
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/FindTacletExecutor.java b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/FindTacletExecutor.java
index 2866c6d0e12..03c1c6b5c33 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/FindTacletExecutor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/FindTacletExecutor.java
@@ -52,7 +52,7 @@ protected abstract void applyReplacewith(TacletGoalTemplate gt, TermLabelState t
/**
* applies the {@code add}-expressions of taclet goal descriptions
*
- * @param add the {@link Sequent} with the uninstantiated {@link SequentFormula}'s to be added
+ * @param add the {@link Sequent} with the uninstantiated {@link Term}'s to be added
* to the goal's sequent
* @param termLabelState The {@link TermLabelState} of the current rule application.
* @param currentSequent the {@link SequentChangeInfo} which is the current (intermediate)
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/RewriteTacletExecutor.java b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/RewriteTacletExecutor.java
index 0ea5c2ecb63..793053ae10a 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/RewriteTacletExecutor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/RewriteTacletExecutor.java
@@ -8,7 +8,6 @@
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.Sequent;
import de.uka.ilkd.key.logic.SequentChangeInfo;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.TermLabelManager;
import de.uka.ilkd.key.logic.label.TermLabelState;
@@ -64,26 +63,26 @@ private Term replace(Term term, Term with, TermLabelState termLabelState,
}
- private SequentFormula applyReplacewithHelper(Goal goal, TermLabelState termLabelState,
+ private Term applyReplacewithHelper(Goal goal, TermLabelState termLabelState,
RewriteTacletGoalTemplate gt, PosInOccurrence posOfFind, Services services,
MatchConditions matchCond, RuleApp ruleApp) {
- final Term term = posOfFind.sequentFormula().formula();
+ final Term term = posOfFind.sequentLevelFormula();
final IntIterator it = posOfFind.posInTerm().iterator();
final Term rwTemplate = gt.replaceWith();
Term formula = replace(term, rwTemplate, termLabelState, new TacletLabelHint(rwTemplate),
posOfFind, it, matchCond, term.sort(), goal, services, ruleApp);
- formula = TermLabelManager.refactorSequentFormula(termLabelState, services, formula,
+ formula = TermLabelManager.refactorTerm(termLabelState, services, formula,
posOfFind, taclet, goal, null, rwTemplate);
if (term == formula) {
- return posOfFind.sequentFormula();
+ return posOfFind.sequentLevelFormula();
} else {
- return new SequentFormula(formula);
+ return formula;
}
}
- public SequentFormula getRewriteResult(Goal goal, TermLabelState termLabelState,
+ public Term getRewriteResult(Goal goal, TermLabelState termLabelState,
Services services, TacletApp app) {
assert taclet.goalTemplates().size() == 1;
assert taclet.goalTemplates().head().sequent().isEmpty();
@@ -104,19 +103,19 @@ protected void applyReplacewith(TacletGoalTemplate gt, TermLabelState termLabelS
SequentChangeInfo currentSequent, PosInOccurrence posOfFind, MatchConditions matchCond,
Goal goal, RuleApp ruleApp, Services services) {
if (gt instanceof RewriteTacletGoalTemplate) {
- final SequentFormula cf = applyReplacewithHelper(goal, termLabelState,
+ final Term cf = applyReplacewithHelper(goal, termLabelState,
(RewriteTacletGoalTemplate) gt, posOfFind, services, matchCond, ruleApp);
currentSequent.combine(currentSequent.sequent().changeFormula(cf, posOfFind));
} else {
// Then there was no replacewith...
// This is strange in a RewriteTaclet, but who knows...
// However, term label refactorings have to be performed.
- final Term oldFormula = posOfFind.sequentFormula().formula();
- final Term newFormula = TermLabelManager.refactorSequentFormula(termLabelState,
+ final Term oldFormula = posOfFind.sequentLevelFormula();
+ final Term newFormula = TermLabelManager.refactorTerm(termLabelState,
services, oldFormula, posOfFind, taclet, goal, null, null);
if (oldFormula != newFormula) {
currentSequent.combine(currentSequent.sequent()
- .changeFormula(new SequentFormula(newFormula), posOfFind));
+ .changeFormula(newFormula, posOfFind));
}
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/TacletExecutor.java b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/TacletExecutor.java
index e9ca72c22c6..c49c334b9bb 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/TacletExecutor.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/TacletExecutor.java
@@ -13,7 +13,6 @@
import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.SemisequentChangeInfo;
import de.uka.ilkd.key.logic.SequentChangeInfo;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermServices;
import de.uka.ilkd.key.logic.VariableNamer;
@@ -89,17 +88,17 @@ protected Term syntacticalReplace(Term term, TermLabelState termLabelState,
}
/**
- * adds SequentFormula to antecedent or succedent depending on position information or the
+ * adds Term to antecedent or succedent depending on position information or the
* boolean antec contrary to "addToPos" frm will not be modified
*
- * @param frm the {@link SequentFormula} that should be added
+ * @param frm the {@link Term} that should be added
* @param currentSequent the {@link SequentChangeInfo} which is the current (intermediate)
* result of applying the taclet
* @param pos the {@link PosInOccurrence} describing the place in the sequent
* @param antec boolean true(false) if elements have to be added to the antecedent(succedent)
* (only looked at if pos == null)
*/
- private void addToPosWithoutInst(SequentFormula frm, SequentChangeInfo currentSequent,
+ private void addToPosWithoutInst(Term frm, SequentChangeInfo currentSequent,
PosInOccurrence pos, boolean antec) {
if (pos != null) {
currentSequent.combine(currentSequent.sequent().addFormula(frm, pos));
@@ -116,23 +115,23 @@ private void addToPosWithoutInst(SequentFormula frm, SequentChangeInfo currentSe
* instantiated formula) is returned.
*
* @param termLabelState The {@link TermLabelState} of the current rule application.
- * @param schemaFormula the SequentFormula to be instantiated
+ * @param schemaFormula the Term to be instantiated
* @param services the Services object carrying ja related information
* @param matchCond the MatchConditions object with the instantiations of the schemavariables,
* constraints etc.
* @param applicationPosInOccurrence The {@link PosInOccurrence} of the {@link Term} which is
* rewritten
* @param labelHint The hint used to maintain {@link TermLabel}s.
- * @return the as far as possible instantiated SequentFormula
+ * @return the as far as possible instantiated Term
*/
- private SequentFormula instantiateReplacement(TermLabelState termLabelState,
- SequentFormula schemaFormula, Services services, MatchConditions matchCond,
+ private Term instantiateReplacement(TermLabelState termLabelState,
+ Term schemaFormula, Services services, MatchConditions matchCond,
PosInOccurrence applicationPosInOccurrence, TacletLabelHint labelHint, Goal goal,
RuleApp tacletApp) {
final SVInstantiations svInst = matchCond.getInstantiations();
- Term instantiatedFormula = syntacticalReplace(schemaFormula.formula(), termLabelState,
+ Term instantiatedFormula = syntacticalReplace(schemaFormula, termLabelState,
new TacletLabelHint(labelHint, schemaFormula), applicationPosInOccurrence, matchCond,
goal, tacletApp, services);
@@ -141,7 +140,7 @@ private SequentFormula instantiateReplacement(TermLabelState termLabelState,
.applyUpdatePairsSequential(svInst.getUpdateContext(), instantiatedFormula);
}
- return new SequentFormula(instantiatedFormula);
+ return instantiatedFormula;
}
/**
@@ -157,14 +156,14 @@ private SequentFormula instantiateReplacement(TermLabelState termLabelState,
* @param services the Services
* @return the instantiated formulas of the semisequent as list
*/
- protected ImmutableList instantiateSemisequent(Semisequent semi,
+ protected ImmutableList instantiateSemisequent(Semisequent semi,
TermLabelState termLabelState, TacletLabelHint labelHint,
PosInOccurrence applicationPosInOccurrence, MatchConditions matchCond, Goal goal,
RuleApp tacletApp, Services services) {
- ImmutableList replacements = ImmutableSLList.nil();
+ ImmutableList replacements = ImmutableSLList.nil();
- for (SequentFormula sf : semi) {
+ for (Term sf : semi) {
replacements = replacements.append(instantiateReplacement(termLabelState, sf, services,
matchCond, applicationPosInOccurrence, labelHint, goal, tacletApp));
}
@@ -191,7 +190,7 @@ protected ImmutableList instantiateSemisequent(Semisequent semi,
protected void replaceAtPos(Semisequent semi, TermLabelState termLabelState,
SequentChangeInfo currentSequent, PosInOccurrence pos, MatchConditions matchCond,
TacletLabelHint labelHint, Goal goal, RuleApp ruleApp, Services services) {
- final ImmutableList replacements = instantiateSemisequent(semi,
+ final ImmutableList replacements = instantiateSemisequent(semi,
termLabelState, labelHint, pos, matchCond, goal, ruleApp, services);
currentSequent.combine(currentSequent.sequent().changeFormula(replacements, pos));
}
@@ -219,7 +218,7 @@ private void addToPos(Semisequent semi, TermLabelState termLabelState,
PosInOccurrence applicationPosInOccurrence, boolean antec, TacletLabelHint labelHint,
MatchConditions matchCond, Goal goal, Services services, RuleApp tacletApp) {
- final ImmutableList replacements =
+ final ImmutableList replacements =
instantiateSemisequent(semi, termLabelState, labelHint, applicationPosInOccurrence,
matchCond, goal, tacletApp, services);
if (pos != null) {
@@ -230,7 +229,7 @@ private void addToPos(Semisequent semi, TermLabelState termLabelState,
}
/**
- * adds SequentFormula to antecedent depending on position information (if none is handed over
+ * adds Term to antecedent depending on position information (if none is handed over
* it is added at the head of the antecedent). Of course it has to be ensured that the position
* information describes one occurrence in the antecedent of the sequent.
*
@@ -256,7 +255,7 @@ protected void addToAntec(Semisequent semi, TermLabelState termLabelState,
}
/**
- * adds SequentFormula to succedent depending on position information (if none is handed over it
+ * adds Term to succedent depending on position information (if none is handed over it
* is added at the head of the succedent). Of course it has to be ensured that the position
* information describes one occurrence in the succedent of the sequent.
*
@@ -419,7 +418,7 @@ protected ImmutableList checkIfGoals(Goal p_goal,
for (final IfFormulaInstantiation inst : p_list) {
if (!(inst instanceof IfFormulaInstSeq)) {
// build the if obligation formula
- ifPart = inst.getConstrainedFormula().formula();
+ ifPart = inst.getConstrainedFormula();
// negate formulas of the if-succedent
final TermServices services = p_goal.proof().getServices();
@@ -470,7 +469,7 @@ protected ImmutableList checkIfGoals(Goal p_goal,
seq = itNewGoalSequents.next();
}
- addToPosWithoutInst(new SequentFormula(ifObl), seq, null, false);
+ addToPosWithoutInst(ifObl, seq, null, false);
}
return res;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/label/TermLabelMerger.java b/key.core/src/main/java/de/uka/ilkd/key/rule/label/TermLabelMerger.java
index dd2fa9e20fb..a1e0d567191 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/label/TermLabelMerger.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/label/TermLabelMerger.java
@@ -7,7 +7,6 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.TermLabel;
import de.uka.ilkd.key.logic.label.TermLabelManager;
@@ -16,7 +15,7 @@
*
* A {@link TermLabelMerger} is used by
* {@link TermLabelManager#mergeLabels(Services, de.uka.ilkd.key.logic.SequentChangeInfo)} to merge
- * {@link TermLabel}s in case a {@link SequentFormula} was rejected to be added to the resulting
+ * {@link TermLabel}s in case a {@link Term} was rejected to be added to the resulting
* {@link Sequent}.
*
*
@@ -32,18 +31,18 @@ public interface TermLabelMerger {
/**
* Merges the existing and the rejected {@link TermLabel} by updating the merged {@link List}.
*
- * @param existingSF The existing {@link SequentFormula}.
- * @param existingTerm The {@link Term} of the existing {@link SequentFormula}.
+ * @param existingSF The existing {@link Term}.
+ * @param existingTerm The {@link Term} of the existing {@link Term}.
* @param existingLabel The existing {@link TermLabel} if available or {@code null} otherwise.
- * @param rejectedSF The rejected {@link SequentFormula}.
- * @param rejectedTerm The {@link Term} of the rejected {@link SequentFormula}.
+ * @param rejectedSF The rejected {@link Term}.
+ * @param rejectedTerm The {@link Term} of the rejected {@link Term}.
* @param rejectedLabel The rejected {@link TermLabel}.
* @param mergedLabels The {@link List} with new {@link TermLabel}s which will be visible in the
* resulting {@link Sequent}.
* @return {@code true} if the {@link List} of {@link TermLabel} was modified and {@code false}
* otherwise.
*/
- boolean mergeLabels(SequentFormula existingSF, Term existingTerm,
- TermLabel existingLabel, SequentFormula rejectedSF, Term rejectedTerm,
+ boolean mergeLabels(Term existingSF, Term existingTerm,
+ TermLabel existingLabel, Term rejectedSF, Term rejectedTerm,
TermLabel rejectedLabel, List mergedLabels);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/label/TermLabelRefactoring.java b/key.core/src/main/java/de/uka/ilkd/key/rule/label/TermLabelRefactoring.java
index 85fed275c36..606cc7262a0 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/label/TermLabelRefactoring.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/label/TermLabelRefactoring.java
@@ -6,7 +6,6 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.label.LabelCollection;
@@ -161,7 +160,7 @@ enum RefactoringScope {
APPLICATION_CHILDREN_AND_GRANDCHILDREN_SUBTREE,
/**
- * Refactor the {@link SequentFormula} on which the rule is applied.
+ * Refactor the {@link Term} on which the rule is applied.
*/
APPLICATION_CHILDREN_AND_GRANDCHILDREN_SUBTREE_AND_PARENTS,
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/match/vm/VMTacletMatcher.java b/key.core/src/main/java/de/uka/ilkd/key/rule/match/vm/VMTacletMatcher.java
index 7832eae3b67..409bb2008e9 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/match/vm/VMTacletMatcher.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/match/vm/VMTacletMatcher.java
@@ -9,7 +9,6 @@
import de.uka.ilkd.key.java.ProgramElement;
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.Operator;
import de.uka.ilkd.key.logic.op.QuantifiableVariable;
@@ -101,8 +100,8 @@ public VMTacletMatcher(Taclet taclet) {
findMatchProgram = TacletMatchProgram.EMPTY_PROGRAM;
}
- for (SequentFormula sf : assumesSequent) {
- assumesMatchPrograms.put(sf.formula(), TacletMatchProgram.createProgram(sf.formula()));
+ for (Term sf : assumesSequent) {
+ assumesMatchPrograms.put(sf, TacletMatchProgram.createProgram(sf));
}
}
@@ -132,7 +131,7 @@ public final IfMatchResult matchIf(Iterable p_toMatch,
}
for (var cf : p_toMatch) {
- Term formula = cf.getConstrainedFormula().formula();
+ Term formula = cf.getConstrainedFormula();
if (updateContextPresent) {
formula = matchUpdateContext(context, formula);
@@ -189,8 +188,8 @@ private Term matchUpdateContext(ImmutableList context, Term for
public final MatchConditions matchIf(Iterable p_toMatch,
MatchConditions p_matchCond, Services p_services) {
- final Iterator anteIterator = assumesSequent.antecedent().iterator();
- final Iterator succIterator = assumesSequent.succedent().iterator();
+ final Iterator anteIterator = assumesSequent.antecedent().iterator();
+ final Iterator succIterator = assumesSequent.succedent().iterator();
ImmutableList newMC;
@@ -204,13 +203,13 @@ public final MatchConditions matchIf(Iterable p_toMatch,
// Default: just take the next ante formula, else succ formula
&& anteIterator.hasNext();
- Iterator itIfSequent = candidateInAntec ? anteIterator : succIterator;
+ Iterator itIfSequent = candidateInAntec ? anteIterator : succIterator;
// Fix end
assert itIfSequent.hasNext()
: "p_toMatch and assumes sequent must have same number of elements";
newMC = matchIf(ImmutableSLList.nil().prepend(candidateInst),
- itIfSequent.next().formula(), p_matchCond, p_services).getMatchConditions();
+ itIfSequent.next(), p_matchCond, p_services).getMatchConditions();
if (newMC.isEmpty()) {
return null;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/CloseAfterMerge.java b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/CloseAfterMerge.java
index 19b3b4b36e2..b3c8e4d7d63 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/CloseAfterMerge.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/CloseAfterMerge.java
@@ -13,7 +13,6 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.ldt.JavaDLTheory;
import de.uka.ilkd.key.logic.PosInOccurrence;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermServices;
@@ -133,7 +132,7 @@ public void proofGoalsAdded(ProofTreeEvent e) {
// a closed goal when loading a proof without the GUI (e.g.
// in a JUnit test).
- if (e.getGoals().size() == 0 && mergeNodeF.isClosed()) {
+ if (e.getGoals().isEmpty() && mergeNodeF.isClosed()) {
// The merged node was closed; now also close this node.
e.getSource().closeGoal(linkedGoal);
@@ -154,7 +153,7 @@ public void proofGoalsAdded(ProofTreeEvent e) {
// Delete previous sequents
clearSemisequent(ruleIsWeakeningGoal, true);
clearSemisequent(ruleIsWeakeningGoal, false);
- ruleIsWeakeningGoal.addFormula(new SequentFormula(isWeakeningForm), false, true);
+ ruleIsWeakeningGoal.addFormula(isWeakeningForm, false, true);
TermLabelManager.refactorGoal(termLabelState, services, ruleApp.posInOccurrence(), this,
ruleIsWeakeningGoal, null, null);
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java
index 3b83dceb151..332a94aed64 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/merge/MergeRule.java
@@ -14,7 +14,6 @@
import de.uka.ilkd.key.logic.PosInOccurrence;
import de.uka.ilkd.key.logic.PosInTerm;
import de.uka.ilkd.key.logic.Semisequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.logic.TermServices;
@@ -235,13 +234,13 @@ public String toString() {
// Add new antecedent (path condition)
for (Term antecedentFormula : getConjunctiveElementsFor(resultPathCondition)) {
- final SequentFormula newAntecedent = new SequentFormula(antecedentFormula);
+ final Term newAntecedent = antecedentFormula;
newGoal.addFormula(newAntecedent, true, false);
}
// Add new succedent (symbolic state & program counter)
final Term succedentFormula = tb.apply(mergedState.first, thisSEState.third);
- final SequentFormula newSuccedent = new SequentFormula(succedentFormula);
+ final Term newSuccedent = succedentFormula;
newGoal.addFormula(newSuccedent,
new PosInOccurrence(newSuccedent, PosInTerm.getTopLevel(), false));
@@ -276,7 +275,7 @@ public String toString() {
clearSemisequent(sideConditionGoal, false);
final Term sideCondition = sideCondIt.next();
- sideConditionGoal.addFormula(new SequentFormula(sideCondition),
+ sideConditionGoal.addFormula(sideCondition,
new PosInOccurrence(newSuccedent, PosInTerm.getTopLevel(), false));
i++;
@@ -686,7 +685,7 @@ public static ImmutableList findPotentialMergePartners(Goal goal,
if (!g.equals(goal) && !g.isLinked()) {
Semisequent succedent = g.sequent().succedent();
for (int i = 0; i < succedent.size(); i++) {
- final SequentFormula f = succedent.get(i);
+ final Term f = succedent.get(i);
final PosInTerm pit = PosInTerm.getTopLevel();
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/RewriteTacletBuilderSchemaVarCollector.java b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/RewriteTacletBuilderSchemaVarCollector.java
index 0e933eec771..de0dcc617fa 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/RewriteTacletBuilderSchemaVarCollector.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/RewriteTacletBuilderSchemaVarCollector.java
@@ -7,7 +7,6 @@
import java.util.Set;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.SchemaVariable;
import de.uka.ilkd.key.rule.RewriteTaclet;
@@ -86,8 +85,8 @@ public void subtreeLeft(Term subtreeRoot) {
private Set collectSchemaVariables(Sequent s) {
Set result = new LinkedHashSet<>();
- for (final SequentFormula cf : s) {
- result.addAll(collectSchemaVariables(cf.formula()));
+ for (final Term cf : s) {
+ result.addAll(collectSchemaVariables(cf));
}
return result;
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletBuilder.java
index a52fd22bfb0..724dd06fb98 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletBuilder.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletBuilder.java
@@ -67,8 +67,8 @@ private static boolean containsFreeVarSV(Term t) {
}
private static boolean containsFreeVarSV(Sequent sequent) {
- for (final SequentFormula cf : sequent) {
- if (containsFreeVarSV(cf.formula())) {
+ for (final Term cf : sequent) {
+ if (containsFreeVarSV(cf)) {
return true;
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGenerator.java b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGenerator.java
index 09dd56b2c45..9460eed80a5 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGenerator.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGenerator.java
@@ -52,7 +52,7 @@ public static TacletGenerator getInstance() {
private TacletGoalTemplate createAxiomGoalTemplate(Term goalTerm) {
- final SequentFormula axiomSf = new SequentFormula(goalTerm);
+ final Term axiomSf = goalTerm;
final Semisequent axiomSemiSeq =
Semisequent.EMPTY_SEMISEQUENT.insertFirst(axiomSf).semisequent();
final Sequent axiomSeq = Sequent.createAnteSequent(axiomSemiSeq);
@@ -146,7 +146,7 @@ public Taclet generateRelationalRepresentsTaclet(Name tacletName, Term originalA
final TermAndBoundVarPair schemaAxiom = createSchemaTerm(originalAxiom, pvs, svs, services);
// create goal template
- SequentFormula guardedSchemaAxiom = generateGuard(kjt, target, services, selfSV, heapSVs,
+ Term guardedSchemaAxiom = generateGuard(kjt, target, services, selfSV, heapSVs,
paramSVs, schemaAxiom.term, tacletBuilder, satisfiabilityGuard);
final Sequent addedSeq = Sequent.createAnteSequent(
Semisequent.EMPTY_SEMISEQUENT.insertFirst(guardedSchemaAxiom).semisequent());
@@ -249,14 +249,14 @@ public ImmutableSet generateFunctionalRepresentsTaclets(Name name, Term
*/
// ifSeq = null;
final Term ifFormula = TB.equals(TB.var(selfSV), TB.NULL());
- final SequentFormula ifCf = new SequentFormula(ifFormula);
+ final Term ifCf = ifFormula;
final Semisequent ifSemiSeq =
Semisequent.EMPTY_SEMISEQUENT.insertFirst(ifCf).semisequent();
ifSeq = Sequent.createSuccSequent(ifSemiSeq);
} else {
/* \assumes ( Sort.exactInstance(self) ==> ) */
final Term ifFormula = TB.exactInstance(kjt.getSort(), TB.var(selfSV));
- final SequentFormula ifCf = new SequentFormula(ifFormula);
+ final Term ifCf = ifFormula;
final Semisequent ifSemiSeq =
Semisequent.EMPTY_SEMISEQUENT.insertFirst(ifCf).semisequent();
ifSeq = Sequent.createAnteSequent(ifSemiSeq);
@@ -351,7 +351,7 @@ private void functionalRepresentsAddSatisfiabilityBranch(IObserverFunction targe
final RewriteTacletBuilder extends RewriteTaclet> tacletBuilder) {
final Term axiomSatisfiable = functionalRepresentsSatisfiability(target, services, heapSVs,
selfSV, paramSVs, schemaRepresents, tacletBuilder);
- SequentFormula addedCf = new SequentFormula(axiomSatisfiable);
+ Term addedCf = axiomSatisfiable;
final Semisequent addedSemiSeq =
Semisequent.EMPTY_SEMISEQUENT.insertFirst(addedCf).semisequent();
final Sequent addedSeq = Sequent.createSuccSequent(addedSemiSeq);
@@ -526,7 +526,7 @@ public ImmutableSet generateContractAxiomTaclets(Name name, Term origina
pvs, svs, services);
final Term addedFormula = schemaAdd.term;
- final SequentFormula addedCf = new SequentFormula(addedFormula);
+ final Term addedCf = addedFormula;
final Semisequent addedSemiSeq =
Semisequent.EMPTY_SEMISEQUENT.insertFirst(addedCf).semisequent();
final Sequent addedSeq = Sequent.createAnteSequent(addedSemiSeq);
@@ -662,7 +662,7 @@ public ImmutableSet generatePartialInvTaclet(Name name, List hea
result = result.union(limited.second);
// create added sequent
- final SequentFormula addedCf = new SequentFormula(limitedAxiom);
+ final Term addedCf = limitedAxiom;
final Semisequent addedSemiSeq =
Semisequent.EMPTY_SEMISEQUENT.insertFirst(addedCf).semisequent();
final Sequent addedSeq = Sequent.createAnteSequent(addedSemiSeq);
@@ -707,8 +707,8 @@ public ImmutableSet generatePartialInvTaclet(Name name, List hea
// \assumes( self = EQ ==> EQ = null )
final Term selfEQ = TB.equals(TB.var(selfSV), TB.var(eqSV));
final Term eqNull = TB.equals(TB.var(eqSV), TB.NULL());
- final SequentFormula selfEQSF = new SequentFormula(selfEQ);
- final SequentFormula eqNullSF = new SequentFormula(eqNull);
+ final Term selfEQSF = selfEQ;
+ final Term eqNullSF = eqNull;
final Semisequent succ =
Semisequent.EMPTY_SEMISEQUENT.insertFirst(selfEQSF).semisequent();
final Semisequent ant =
@@ -718,7 +718,7 @@ public ImmutableSet generatePartialInvTaclet(Name name, List hea
} else if (!isStatic) {
// \assumes( ==> self = null )
final Term selfNull = TB.equals(TB.var(selfSV), TB.NULL());
- final SequentFormula selfNullSF = new SequentFormula(selfNull);
+ final Term selfNullSF = selfNull;
final Semisequent succ =
Semisequent.EMPTY_SEMISEQUENT.insertFirst(selfNullSF).semisequent();
final Sequent ifSeq = Sequent.createSuccSequent(succ);
@@ -930,7 +930,7 @@ private Pair> limitTerm(Term t,
}
- private SequentFormula generateGuard(KeYJavaType kjt, IObserverFunction target,
+ private Term generateGuard(KeYJavaType kjt, IObserverFunction target,
TermServices services, final OperatorSV selfSV, List heapSVs,
ImmutableList paramSVs, final Term schemaAxiom,
final RewriteTacletBuilder extends RewriteTaclet> tacletBuilder, boolean addGuard) {
@@ -942,7 +942,7 @@ private SequentFormula generateGuard(KeYJavaType kjt, IObserverFunction target,
: TB.tt();
// assemble formula
final Term guardedAxiom = TB.imp(TB.and(exactInstance, axiomSatisfiable), schemaAxiom);
- final SequentFormula guardedAxiomCf = new SequentFormula(guardedAxiom);
+ final Term guardedAxiomCf = guardedAxiom;
return guardedAxiomCf;
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletPrefixBuilder.java b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletPrefixBuilder.java
index c7574e69260..948b838fb76 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletPrefixBuilder.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletPrefixBuilder.java
@@ -6,7 +6,6 @@
import java.util.Iterator;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.label.TermLabel;
import de.uka.ilkd.key.logic.op.*;
@@ -103,8 +102,8 @@ private void visit(Term t) {
}
private void visit(Sequent s) {
- for (final SequentFormula cf : s) {
- visit(cf.formula());
+ for (final Term cf : s) {
+ visit(cf);
}
}
diff --git a/key.core/src/main/java/de/uka/ilkd/key/smt/SMTFocusResults.java b/key.core/src/main/java/de/uka/ilkd/key/smt/SMTFocusResults.java
index 4a20c0867c4..08d0ae975db 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/smt/SMTFocusResults.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/smt/SMTFocusResults.java
@@ -71,7 +71,7 @@ public static boolean focus(SMTProblem smtProblem, Services services) {
Semisequent succedent = goalNode.sequent().succedent();
int i = 1;
- for (SequentFormula sf : antecedent) {
+ for (Term sf : antecedent) {
PosInOccurrence pio =
PosInOccurrence.findInSequent(goalNode.sequent(), i, PosInTerm.getTopLevel());
if (!unsatCore.contains(pio)) {
@@ -80,13 +80,13 @@ public static boolean focus(SMTProblem smtProblem, Services services) {
TacletApp app = PosTacletApp.createPosTacletApp(hideLeft, new MatchConditions(),
new PosInOccurrence(sf, PosInTerm.getTopLevel(), true),
services);
- app = app.addCheckedInstantiation(schema, sf.formula(), services, true);
+ app = app.addCheckedInstantiation(schema, sf, services, true);
goal = goal.apply(app).iterator().next();
}
i++;
}
- for (SequentFormula sf : succedent) {
+ for (Term sf : succedent) {
PosInOccurrence pio =
PosInOccurrence.findInSequent(goalNode.sequent(), i, PosInTerm.getTopLevel());
if (!unsatCore.contains(pio)) {
@@ -96,7 +96,7 @@ public static boolean focus(SMTProblem smtProblem, Services services) {
PosTacletApp.createPosTacletApp(hideRight, new MatchConditions(),
new PosInOccurrence(sf, PosInTerm.getTopLevel(), false),
services);
- app = app.addCheckedInstantiation(schema, sf.formula(), services, true);
+ app = app.addCheckedInstantiation(schema, sf, services, true);
goal = goal.apply(app).iterator().next();
}
i++;
@@ -146,7 +146,7 @@ public static ImmutableList getUnsatCore(SMTProblem problem) {
Semisequent antecedent = goalNode.sequent().antecedent();
int i = 1;
- for (SequentFormula sf : antecedent) {
+ for (Term sf : antecedent) {
if (unsatCore.contains(i)) {
unsatCoreFormulas = unsatCoreFormulas.prepend(PosInOccurrence
.findInSequent(goalNode.sequent(), i, PosInTerm.getTopLevel()));
@@ -155,7 +155,7 @@ public static ImmutableList getUnsatCore(SMTProblem problem) {
}
Semisequent succedent = goalNode.sequent().succedent();
- for (SequentFormula sf : succedent) {
+ for (Term sf : succedent) {
if (unsatCore.contains(i)) {
unsatCoreFormulas = unsatCoreFormulas.prepend(PosInOccurrence
.findInSequent(goalNode.sequent(), i, PosInTerm.getTopLevel()));
diff --git a/key.core/src/main/java/de/uka/ilkd/key/smt/SMTProblem.java b/key.core/src/main/java/de/uka/ilkd/key/smt/SMTProblem.java
index 79176217814..e6cfce8a099 100644
--- a/key.core/src/main/java/de/uka/ilkd/key/smt/SMTProblem.java
+++ b/key.core/src/main/java/de/uka/ilkd/key/smt/SMTProblem.java
@@ -8,7 +8,6 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Sequent;
-import de.uka.ilkd.key.logic.SequentFormula;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.TermBuilder;
import de.uka.ilkd.key.proof.Goal;
@@ -162,14 +161,14 @@ public static Term sequentToTerm(Sequent s, Services services) {
final TermBuilder tb = services.getTermBuilder();
ante = ante.append(tb.tt());
- for (SequentFormula f : s.antecedent()) {
- ante = ante.append(f.formula());
+ for (Term f : s.antecedent()) {
+ ante = ante.append(f);
}
ImmutableList succ = ImmutableSLList.nil();
succ = succ.append(tb.ff());
- for (SequentFormula f : s.succedent()) {
- succ = succ.append(f.formula());
+ for (Term f : s.succedent()) {
+ succ = succ.append(f);
}
return tb.imp(tb.and(ante), tb.or(succ));
@@ -183,14 +182,14 @@ private Term sequentToTerm(Sequent s) {
final TermBuilder tb = goal.proof().getServices().getTermBuilder();
ante = ante.append(tb.tt());
- for (SequentFormula f : s.antecedent()) {
- ante = ante.append(f.formula());
+ for (Term f : s.antecedent()) {
+ ante = ante.append(f);
}
ImmutableList