Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 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
eae3d25
refactoring
PiIsRational Apr 18, 2026
86d605e
a first try with the new parser
PiIsRational Apr 19, 2026
23d12f4
a minor change
PiIsRational Apr 21, 2026
67995b6
tried to get types to wor
PiIsRational May 6, 2026
8bc0407
add annotations to type references
PiIsRational May 15, 2026
bbd5a1b
try to get Annotation Declarations to properly load
PiIsRational May 21, 2026
0ab2931
Merge branch 'main' into ut-integration
PiIsRational May 21, 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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import de.uka.ilkd.key.java.JavaInfo;
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
import de.uka.ilkd.key.java.ast.reference.TypeRef;
import de.uka.ilkd.key.java.ast.reference.TypeReference;
import de.uka.ilkd.key.logic.JTerm;
import de.uka.ilkd.key.logic.ProgramElementName;
import de.uka.ilkd.key.logic.TermBuilder;
Expand Down Expand Up @@ -47,16 +49,15 @@ public class ProofObligationVars {
private final TermBuilder tb;


public ProofObligationVars(IProgramMethod pm, KeYJavaType kjt, Services services) {
this.pre = StateVars.buildMethodContractPreVars(pm, kjt, services);
this.post = StateVars.buildMethodContractPostVars(this.pre, pm, kjt, services);
public ProofObligationVars(IProgramMethod pm, TypeReference typeRef, Services services) {
this.pre = StateVars.buildMethodContractPreVars(pm, typeRef, services);
this.post = StateVars.buildMethodContractPostVars(this.pre, pm, typeRef, services);
this.tb = services.getTermBuilder();
this.exceptionParameter = buildExceptionParameter(services);
this.formalParams = buildFormalParamVars(services);
this.postfix = "";
}


public ProofObligationVars(ProofObligationVars orig, String postfix, Services services) {
this.pre = StateVars.buildInfFlowPreVars(orig.pre, postfix, services);
this.post = StateVars.buildInfFlowPostVars(orig.pre, orig.post, pre, postfix, services);
Expand All @@ -66,7 +67,6 @@ public ProofObligationVars(ProofObligationVars orig, String postfix, Services se
this.postfix = postfix;
}


public ProofObligationVars(StateVars pre, StateVars post, JTerm exceptionParameter,
ImmutableList<JTerm> formalParams, Services services) {
this.pre = pre;
Expand Down Expand Up @@ -114,7 +114,6 @@ public ProofObligationVars labelHeapAtPreAsAnonHeapFunc() {
}
}


/**
* Build variable for try statement.
*
Expand All @@ -125,7 +124,7 @@ private JTerm buildExceptionParameter(Services services) {
JavaInfo javaInfo = services.getJavaInfo();
final KeYJavaType eType = javaInfo.getTypeByClassName("java.lang.Exception");
final ProgramElementName ePEN = new ProgramElementName("e");
return tb.var(new LocationVariable(ePEN, eType));
return tb.var(new LocationVariable(ePEN, new TypeRef(eType)));
}

/**
Expand All @@ -139,7 +138,8 @@ private ImmutableList<JTerm> buildFormalParamVars(Services services)
for (JTerm param : pre.localVars) {
ProgramVariable paramVar = param.op(ProgramVariable.class);
ProgramElementName pen = new ProgramElementName("_" + paramVar.name());
LocationVariable formalParamVar = new LocationVariable(pen, paramVar.getKeYJavaType());
LocationVariable formalParamVar =
new LocationVariable(pen, paramVar.getTypeReference());
register(formalParamVar, services);
JTerm formalParam = tb.var(formalParamVar);
formalParamVars = formalParamVars.append(formalParam);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.java.ast.StatementBlock;
import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
import de.uka.ilkd.key.java.ast.reference.TypeRef;
import de.uka.ilkd.key.logic.JTerm;
import de.uka.ilkd.key.logic.op.IProgramMethod;
import de.uka.ilkd.key.logic.op.JModality;
Expand Down Expand Up @@ -50,7 +51,8 @@ public InfFlowContractPO(InitConfig initConfig, InformationFlowContract contract

// generate proof obligation variables
final IProgramMethod pm = contract.getTarget();
symbExecVars = new ProofObligationVars(pm, contract.getKJT(), environmentServices);
symbExecVars =
new ProofObligationVars(pm, new TypeRef(contract.getKJT()), environmentServices);

assert (symbExecVars.pre.self == null) == (pm.isStatic());
ifVars = new IFProofObligationVars(symbExecVars, environmentServices);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Iterator;

import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
import de.uka.ilkd.key.java.ast.reference.TypeReference;
import de.uka.ilkd.key.ldt.HeapLDT;
import de.uka.ilkd.key.ldt.JavaDLTheory;
import de.uka.ilkd.key.logic.JTerm;
Expand Down Expand Up @@ -86,13 +86,11 @@ public StateVars(JTerm self, JTerm guard, ImmutableList<JTerm> localVars, JTerm
paddedTermList = allTerms;
}


public StateVars(JTerm self, ImmutableList<JTerm> localVars, JTerm result, JTerm exception,
JTerm heap, JTerm mbyAtPre) {
this(self, null, localVars, result, exception, heap, mbyAtPre);
}


private ImmutableList<JTerm> appendIfNotNull(ImmutableList<JTerm> list, JTerm t) {
if (t != null) {
return list.append(t);
Expand All @@ -101,7 +99,6 @@ private ImmutableList<JTerm> appendIfNotNull(ImmutableList<JTerm> list, JTerm t)
}
}


private ImmutableList<JTerm> appendIfNotNull(ImmutableList<JTerm> list,
ImmutableList<JTerm> list2) {
ImmutableList<JTerm> result = list;
Expand All @@ -111,30 +108,25 @@ private ImmutableList<JTerm> appendIfNotNull(ImmutableList<JTerm> list,
return result;
}


public StateVars(JTerm self, JTerm guard, ImmutableList<JTerm> localVars, JTerm heap) {
this(self, guard, localVars, null, null, heap, null);
}


public StateVars(JTerm self, JTerm guard, ImmutableList<JTerm> localVars, JTerm result,
JTerm exception, JTerm heap) {
this(self, guard, localVars, result, exception, heap, null);
}


public StateVars(@Nullable JTerm self, ImmutableList<JTerm> localVars,
@Nullable JTerm result, @Nullable JTerm exception,
JTerm heap) {
this(self, localVars, result, exception, heap, null);
}


public StateVars(JTerm self, ImmutableList<JTerm> localVars, JTerm heap) {
this(self, localVars, null, null, heap);
}


public StateVars(StateVars orig, String postfix, Services services) {
this(copyVariable(orig.self, postfix, services),
copyVariable(orig.guard, postfix, services),
Expand All @@ -145,7 +137,6 @@ public StateVars(StateVars orig, String postfix, Services services) {
copyFunction(orig.mbyAtPre, postfix, services));
}


private static ImmutableList<JTerm> copyVariables(ImmutableList<JTerm> ts, String postfix,
Services services) {
ImmutableList<JTerm> result = ImmutableSLList.nil();
Expand All @@ -155,7 +146,6 @@ private static ImmutableList<JTerm> copyVariables(ImmutableList<JTerm> ts, Strin
return result;
}


private static JTerm copyVariable(JTerm t, String postfix, Services services) {
if (t != null) {
final TermBuilder tb = services.getTermBuilder();
Expand All @@ -168,7 +158,6 @@ private static JTerm copyVariable(JTerm t, String postfix, Services services) {
}
}


private static JTerm newVariable(JTerm t, String name, Services services) {
if (t == null) {
return null;
Expand All @@ -185,7 +174,6 @@ private static JTerm newVariable(JTerm t, String name, Services services) {
return tb.var(newVar);
}


private static JTerm copyHeapSymbol(JTerm t, String postfix, Services services) {
if (t != null) {
final TermBuilder tb = services.getTermBuilder();
Expand All @@ -198,7 +186,6 @@ private static JTerm copyHeapSymbol(JTerm t, String postfix, Services services)
}
}


private static JTerm newHeapSymbol(JTerm t, String name, Services services) {
if (t == null) {
return null;
Expand All @@ -216,7 +203,6 @@ private static JTerm newHeapSymbol(JTerm t, String name, Services services) {
}
}


private static JTerm newFunction(JTerm t, String name, Services services) {
if (t == null) {
return null;
Expand All @@ -227,7 +213,6 @@ private static JTerm newFunction(JTerm t, String name, Services services) {
return tb.func(newFunc);
}


private static JTerm copyFunction(JTerm t, String postfix, Services services) {
if (t != null) {
final TermBuilder tb = services.getTermBuilder();
Expand All @@ -240,33 +225,30 @@ private static JTerm copyFunction(JTerm t, String postfix, Services services) {
}
}


public static StateVars buildMethodContractPreVars(IProgramMethod pm, KeYJavaType kjt,
public static StateVars buildMethodContractPreVars(IProgramMethod pm, TypeReference typeRef,
Services services) {
ImmutableArray<TermLabel> heapLabels =
new ImmutableArray<>(ParameterlessTermLabel.ANON_HEAP_LABEL);
return new StateVars(buildSelfVar(services, pm, kjt, ""), buildParamVars(services, "", pm),
return new StateVars(buildSelfVar(services, pm, typeRef, ""),
buildParamVars(services, "", pm),
buildResultVar(pm, services, ""), buildExceptionVar(services, "", pm),
buildHeapFunc("AtPre", heapLabels, services), buildMbyVar("", services));
}


public static StateVars buildMethodContractPostVars(StateVars preVars, IProgramMethod pm,
KeYJavaType kjt, Services services) {
TypeReference typeRef, Services services) {
final String postfix = "AtPost";
// preVars.localVars: no local out variables
return new StateVars(buildSelfVar(services, pm, kjt, postfix), preVars.localVars,
return new StateVars(buildSelfVar(services, pm, typeRef, postfix), preVars.localVars,
buildResultVar(pm, services, postfix), buildExceptionVar(services, postfix, pm),
buildHeapFunc(postfix, new ImmutableArray<>(), services), preVars.mbyAtPre);
}


public static StateVars buildInfFlowPreVars(StateVars origPreVars, String postfix,
Services services) {
return new StateVars(origPreVars, postfix, services);
}


public static StateVars buildInfFlowPostVars(StateVars origPreVars, StateVars origPostVars,
StateVars preVars, String postfix, Services services) {
// create new post vars if original pre and original post var differ;
Expand Down Expand Up @@ -297,19 +279,17 @@ public static StateVars buildInfFlowPostVars(StateVars origPreVars, StateVars or
return new StateVars(self, guard, localPostVars, result, exception, heap, mbyAtPre);
}


private static JTerm buildSelfVar(Services services, IProgramMethod pm, KeYJavaType kjt,
private static JTerm buildSelfVar(Services services, IProgramMethod pm, TypeReference typeRef,
String postfix) {
if (pm.isStatic()) {
return null;
}
final TermBuilder tb = services.getTermBuilder();
JTerm selfVar = tb.var(tb.selfVar(pm, kjt, true, postfix));
JTerm selfVar = tb.var(tb.selfVar(pm, typeRef, true, postfix));
register(selfVar.op(ProgramVariable.class), services);
return selfVar;
}


private static ImmutableList<JTerm> buildParamVars(Services services, String postfix,
IProgramMethod pm) {
final TermBuilder tb = services.getTermBuilder();
Expand All @@ -318,7 +298,6 @@ private static ImmutableList<JTerm> buildParamVars(Services services, String pos
return paramVars;
}


private static JTerm buildResultVar(IProgramMethod pm, Services services, String postfix) {
if (pm.isVoid() || pm.isConstructor()) {
return null;
Expand All @@ -329,7 +308,6 @@ private static JTerm buildResultVar(IProgramMethod pm, Services services, String
return resultVar;
}


private static JTerm buildHeapFunc(String postfix, ImmutableArray<TermLabel> labels,
Services services) {
HeapLDT heapLDT = services.getTypeConverter().getHeapLDT();
Expand All @@ -345,15 +323,13 @@ private static JTerm buildHeapFunc(String postfix, ImmutableArray<TermLabel> lab
}
}


private static JTerm buildExceptionVar(Services services, String postfix, IProgramMethod pm) {
final TermBuilder tb = services.getTermBuilder();
JTerm excVar = tb.var(tb.excVar("exc" + postfix, pm, true));
register(excVar.op(ProgramVariable.class), services);
return excVar;
}


private static JTerm buildMbyVar(String postfix, Services services) {
final TermBuilder tb = services.getTermBuilder();
final Sort intSort = services.getTypeConverter().getIntegerLDT().targetSort();
Expand All @@ -363,22 +339,19 @@ private static JTerm buildMbyVar(String postfix, Services services) {
return tb.func(mbyAtPreFunc);
}


static void register(ProgramVariable pv, Services services) {
Namespace<IProgramVariable> progVarNames = services.getNamespaces().programVariables();
if (pv != null && progVarNames.lookup(pv.name()) == null) {
progVarNames.addSafely(pv);
}
}


static void register(ImmutableList<ProgramVariable> pvs, Services services) {
for (ProgramVariable pv : pvs) {
register(pv, services);
}
}


static void register(Function f, Services services) {
Namespace<Function> functionNames = services.getNamespaces().functions();
if (f != null && functionNames.lookup(f.name()) == null) {
Expand All @@ -387,7 +360,6 @@ static void register(Function f, Services services) {
}
}


static <T> ImmutableList<T> ops(ImmutableList<JTerm> terms, Class<T> opClass)
throws IllegalArgumentException {
ImmutableList<T> ops = ImmutableSLList.nil();
Expand All @@ -397,7 +369,6 @@ static <T> ImmutableList<T> ops(ImmutableList<JTerm> terms, Class<T> opClass)
return ops;
}


@Override
public String toString() {
return termList.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import de.uka.ilkd.key.informationflow.proof.init.StateVars;
import de.uka.ilkd.key.informationflow.rule.tacletbuilder.InfFlowBlockContractTacletBuilder;
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.java.ast.abstraction.KeYJavaType;
import de.uka.ilkd.key.java.ast.reference.ExecutionContext;
import de.uka.ilkd.key.java.ast.reference.TypeReference;
import de.uka.ilkd.key.java.ast.statement.JavaStatement;
import de.uka.ilkd.key.logic.JTerm;
import de.uka.ilkd.key.logic.ProgramElementName;
Expand Down Expand Up @@ -192,7 +192,7 @@ protected void setUpValidityGoal(final ImmutableList<Goal> result,
var app = (InfFlowBlockContractInternalBuiltInRuleApp) application;

final ProgramVariable exceptionParameter =
createLocalVariable("e", variables.exception.getKeYJavaType(), services);
createLocalVariable("e", variables.exception.getTypeReference(), services);
validityGoal.setBranchLabel("Information Flow Validity");

// clear goal
Expand Down Expand Up @@ -403,7 +403,7 @@ protected static ImmutableSet<BlockContract> filterAppliedContracts(
assert varTerm.op() instanceof LocationVariable;

final TermBuilder tb = services.getTermBuilder();
KeYJavaType resultType = ((LocationVariable) varTerm.op()).getKeYJavaType();
TypeReference resultType = ((LocationVariable) varTerm.op()).getTypeReference();
if (!suffix.equalsIgnoreCase("")) {
suffix = "_" + suffix;
}
Expand All @@ -426,7 +426,7 @@ protected static ImmutableList<JTerm> buildLocalOutsAtPre(ImmutableList<JTerm> v
for (JTerm varTerm : varTerms) {
assert varTerm.op() instanceof LocationVariable;

KeYJavaType resultType = ((LocationVariable) varTerm.op()).getKeYJavaType();
TypeReference resultType = ((LocationVariable) varTerm.op()).getTypeReference();

String name = tb.newName(varTerm + "_Before");
LocationVariable varAtPostVar =
Expand All @@ -448,7 +448,7 @@ protected static ImmutableList<JTerm> buildLocalOutsAtPost(ImmutableList<JTerm>
for (JTerm varTerm : varTerms) {
assert varTerm.op() instanceof LocationVariable;

KeYJavaType resultType = ((LocationVariable) varTerm.op()).getKeYJavaType();
TypeReference resultType = ((LocationVariable) varTerm.op()).getTypeReference();

String name = tb.newName(varTerm + "_After");
LocationVariable varAtPostVar =
Expand Down
Loading
Loading