Skip to content

Commit

Permalink
Merge branch 'main' into map-with-new-equalities
Browse files Browse the repository at this point in the history
  • Loading branch information
Drodt authored Jul 12, 2024
2 parents c042152 + b590ab9 commit 0ebb8b5
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 17 deletions.
8 changes: 4 additions & 4 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- name: Build with Gradle
run: ./gradlew -DENABLE_NULLNESS=true compileTest

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
java-version: '21'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- 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.3.2
gradle/actions/setup-gradle@v3.4.2
- 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.3.2
uses: gradle/actions/setup-gradle@v3.4.2
- name: "Running tests: ${{ matrix.test }}"
run: ./gradlew --continue ${{ matrix.test }}

Expand Down
8 changes: 4 additions & 4 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.39"
id "org.checkerframework" version "0.6.41"
}

// Configure this project for use inside IntelliJ:
Expand Down Expand Up @@ -90,11 +90,11 @@ subprojects {
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.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.3'
testImplementation project(':key.util')

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

tasks.withType(JavaCompile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,13 @@ public void save(OutputStream out) throws IOException {
}
final Sequent problemSeq = proof.root().sequent();
ps.println("\\problem {");
printer.printSemisequent(problemSeq.succedent());
if (problemSeq.antecedent().isEmpty() && problemSeq.succedent().size() == 1) {
// Problem statement is a single formula ...
printer.printSemisequent(problemSeq.succedent());
} else {
// Problem statement is a proper sequent ...
printer.printSequent(problemSeq);
}
ps.println(printer.result());
ps.println("}\n");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* 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.proof.io;

import java.io.File;
import java.io.IOException;

import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Sequent;
import de.uka.ilkd.key.nparser.KeyIO;
import de.uka.ilkd.key.proof.Proof;
import de.uka.ilkd.key.proof.init.AbstractProfile;
import de.uka.ilkd.key.proof.init.InitConfig;
import de.uka.ilkd.key.rule.TacletForTests;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class ProofSaverTest {

void testSaveProblemToFile(String content) throws IOException {
Services services = TacletForTests.services();
KeyIO io = new KeyIO(services);
KeyIO.Loader loader = io.load(content);
Sequent seq = loader.parseFile().loadProblem().getProblem();
final InitConfig initConfig =
new InitConfig(new Services(AbstractProfile.getDefaultProfile()));
Proof proof = new Proof("test", seq, "", initConfig, null);
File file = File.createTempFile("proofSaveTest", ".key");
file.deleteOnExit();
String status = new ProofSaver(proof, file).save();
assertNull(status);

KeyIO io2 = new KeyIO(services);
KeyIO.Loader loader2 = io2.load(content);
Sequent seq2 = loader2.parseFile().loadProblem().getProblem();

assertEquals(seq, seq2);
}

@Test
void saveTermProblemToFile() throws IOException {
String content = "\\problem { true }";
testSaveProblemToFile(content);
}

@Test
void saveSequentProblemToFile() throws IOException {
String content = "\\problem { true, false ==> false, false }";
testSaveProblemToFile(content);
}
}

0 comments on commit 0ebb8b5

Please sign in to comment.