Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
230f842
add the ownership rules
PiIsRational Jun 1, 2025
6a195dd
added the new rules
PiIsRational Jun 4, 2025
415f9db
extend the javac extension
PiIsRational Jun 8, 2025
f37d143
change the way the universe rules are treated
PiIsRational Jun 8, 2025
c337d49
update to add the latest changes
PiIsRational Jun 16, 2025
82f0bcc
do some bugfixes in the recoder parsers
PiIsRational Jul 2, 2025
912cc8c
the last changes
PiIsRational Jul 21, 2025
94763f1
update the match conditions
PiIsRational Jul 23, 2025
19f98e9
add support for args and results in contracts
PiIsRational Jul 26, 2025
0d932a9
some changes
PiIsRational Aug 9, 2025
a82c2c2
the new rule files
PiIsRational Sep 22, 2025
2f35dcf
add the proofs
PiIsRational Sep 27, 2025
85a0e6d
update the rules
PiIsRational Oct 6, 2025
902c17c
remove unneeded assertion
PiIsRational Oct 6, 2025
3f0dea8
remove logs in the default lemma generator
PiIsRational Oct 6, 2025
29dabd9
all the universe lemmas have a corresponding runnable proof
PiIsRational Oct 7, 2025
ac9124d
remove factorypaths
PiIsRational Oct 24, 2025
88187a0
add support for dom references
PiIsRational Oct 30, 2025
4812836
Merge commit '88187a0debb466f31e974a64e2049293160d7319' into ut-integ…
PiIsRational Jan 11, 2026
16e29d2
update the heuristics
PiIsRational Jan 11, 2026
519a11c
update the heap simplification macro with universe rules
PiIsRational Jan 11, 2026
2cb864d
apply spotless
PiIsRational Jan 30, 2026
33d1e5e
Merge branch 'main' into ut-integration
PiIsRational Mar 30, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ bin/
.settings
.project
.classpath
.factorypath

# Files generated by IntelliJ ANTLR plugin
key.core/src/main/gen
Expand Down
1 change: 1 addition & 0 deletions key.core/src/main/antlr4/KeYLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ MAXEXPANDMETHOD : '\\mayExpandMethod';
STRICT : '\\strict';
TYPEOF : '\\typeof';
INSTANTIATE_GENERIC : '\\instantiateGeneric';
HAS_ANNOTATION: '\\hasAnnotation';

// Quantifiers, binding, substitution
FORALL : '\\forall' | '\u2200';
Expand Down
1 change: 1 addition & 0 deletions key.core/src/main/antlr4/KeYParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ varexpId: // weigl, 2021-03-12: This will be later just an arbitrary identifier.
| GET_VARIANT
| IS_LABELED
| ISINSTRICTFP
| HAS_ANNOTATION
;

varexp_argument
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.java.ast.declaration.modifier;

import org.key_project.logic.SyntaxElement;

import de.uka.ilkd.key.java.ast.ProgramElement;
import de.uka.ilkd.key.java.ast.declaration.Modifier;
import de.uka.ilkd.key.java.ast.reference.TypeReference;
Expand All @@ -18,7 +20,7 @@ public AnnotationUseSpecification(TypeReference tr) {
}

protected String getSymbol() {
return "@" + tr.toString();
return "@" + tr.getName();
}

