Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into mulbrichPolymorphic
Browse files Browse the repository at this point in the history
* origin/main: (46 commits)
  spotless update
  removed default implementations for AbstractExternalSolverRuleApp around RULE field
  small formatting change
  Bump the gradle-deps group with 6 updates
  Bump JetBrains/qodana-action in the github-actions-deps group
  set version to 2.12.4-dev
  increase java version to 21
  added missing conversion rules from javaUnaryMinusFloat/Double to negFloat/Double
  add AbstractExternalSolverRuleApp to allow other external solvers to close goals
  fixes NullPointerException, when using compareTo with locations that dont have a URI or position
  Bump the github-actions-deps group with 2 updates
  Bump the gradle-deps group with 5 updates
  formatting
  Bump the github-actions-deps group with 2 updates
  Bump the gradle-deps group with 8 updates
  spotless
  generating ProofTree tooltips lazily, options to disable them completely
  fix for visual bug with overlapping/unreadable text in color settings
  Fox copyright year
  Bump the gradle-deps group with 6 updates
  ...
  • Loading branch information
wadoon committed Nov 17, 2024
2 parents 27b37a4 + c19bb8e commit 57dc2d3
Show file tree
Hide file tree
Showing 55 changed files with 1,186 additions and 614 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
distribution: 'corretto'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: Build with Gradle
run: ./gradlew -DENABLE_NULLNESS=true compileTest

Expand All @@ -32,7 +32,7 @@ jobs:
with:
fetch-depth: 0
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.1.8
uses: JetBrains/qodana-action@v2024.2.6

- uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
Expand All @@ -49,7 +49,7 @@ jobs:
java-version: '21'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: SpotlessCheck
run: ./gradlew --continue spotlessCheck

Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
java-version: '21'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: Checkstyle
run: ./gradlew --continue checkstyleMainChanged
- run: |
Expand All @@ -108,7 +108,7 @@ jobs:
java-version: '21'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: PMD checks
run: ./gradlew --continue pmdMainChanged

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: Assemble with Gradle
run: ./gradlew assemble

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
distribution: 'corretto'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: Build Documentation with Gradle
run: ./gradlew alldoc

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightlydeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: Build with Gradle
run: ./gradlew --parallel assemble

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/opttest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: Test with Gradle
run: ./gradlew --continue ${{ matrix.tests }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: Test with Gradle
run: ./gradlew --continue -DjacocoEnabled=true -x :key.core.symbolic_execution:test -x :key.core.proof_references:test test

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
shell: bash

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: "Running tests: ${{ matrix.test }}"
run: ./gradlew --continue ${{ matrix.test }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_winmac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Setup Gradle
uses:
gradle/actions/setup-gradle@v3.5.0
gradle/actions/setup-gradle@v4.1.0
- name: Test with Gradle
run: ./gradlew --continue -x :key.core.symbolic_execution:test -x :key.core.proof_references:test test

Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
run: .github/dlsmt.sh

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.5.0
uses: gradle/actions/setup-gradle@v4.1.0
- name: "Running tests: ${{ matrix.test }}"
run: ./gradlew --continue ${{ matrix.test }}

Expand Down
40 changes: 20 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
id "com.diffplug.spotless" version "6.25.0"

// EISOP Checker Framework
id "org.checkerframework" version "0.6.41"
id "org.checkerframework" version "0.6.45"
}

// Configure this project for use inside IntelliJ:
Expand All @@ -40,10 +40,10 @@ static def getDate() {
}

// The $BUILD_NUMBER is an environment variable set by Jenkins.
def build = System.env.BUILD_NUMBER == null ? "" : "-${System.env.BUILD_NUMBER}"
def build = System.env.BUILD_NUMBER == null ? "-dev" : "-${System.env.BUILD_NUMBER}"

group = "org.key-project"
version = "2.13.0$build"
version = "2.12.4$build"

subprojects {
apply plugin: "java"
Expand All @@ -62,8 +62,8 @@ subprojects {
version = rootProject.version

java {
sourceCompatibility = 17
targetCompatibility = 17
sourceCompatibility = 21
targetCompatibility = 21
}

repositories {
Expand All @@ -74,44 +74,42 @@ subprojects {
}

dependencies {
implementation("org.slf4j:slf4j-api:2.0.13")
implementation("org.slf4j:slf4j-api:2.0.13")
testImplementation("ch.qos.logback:logback-classic:1.5.6")
implementation("org.slf4j:slf4j-api:2.0.16")
implementation("org.slf4j:slf4j-api:2.0.16")
testImplementation("ch.qos.logback:logback-classic:1.5.12")

//compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.12.0'
//compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.12.0'

compileOnly("org.jspecify:jspecify:0.3.0")
testCompileOnly("org.jspecify:jspecify:0.3.0")
def eisop_version = "3.42.0-eisop3"
compileOnly("org.jspecify:jspecify:1.0.0")
testCompileOnly("org.jspecify:jspecify:1.0.0")
def eisop_version = "3.42.0-eisop4"
compileOnly "io.github.eisop:checker-qual:$eisop_version"
compileOnly "io.github.eisop:checker-util:$eisop_version"
testCompileOnly "io.github.eisop:checker-qual:$eisop_version"
checkerFramework "io.github.eisop:checker:$eisop_version"

testImplementation("ch.qos.logback:logback-classic:1.5.6")
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.3'
testImplementation("ch.qos.logback:logback-classic:1.5.12")
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.3'
testImplementation project(':key.util')

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
}

tasks.withType(JavaCompile) {
// Setting UTF-8 as the java source encoding.
options.encoding = "UTF-8"
// Setting the release to Java 17
options.release = 17
// Setting the release to Java 21
options.release = 21
}

tasks.withType(Javadoc) {
failOnError = false
options.addBooleanOption 'Xdoclint:none', true
//options.verbose()
options.encoding = 'UTF-8'
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
options.addBooleanOption('html5', true)
}

tasks.withType(Test) {//Configure all tests
Expand Down Expand Up @@ -334,6 +332,8 @@ subprojects {
targetExclude 'build/**'

// allows us to use spotless:off / spotless:on to keep pre-formatted sections
// MU: Only ... because of the eclipse(...) below, it is "@formatter:off" and "@formatter:on"
// that must be used instead.
toggleOffOn()

removeUnusedImports()
Expand Down
4 changes: 2 additions & 2 deletions key.core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ dependencies {
javacc group: 'net.java.dev.javacc', name: 'javacc', version: '4.0'
antlr group: 'org.antlr', name: 'antlr', version: '3.5.3' // use ANTLR version 3

antlr4 "org.antlr:antlr4:4.13.1"
api "org.antlr:antlr4-runtime:4.13.1"
antlr4 "org.antlr:antlr4:4.13.2"
api "org.antlr:antlr4-runtime:4.13.2"
//implementation group: 'com.google.guava', name: 'guava', version: '28.1-jre'
}

Expand Down
3 changes: 2 additions & 1 deletion key.core/src/main/java/de/uka/ilkd/key/nparser/KeyAst.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ public Configuration asConfiguration() {
if (!res.isEmpty())
return (Configuration) res.get(0);
else
throw new RuntimeException();
throw new RuntimeException("Error in configuration. Source: "
+ ctx.start.getTokenSource().getSourceName());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public Object visitOne_sort_decl(KeYParser.One_sort_declContext ctx) {
// weigl: agreement on KaKeY meeting: this should be ignored until we finally have
// local namespaces for generic sorts
// addWarning(ctx, "Sort declaration is ignored, due to collision.");
LOGGER.info("Sort declaration of {} in {} is ignored due to collision (already "
LOGGER.debug("Sort declaration of {} in {} is ignored due to collision (already "
+ "present in {}).", sortName, BuilderHelpers.getPosition(ctx),
existingSort.getOrigin());
}
Expand Down
5 changes: 2 additions & 3 deletions key.core/src/main/java/de/uka/ilkd/key/parser/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ public int hashCode() {

@Override
public int compareTo(@NonNull Location o) {
return Comparator
.<Location, URI>comparing(l -> l.fileUri)
.thenComparing(Location::getPosition).compare(this, o);
return Comparator.<Location, URI>comparing(l -> l.fileUri, Comparator.nullsLast(Comparator.naturalOrder()))
.thenComparing(Location::getPosition, Comparator.nullsLast(Comparator.naturalOrder())).compare(this, o);
}
}
3 changes: 1 addition & 2 deletions key.core/src/main/java/de/uka/ilkd/key/proof/Goal.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import de.uka.ilkd.key.rule.*;
import de.uka.ilkd.key.rule.inst.SVInstantiations;
import de.uka.ilkd.key.rule.merge.MergeRule;
import de.uka.ilkd.key.smt.SMTRuleApp;
import de.uka.ilkd.key.strategy.AutomatedRuleApplicationManager;
import de.uka.ilkd.key.strategy.QueueRuleApplicationManager;
import de.uka.ilkd.key.strategy.Strategy;
Expand Down Expand Up @@ -627,7 +626,7 @@ public ImmutableList<Goal> apply(final RuleApp ruleApp) {
} else {
proof.replace(this, goalList);
if (ruleApp instanceof TacletApp tacletApp && tacletApp.taclet().closeGoal()
|| ruleApp instanceof SMTRuleApp) {
|| ruleApp instanceof AbstractExternalSolverRuleApp) {
// the first new goal is the one to be closed
proof.closeGoal(goalList.head());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/* This file is part of KeY - https://key-project.org
* KeY is licensed under the GNU General Public License Version 2
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.rule;

import de.uka.ilkd.key.logic.*;
import de.uka.ilkd.key.proof.Goal;

import org.key_project.util.collection.ImmutableList;

/**
* The rule application that is used when a goal is closed by means of an external solver. So far it
* stores the rule that that has been used and a title containing some information for the user.
* <p>
* {@link de.uka.ilkd.key.smt.SMTRuleApp}
*/
public abstract class AbstractExternalSolverRuleApp extends AbstractBuiltInRuleApp {
protected final String title;
protected final String successfulSolverName;

/**
* Creates a new AbstractExternalSolverRuleApp,
*
* @param rule the ExternalSolverRule to apply
* @param pio the position in the term to apply the rule to
* @param unsatCore an unsat core consisting of the formulas that are needed to prove the goal
* (optional null)
* @param successfulSolverName the name of the solver used to find the proof
* @param title the title of this rule app
*/
protected AbstractExternalSolverRuleApp(ExternalSolverRule rule, PosInOccurrence pio,
ImmutableList<PosInOccurrence> unsatCore,
String successfulSolverName, String title) {
super(rule, pio, unsatCore);
this.title = title;
this.successfulSolverName = successfulSolverName;
}

/**
* Gets the title of this rule application
*
* @return title of this application
*/
public String getTitle() {
return title;
}

/**
* Gets the name of the successful solver
*
* @return name of the successful solver
*/
public String getSuccessfulSolverName() {
return successfulSolverName;
}

@Override
public String displayName() {
return title;
}

/**
* Interface for the rules of external solvers
*/
public interface ExternalSolverRule extends BuiltInRule {
AbstractExternalSolverRuleApp createApp(String successfulSolverName);

/**
* Create a new rule application with the given solver name and unsat core.
*
* @param successfulSolverName solver that produced this result
* @param unsatCore formulas required to prove the result
* @return rule application instance
*/
AbstractExternalSolverRuleApp createApp(String successfulSolverName,
ImmutableList<PosInOccurrence> unsatCore);

@Override
AbstractExternalSolverRuleApp createApp(PosInOccurrence pos, TermServices services);


@Override
default boolean isApplicable(Goal goal, PosInOccurrence pio) {
return false;
}

@Override
default boolean isApplicableOnSubTerms() {
return false;
}

@Override
String displayName();

@Override
String toString();
}

/**
* Sets the title (needs to create a new instance for this)
*
* @param title new title for rule app
* @return copy of this with the new title
*/
public abstract AbstractExternalSolverRuleApp setTitle(String title);

@Override
public AbstractExternalSolverRuleApp setIfInsts(ImmutableList<PosInOccurrence> ifInsts) {
setMutable(ifInsts);
return this;
}
}
Loading

0 comments on commit 57dc2d3

Please sign in to comment.