Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof slicing extension #3026

Merged
merged 53 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1d5d8e9
Docked sequent view: also select proof if needed
FliegendeWurst Nov 30, 2022
62da14e
Use KeYDesktop consistently + fix BROWSE on Linux
FliegendeWurst Nov 30, 2022
b3ed312
Proof difference view: fix link to docs
FliegendeWurst Nov 30, 2022
2d84896
Proof: clear listeners after dispose
FliegendeWurst Dec 5, 2022
0ee0b8c
Proof slicing extension
FliegendeWurst Nov 15, 2022
db5ab14
Add description to help buttons
FliegendeWurst Dec 5, 2022
882eb5d
Various refactorings
FliegendeWurst Dec 9, 2022
47e943c
Formatting, etc.
FliegendeWurst Dec 14, 2022
82fbd70
Ignore only auto-generated solvers.txt
FliegendeWurst Dec 14, 2022
682a560
Make unsat core production optional
FliegendeWurst Dec 14, 2022
02d6f12
Proof slicing: settings provider + refactorings
FliegendeWurst Dec 14, 2022
57928d8
Fix implementation of hashCode
FliegendeWurst Dec 14, 2022
0c0254e
Checkstyle and formatting
FliegendeWurst Dec 15, 2022
619485a
Checkstyle
FliegendeWurst Dec 15, 2022
cbc6e4a
Slicing of open proofs
FliegendeWurst Dec 15, 2022
29bf194
Drop JGraphT dependency
FliegendeWurst Dec 16, 2022
9ea0563
Add test for de-duplicating open proof
FliegendeWurst Dec 19, 2022
fac0130
Automatically enable safe mode of rule de-duplication
FliegendeWurst Dec 19, 2022
66dc3f8
Another graph test
FliegendeWurst Dec 20, 2022
d1eca14
Refactor and comment rule de-duplication algorithm
FliegendeWurst Dec 21, 2022
db033d4
Formatting, Javadocs
FliegendeWurst Dec 22, 2022
2ecee9d
Merge branch 'master' into 'keller/slicingForMaster'
FliegendeWurst Dec 22, 2022
f376a6c
Slice in background thread
FliegendeWurst Dec 23, 2022
d4c28df
Formatting & Checkstyle
FliegendeWurst Jan 10, 2023
0f58f06
Merge remote-tracking branch 'origin/master' into slicing-rework
FliegendeWurst Jan 10, 2023
46fcc69
Javadocs + Cleanups
FliegendeWurst Jan 17, 2023
201bb35
Merge remote-tracking branch 'origin/master' into slicing-rework
FliegendeWurst Jan 17, 2023
5ec4f43
Merge branch 'master' into 'keller/slicingForMaster'
FliegendeWurst Jan 25, 2023
b1cd4cd
Handle missing dot installation correctly
FliegendeWurst Jan 28, 2023
805ea82
Refactor equals implementation of arrays and lists
FliegendeWurst Feb 6, 2023
a7311ab
Add unit test for dependency graph
FliegendeWurst Feb 6, 2023
58e18f8
Fix TermImpl equals
FliegendeWurst Feb 6, 2023
0a333d5
Docs
FliegendeWurst Feb 6, 2023
c356c86
Merge remote-tracking branch 'origin/main' into slicing
FliegendeWurst Feb 15, 2023
6b84a91
Fix proof test files broken by recent changes
FliegendeWurst Feb 16, 2023
3461a69
Checkstyle
FliegendeWurst Feb 16, 2023
7e1906e
Only run SMT test if a solver is available
FliegendeWurst Feb 17, 2023
c264bab
Split analysis into multiple methods
FliegendeWurst Feb 17, 2023
b50763b
Merge branch 'main' into slicing
wadoon Mar 3, 2023
c816aaf
Merge remote-tracking branch 'origin/main'
FliegendeWurst Mar 8, 2023
c379965
More javadocs
FliegendeWurst Mar 8, 2023
f798b9d
Merge remote-tracking branch 'origin/main' into slicing
FliegendeWurst Mar 17, 2023
9892162
Fix proof files
FliegendeWurst Mar 17, 2023
2a6eb5f
Switch to different test proof
FliegendeWurst Mar 17, 2023
192e575
Merge remote-tracking branch 'origin' into slicing
FliegendeWurst Mar 18, 2023
916de10
Switch tests to existing proof files
FliegendeWurst Mar 18, 2023
d348fbd
Revert change to StatusLine
FliegendeWurst Mar 18, 2023
10789e4
Remove stacktrace printing
FliegendeWurst Mar 18, 2023
44f5aac
Escape HTML manually
FliegendeWurst Mar 18, 2023
6675c08
Don't add slices to recent files
FliegendeWurst Mar 18, 2023
e01dcaa
Merge remote-tracking branch 'origin/main' into slicing
FliegendeWurst Mar 20, 2023
0cbd417
Make dot executable path configurable
FliegendeWurst Mar 20, 2023
cfc9de7
Fix HTML escaping
FliegendeWurst Mar 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ key.core/src/main/gen
key.core/src/main/resources/de/uka/ilkd/key/smt/newsmt2/DefinedSymbolsHandler.preamble.xml