public TypeReference getTypeReferenceAt(int index) {
Expand All @@ -39,8 +41,12 @@ public ProgramElement getChildAt(int index) {
throw new ArrayIndexOutOfBoundsException();
}

@Override
public SyntaxElement getChild(int index) {
return getChildAt(index);
}

public int getChildCount() {
return 1;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public New(ExtList children, ReferencePrefix rp, PositionInfo pi) {
accessPath = rp;
}


/**
* Constructor for the transformation of COMPOST ASTs to KeY.
*
Expand Down Expand Up @@ -180,6 +179,9 @@ public int getChildCount() {
if (anonymousClass != null) {
result++;
}
if (annotations != null) {
result += annotations.size();
}
return result;
}

Expand Down Expand Up @@ -210,6 +212,13 @@ public ProgramElement getChildAt(int index) {
if (index == 0) {
return anonymousClass;
}
index--;
}
if (annotations != null) {
len = annotations.size();
if (len > index) {
return annotations.get(index);
}
}
throw new ArrayIndexOutOfBoundsException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ public int getChildCount() {
if (arrayInitializer != null) {
result++;
}
if (annotations != null) {
result += annotations.size();
}
return result;
}

Expand Down Expand Up @@ -210,6 +213,13 @@ public ProgramElement getChildAt(int index) {
if (index == 0) {
return arrayInitializer;
}
index--;
}
if (annotations != null) {
len = annotations.size();
if (len > index) {
return annotations.get(index);
}
}
throw new ArrayIndexOutOfBoundsException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.util.List;

import de.uka.ilkd.key.java.ast.declaration.modifier.AnnotationUseSpecification;
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.java.ast.Comment;
import de.uka.ilkd.key.java.ast.PositionInfo;
Expand All @@ -31,6 +32,11 @@ public abstract class TypeOperator extends Operator implements TypeReferenceCont
*/
protected final TypeReference typeReference;

/**
* Annotations.
*/
protected final ImmutableArray<AnnotationUseSpecification> annotations;


/**
* Constructor for the transformation of COMPOST ASTs to KeY.
Expand All @@ -43,6 +49,8 @@ public abstract class TypeOperator extends Operator implements TypeReferenceCont
protected TypeOperator(ExtList children) {
super(children);
typeReference = children.get(TypeReference.class);
annotations = new ImmutableArray<>(
children.collect(AnnotationUseSpecification.class));
}

/**
Expand All @@ -56,26 +64,39 @@ protected TypeOperator(ExtList children) {
protected TypeOperator(ExtList children, PositionInfo pi) {
super(children);
typeReference = children.get(TypeReference.class);
annotations = new ImmutableArray<>(
children.collect(AnnotationUseSpecification.class));
}

protected TypeOperator(Expression unaryChild, TypeReference typeref) {
super(unaryChild);
typeReference = typeref;
annotations = null;
}

protected TypeOperator(Expression[] arguments, TypeReference typeref) {
super(arguments);
typeReference = typeref;
annotations = null;
}

protected TypeOperator(Expression[] arguments, TypeReference typeref,
ImmutableArray<AnnotationUseSpecification> annotations) {
super(arguments);
typeReference = typeref;
this.annotations = annotations;
}

protected TypeOperator() {
typeReference = null;
annotations = null;
}

public TypeOperator(PositionInfo pi, List<Comment> c, ImmutableArray<Expression> arguments,
TypeReference type) {
super(pi, c, arguments);
typeReference = type;
annotations = null;
}

/**
Expand Down Expand Up @@ -122,5 +143,12 @@ public KeYJavaType getKeYJavaType(Services javaServ) {
return getTypeReference().getKeYJavaType();
}


/**
* A getter for the annotations.
*
* @return the annotations.
*/
public ImmutableArray<AnnotationUseSpecification> getAnnotations() {
return annotations;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.key_project.util.ExtList;

/**
* The JavaDL theory class provides access to function symvols, sorts that are part of the core
* The JavaDL theory class provides access to function symbols, sorts that are part of the core
* logic
* like cast or instanceof functions.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,35 @@ public String getDescription() {
"wellFormedAnonEQ", "wellFormedMemsetArrayObjectEQ", "wellFormedMemsetArrayPrimitiveEQ",
"wellFormedMemsetObjectEQ", "wellFormedMemsetLocSetEQ", "wellFormedMemsetPrimitiveEQ",

// universe rules
"createdRepfpElement",

"dismissSelectOfDominatedObject", "dismissSelectOfDominatingObject",
"dismissSelectOfDominatedAnon", "dismissSelectOfDominatedCreatedAnon",

"dismissSelectOfSelfRepfpComplementAnon", "dismissSelectOfSelfCreatedRepfpComplementAnon",
"dismissSelectOfDominatingRepfpComplementAnon",
"dismissSelectOfDominatingCreatedRepfpComplementAnon",

"dismissSelectOfDominatedObjectEQ", "dismissSelectOfDominatingObjectEQ",
"dismissSelectOfDominatedAnonEQ", "dismissSelectOfDominatedCreatedAnonEQ",

"dismissSelectOfSelfRepfpComplementAnonEQ",
"dismissSelectOfSelfCreatedRepfpComplementAnonEQ",
"dismissSelectOfDominatingRepfpComplementAnonEQ",
"dismissSelectOfDominatingCreatedRepfpComplementAnonEQ",

"simplifySelectOfDominatedAnon", "simplifySelectOfDominatedCreatedAnon",
"simplifySelectOfSelfRepfpComplementAnon", "simplifySelectOfSelfCreatedRepfpComplementAnon",
"simplifySelectOfDominatingRepfpComplementAnon",
"simplifySelectOfDominatingCreatedRepfpComplementAnon",

"simplifySelectOfDominatedAnonEQ", "simplifySelectOfDominatedCreatedAnonEQ",
"simplifySelectOfSelfRepfpComplementAnonEQ",
"simplifySelectOfSelfCreatedRepfpComplementAnonEQ",
"simplifySelectOfDominatingRepfpComplementAnonEQ",
"simplifySelectOfDominatingCreatedRepfpComplementAnonEQ",

// locset rules
"elementOfEmpty", "elementOfAllLocs", "elementOfSingleton", "elementOfUnion",
"elementOfIntersect", "elementOfSetMinus", "elementOfAllFields", "elementOfAllObjects",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ public VariableCondition build(Object[] arguments, List<String> parameters,
new ConstructorBasedBuilder("static", StaticReferenceCondition.class, SV);
public static final TacletBuilderCommand DIFFERENT_FIELDS =
new ConstructorBasedBuilder("differentFields", DifferentFields.class, SV, SV);
public static final AbstractConditionBuilder HAS_ANNOTATION =
new ConstructorBasedBuilder("hasAnnotation", HasAnnotationCondition.class, SV, S);
public static final AbstractConditionBuilder SAME_OBSERVER =
new ConstructorBasedBuilder("sameObserver", SameObserverCondition.class, PV, PV);
public static final AbstractConditionBuilder applyUpdateOnRigid = new ConstructorBasedBuilder(
Expand Down Expand Up @@ -382,7 +384,8 @@ public IsLabeledCondition build(Object[] arguments, List<String> parameters,
applyUpdateOnRigid, DROP_EFFECTLESS_ELEMENTARIES, SIMPLIFY_ITE_UPDATE, SUBFORMULAS,
STATIC_FIELD, MODEL_FIELD, SUBFORMULA, DROP_EFFECTLESS_STORES, EQUAL_UNIQUE,
META_DISJOINT,
IS_OBSERVER, CONSTANT, HAS_SORT, LABEL, NEW_LABEL, HAS_ELEM_SORT, IS_IN_STRICTFP);
IS_OBSERVER, CONSTANT, HAS_SORT, LABEL, NEW_LABEL, HAS_ELEM_SORT, IS_IN_STRICTFP,
HAS_ANNOTATION);
register(STORE_TERM_IN, STORE_STMT_IN, HAS_INVARIANT, GET_INVARIANT, GET_FREE_INVARIANT,
GET_VARIANT, IS_LABELED);
loadWithServiceLoader();
Expand Down
18 changes: 17 additions & 1 deletion key.core/src/main/java/de/uka/ilkd/key/pp/PrettyPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.java.ast.*;
import de.uka.ilkd.key.java.ast.declaration.modifier.AnnotationUseSpecification;
import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
import de.uka.ilkd.key.java.ast.abstraction.Type;
import de.uka.ilkd.key.java.ast.ccatch.*;
Expand Down Expand Up @@ -174,7 +175,7 @@ protected static String encodeUnicodeChars(String str) {
*
* @param list a program element list.
*/
protected void writeKeywordList(ImmutableArray<Modifier> list) {
protected <T extends Modifier> void writeKeywordList(ImmutableArray<T> list) {
for (int i = 0; i < list.size(); i++) {
if (i != 0) {
layouter.brk();
Expand Down Expand Up @@ -1453,6 +1454,14 @@ public void performActionOnNewArray(NewArray x) {
if (addParentheses) {
layouter.print("(");
}

ImmutableArray<AnnotationUseSpecification> annots = x.getAnnotations();
boolean hasAnnots = annots != null && !annots.isEmpty();
if (hasAnnots) {
writeKeywordList(annots);
layouter.print(" ");
}

layouter.print("new ");

x.getTypeReference().visit(this);
Expand Down Expand Up @@ -1514,6 +1523,13 @@ public void performActionOnNew(New x) {
printReferencePrefix(x.getReferencePrefix());
layouter.keyWord("new").print(" ");

ImmutableArray<AnnotationUseSpecification> annots = x.getAnnotations();
boolean hasAnnots = annots != null && !annots.isEmpty();
if (hasAnnots) {
writeKeywordList(annots);
layouter.print(" ");
}

x.getTypeReference().visit(this);
printArguments(x.getArguments());
if (x.getClassDeclaration() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

import com.github.javaparser.ast.key.KeyTransactionStatement;
import org.jspecify.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* <p>
Expand Down Expand Up @@ -79,6 +81,7 @@
* @author Martin Hentschel
*/
public abstract class AbstractOperationPO extends AbstractPO {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractOperationPO.class);
private static final String JAVA_LANG_THROWABLE = "java.lang.Throwable";

protected InitConfig proofConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
import org.key_project.util.collection.ImmutableSet;
import org.key_project.util.collection.Pair;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* An abstract proof obligation implementing common functionality.
*/
public abstract class AbstractPO implements IPersistablePO {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPO.class);

protected TermBuilder tb;
protected final InitConfig environmentConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static de.uka.ilkd.key.java.KeYJavaASTFactory.declare;

Expand All @@ -62,6 +64,8 @@
* </p>
*/
public class FunctionalOperationContractPO extends AbstractOperationPO implements ContractPO {
private static final Logger LOGGER =
LoggerFactory.getLogger(FunctionalOperationContractPO.class);
public static final Map<Boolean, @NonNull String> TRANSACTION_TAGS =
new LinkedHashMap<>();

Expand Down
Loading
Loading