# this file is automatically generated by gradle task :key.core:generateSolverPropsList
key.core/src/main/resources/de/uka/ilkd/key/smt/solvertypes
key.core/src/main/resources/de/uka/ilkd/key/smt/solvertypes/solvers.txt

key/key.ui/examples/**/**.proof
**/testresults/**
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import java.util.Collection;
import java.util.LinkedHashSet;

import org.key_project.util.java.ObjectUtil;
import java.util.Objects;

import de.uka.ilkd.key.proof.Node;
import de.uka.ilkd.key.proof.Proof;
Expand Down Expand Up @@ -95,9 +94,9 @@ public Proof getSource() {
public boolean equals(Object obj) {
if (obj instanceof IProofReference<?>) {
IProofReference<?> other = (IProofReference<?>) obj;
return ObjectUtil.equals(getKind(), other.getKind())
&& ObjectUtil.equals(getSource(), other.getSource())
&& ObjectUtil.equals(getTarget(), other.getTarget());
return Objects.equals(getKind(), other.getKind())
&& Objects.equals(getSource(), other.getSource())
&& Objects.equals(getTarget(), other.getTarget());
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;

import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.collection.ImmutableSet;
import org.key_project.util.java.CollectionUtil;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.ldt.HeapLDT;
Expand Down Expand Up @@ -1069,10 +1069,10 @@ public String toString() {
public boolean equals(Object obj) {
if (obj instanceof ExtractLocationParameter) {
ExtractLocationParameter other = (ExtractLocationParameter) obj;
return ObjectUtil.equals(arrayIndex, other.arrayIndex)
return Objects.equals(arrayIndex, other.arrayIndex)
&& stateMember == other.stateMember
&& ObjectUtil.equals(parentTerm, other.parentTerm)
&& ObjectUtil.equals(programVariable, other.programVariable);
&& Objects.equals(parentTerm, other.parentTerm)
&& Objects.equals(programVariable, other.programVariable);
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.PosInOccurrence;
Expand Down Expand Up @@ -352,8 +352,8 @@ public ParentDef(Term parent, Node goalNode) {
public boolean equals(Object obj) {
if (obj instanceof ParentDef) {
ParentDef other = (ParentDef) obj;
return ObjectUtil.equals(parent, other.parent)
&& ObjectUtil.equals(goalNode, other.goalNode);
return Objects.equals(parent, other.parent)
&& Objects.equals(goalNode, other.goalNode);
} else {
return false;
}
Expand Down Expand Up @@ -408,7 +408,7 @@ public boolean equals(Object obj) {
if (obj instanceof LocationDef) {
LocationDef other = (LocationDef) obj;
return programVariable == other.programVariable
&& ObjectUtil.equals(arrayIndex, other.arrayIndex);
&& Objects.equals(arrayIndex, other.arrayIndex);
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import org.key_project.util.collection.DefaultImmutableSet;
Expand All @@ -17,7 +18,6 @@
import org.key_project.util.collection.ImmutableSet;
import org.key_project.util.java.CollectionUtil;
import org.key_project.util.java.IFilter;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.logic.DefaultVisitor;
import de.uka.ilkd.key.logic.Name;
Expand Down Expand Up @@ -901,7 +901,7 @@ protected ISymbolicLayout createLayoutFromExecutionVariableValuePairs(
container.addAssociation(association);
} else {
// Make sure that target is the same
if (!ObjectUtil.equals(association.getTarget(),
if (!Objects.equals(association.getTarget(),
existingAssociation.getTarget())) {
throw new ProofInputException("Multiple association targets found: "
+ association + " and " + existingAssociation + ".");
Expand All @@ -928,7 +928,7 @@ protected ISymbolicLayout createLayoutFromExecutionVariableValuePairs(
container.addValue(value);
} else {
// Make sure that the value is the same
if (!ObjectUtil.equals(value.getValue(), existingValue.getValue())) {
if (!Objects.equals(value.getValue(), existingValue.getValue())) {
throw new ProofInputException(
"Multiple values found: " + value + " and " + existingValue + ".");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.java.CollectionUtil;
import org.key_project.util.java.IFilter;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.IProgramVariable;
Expand All @@ -13,6 +12,8 @@
import de.uka.ilkd.key.symbolic_execution.object_model.ISymbolicAssociationValueContainer;
import de.uka.ilkd.key.symbolic_execution.object_model.ISymbolicValue;

import java.util.Objects;

/**
* Default implementation of {@link ISymbolicAssociationValueContainer}.
*
Expand Down Expand Up @@ -67,8 +68,8 @@ public ISymbolicAssociation getAssociation(final IProgramVariable programVariabl
public boolean select(ISymbolicAssociation element) {
return element.getProgramVariable() == programVariable
&& element.isArrayIndex() == isArrayIndex
&& ObjectUtil.equals(element.getArrayIndex(), arrayIndex)
&& ObjectUtil.equals(element.getCondition(), condition);
&& Objects.equals(element.getArrayIndex(), arrayIndex)
&& Objects.equals(element.getCondition(), condition);
}
});
}
Expand Down Expand Up @@ -101,8 +102,8 @@ public ISymbolicValue getValue(final IProgramVariable programVariable,
public boolean select(ISymbolicValue element) {
return element.getProgramVariable() == programVariable
&& element.isArrayIndex() == isArrayIndex
&& ObjectUtil.equals(element.getArrayIndex(), arrayIndex)
&& ObjectUtil.equals(element.getCondition(), condition);
&& Objects.equals(element.getArrayIndex(), arrayIndex)
&& Objects.equals(element.getCondition(), condition);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import java.io.StringWriter;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;

import de.uka.ilkd.key.speclang.jml.translation.Context;
import de.uka.ilkd.key.speclang.njml.JmlIO;
import org.key_project.util.collection.ImmutableArray;
import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.Expression;
import de.uka.ilkd.key.java.JavaInfo;
Expand Down Expand Up @@ -238,8 +238,8 @@ public int hashCode() {
public boolean equals(Object obj) {
if (obj instanceof ProgramMethodPO) {
ProgramMethodPO other = (ProgramMethodPO) obj;
return ObjectUtil.equals(pm, other.getProgramMethod())
&& ObjectUtil.equals(precondition, other.getPrecondition());
return Objects.equals(pm, other.getProgramMethod())
&& Objects.equals(precondition, other.getPrecondition());
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Set;

import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.Position;
import de.uka.ilkd.key.java.Services;
Expand Down Expand Up @@ -276,8 +276,8 @@ public boolean equals(Object obj) {
if (obj instanceof ProgramMethodSubsetPO) {
ProgramMethodSubsetPO other = (ProgramMethodSubsetPO) obj;
return super.equals(obj)
&& ObjectUtil.equals(getStartPosition(), other.getStartPosition())
&& ObjectUtil.equals(getEndPosition(), other.getEndPosition());
&& Objects.equals(getStartPosition(), other.getStartPosition())
&& Objects.equals(getEndPosition(), other.getEndPosition());
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
Expand All @@ -15,7 +16,6 @@
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.java.CollectionUtil;
import org.key_project.util.java.IFilter;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.Expression;
import de.uka.ilkd.key.java.JavaTools;
Expand Down Expand Up @@ -1081,7 +1081,7 @@ public static <T> boolean startsWith(ImmutableList<T> list, ImmutableList<T> pre
while (same && prefixIter.hasNext()) {
T listNext = listIter.next();
T prefixNext = prefixIter.next();
if (!ObjectUtil.equals(listNext, prefixNext)) {
if (!Objects.equals(listNext, prefixNext)) {
same = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package de.uka.ilkd.key.symbolic_execution.slicing;

import org.key_project.util.collection.ImmutableArray;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.ProgramVariable;

import java.util.Objects;

public class Access {
/**
* The {@link ProgramVariable} or {@code null} if an array index is accessed.
Expand Down Expand Up @@ -96,8 +97,8 @@ public int hashCode() {
public boolean equals(Object obj) {
if (obj instanceof Access) {
Access other = (Access) obj;
return ObjectUtil.equals(programVariable, other.getProgramVariable())
&& ObjectUtil.equals(dimensionExpressions, other.getDimensionExpressions());
return Objects.equals(programVariable, other.getProgramVariable())
&& Objects.equals(dimensionExpressions, other.getDimensionExpressions());
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.Function;
import de.uka.ilkd.key.logic.op.LocationVariable;
import de.uka.ilkd.key.symbolic_execution.util.SymbolicExecutionUtil;

import java.util.Objects;

/**
* Represents a location like a local variable, method parameter, static field or an instance field
* on a specified object.
Expand Down Expand Up @@ -77,7 +78,7 @@ public int hashCode() {
public boolean equals(Object obj) {
if (obj instanceof Location) {
Location other = (Location) obj;
return ObjectUtil.equals(accesses, other.getAccesses());
return Objects.equals(accesses, other.getAccesses());
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package de.uka.ilkd.key.symbolic_execution.strategy.breakpoint;

import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.JavaTools;
import de.uka.ilkd.key.java.Position;
import de.uka.ilkd.key.java.SourceElement;
Expand All @@ -23,6 +21,8 @@
import de.uka.ilkd.key.speclang.translation.SLTranslationException;
import de.uka.ilkd.key.symbolic_execution.util.SymbolicExecutionUtil;

import java.util.Objects;

public class MethodBreakpoint extends AbstractConditionalBreakpoint {
/**
* flag to tell whether to stop on method entry
Expand Down Expand Up @@ -148,7 +148,7 @@ private boolean isCorrectMethodReturn(Node node, RuleApp ruleApp) {
term = TermBuilder.goBelowUpdates(term);
MethodFrame mf =
JavaTools.getInnermostMethodFrame(term.javaBlock(), node.proof().getServices());
return ObjectUtil.equals(getPm(), mf.getProgramMethod());
return Objects.equals(getPm(), mf.getProgramMethod());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.Set;

import org.key_project.util.collection.ImmutableArray;
import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSet;
import org.key_project.util.java.CollectionUtil;
import org.key_project.util.java.IFilter;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.java.abstraction.KeYJavaType;
Expand Down Expand Up @@ -723,7 +723,7 @@ public static Term extractOperatorTerm(Node node, final Operator operator) {
public boolean select(SequentFormula element) {
Term term = element.formula();
term = TermBuilder.goBelowUpdates(term);
return ObjectUtil.equals(term.op(), operator);
return Objects.equals(term.op(), operator);
}
});
if (sf != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import de.uka.ilkd.key.nparser.DebugKeyLexer;
import org.key_project.util.collection.ImmutableArray;
import org.key_project.util.collection.ImmutableList;
import org.key_project.util.collection.ImmutableSLList;
import org.key_project.util.java.CollectionUtil;
import org.key_project.util.java.IFilter;
import org.key_project.util.java.ObjectUtil;

import de.uka.ilkd.key.java.Expression;
import de.uka.ilkd.key.java.JavaProgramElement;
Expand Down Expand Up @@ -4087,7 +4086,7 @@ public static boolean equalsWithPosition(SourceElement first, SourceElement seco
} else {
// Compare all source elements including ints position info
return first.equals(second)
&& ObjectUtil.equals(first.getPositionInfo(), second.getPositionInfo());
&& Objects.equals(first.getPositionInfo(), second.getPositionInfo());
}
} else {
return first == null && second == null;
Expand Down Expand Up @@ -4332,7 +4331,7 @@ protected static ImmutableArray<Term> extractValueFromUpdate(Term term,
ImmutableArray<Term> result = null;
if (term.op() instanceof ElementaryUpdate) {
ElementaryUpdate update = (ElementaryUpdate) term.op();
if (ObjectUtil.equals(variable, update.lhs())) {
if (Objects.equals(variable, update.lhs())) {
result = term.subs();
}
} else if (term.op() instanceof UpdateJunctor) {
Expand Down
Loading