Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
e2b5a7d
some functions for tff
wadoon Oct 4, 2023
8f2aec3
different clients
wadoon Oct 8, 2023
963386f
wip
wadoon Oct 13, 2023
3a8512a
Creating an JSON-RPC API
wadoon Oct 15, 2023
a049fa5
working on a working minimal version
wadoon Oct 29, 2023
e76f27b
more doc and py generation
wadoon Oct 29, 2023
c700012
running for primitive data types, somethings wrong in de-/serialization
wadoon Nov 1, 2023
d2dcd70
add throwable adapter
wadoon Nov 3, 2023
6887838
spotless and merge errors
wadoon Nov 18, 2023
82f54f0
some functions for tff
wadoon Oct 4, 2023
6623b4b
different clients
wadoon Oct 8, 2023
5cbe177
wip
wadoon Oct 13, 2023
fd5cb79
Creating an JSON-RPC API
wadoon Oct 15, 2023
acfeada
working on a working minimal version
wadoon Oct 29, 2023
46f0cef
more doc and py generation
wadoon Oct 29, 2023
0efeaa2
running for primitive data types, somethings wrong in de-/serialization
wadoon Nov 1, 2023
993f908
add throwable adapter
wadoon Nov 3, 2023
ae5f215
spotless and merge errors
wadoon Nov 18, 2023
76e4838
Merge branch 'main' into weigl/jsonrpc
wadoon Nov 24, 2023
16a8876
Merge branch 'main' into weigl/jsonrpc
wadoon Dec 3, 2023
41e153a
Merge remote-tracking branch 'origin/weigl/jsonrpc' into weigl/jsonrpc
wadoon Dec 7, 2023
b96631b
Merge branch 'main' into weigl/jsonrpc
wadoon Feb 25, 2024
48b5867
Merge branch 'refs/heads/main' into weigl/jsonrpc
wadoon Apr 23, 2024
2a56ec0
Merge branch 'main' into weigl/jsonrpc
wadoon May 5, 2024
80636d5
Merge branch 'main' into weigl/jsonrpc
wadoon May 6, 2024
82360a2
Merge remote-tracking branch 'refs/remotes/origin/main' into weigl/js…
wadoon May 23, 2024
5d94a30
Merge branch 'main' into weigl/jsonrpc
wadoon Jun 21, 2024
82ef399
reenable sonarqube, disable the crappy things
wadoon Jun 21, 2024
3854542
Merge branch 'weigl/codequality' into weigl/jsonrpc
wadoon Jun 24, 2024
4a37ba2
Merge branch 'main' into weigl/jsonrpc
wadoon Jun 25, 2024
4f9d2cb
Merge branch 'refs/heads/main' into weigl/jsonrpc
wadoon Jun 26, 2024
f024c07
fix after refactoring + spotless
wadoon Jun 26, 2024
2073cc7
Merge branch 'main' into weigl/jsonrpc
wadoon Aug 4, 2024
77f8834
Merge remote-tracking branch 'origin/main' into weigl/jsonrpc
wadoon Oct 18, 2024
8c33e8c
wip
wadoon Oct 20, 2024
6645a0d
Merge branch 'main' into weigl/jsonrpc
wadoon Nov 22, 2024
8ece375
start of a simple Java client
wadoon Nov 22, 2024
c89ca48
java variant
wadoon Nov 24, 2024
1fe76bb
writing on a java client
wadoon Dec 3, 2024
f6c40bf
Merge remote-tracking branch 'origin/main' into weigl/jsonrpc
wadoon Jan 25, 2025
c3cac62
fix merge
wadoon Jan 25, 2025
b668d16
fix serialization of java.io.File
wadoon Jan 25, 2025
997daee
- Shutdown Callbacks
samysweb Feb 19, 2025
22ce93a
Error message for python generation
samysweb Feb 19, 2025
4c231ea
Updated library and example
samysweb Feb 19, 2025
6cfba3d
Added proof api endpoint
samysweb Feb 20, 2025
979ff7d
Attempt at reseting proof control
samysweb Feb 20, 2025
b80d36a
First (incomplete) working proof management endpoint
samysweb Feb 20, 2025
d6c37d2
Updated python client for proof endpoint
samysweb Feb 20, 2025
a70a800
Improved interface, environment disposal
samysweb Feb 20, 2025
e1c2b46
HacKeYthon results for JSON RPC API (#3567)
wadoon Feb 20, 2025
100c927
Merge branch 'main' into weigl/jsonrpc
wadoon Mar 5, 2025
1b67372
spotless
wadoon Mar 5, 2025
0b91b9c
Fixed JSON type annotation&retrieval
samysweb Mar 24, 2025
b77753c
Updated json type annotation on codegen/python side
samysweb Mar 24, 2025
0d5026f
Merge branch 'steuber/jsonrpc' into weigl/jsonrpc
samysweb Mar 24, 2025
6b6f5af
Configurable Strategy (not Streategy) options for proof auto mode
samysweb Mar 24, 2025
1b69ea1
Extracted node description function
samysweb Mar 24, 2025
dacd094
Null serialization (necessary due to python class initialization), no…
samysweb Mar 24, 2025
5f808ec
Merge branch 'main' into weigl/jsonrpc
wadoon Mar 31, 2025
aa01f89
Merge remote-tracking branch 'origin/main' into weigl/jsonrpc
wadoon Apr 6, 2025
0f84a98
reformat / remove weakrefs from the data model
wadoon Apr 6, 2025
84211e8
Merge branch 'main' into weigl/jsonrpc
wadoon Apr 19, 2025
b773f8e
Merge branch 'main' into weigl/jsonrpc
wadoon May 10, 2025
ceb2cce
Merge branch 'main' into weigl/jsonrpc
wadoon Jun 8, 2025
78865e7
Merge branch 'main' into weigl/jsonrpc
wadoon Jun 20, 2025
954ffe5
fix compile error
wadoon Jul 8, 2025
77da8c3
Merge branch 'main' into weigl/jsonrpc
wadoon Jul 8, 2025
b66c286
documentation generation
wadoon Jul 8, 2025
24392fc
Merge branch 'main' into weigl/jsonrpc
wadoon Aug 14, 2025
692b017
repair build.gradle
wadoon Aug 15, 2025
adc8cd6
Merge branch 'main' into weigl/jsonrpc
wadoon Aug 24, 2025
4e453c4
spotless
wadoon Aug 24, 2025
1c1d2f1
Merge branch 'main' into weigl/jsonrpc
wadoon Nov 20, 2025
72bc0f2
Merge branch 'main' into weigl/jsonrpc
wadoon Nov 24, 2025
d1bef25
fixing the missing javadoc in the api generator
wadoon Nov 28, 2025
0f23b99
better documentation
wadoon Nov 29, 2025
d238fbc
working on documentation, now with json examples
wadoon Nov 30, 2025
46fd3b7
try to make the documentation better
wadoon Dec 21, 2025
776c21f
Merge branch 'main' into weigl/jsonrpc
wadoon Dec 21, 2025
d94ff14
better documentation
wadoon Dec 27, 2025
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
4 changes: 3 additions & 1 deletion key.core.example/src/main/java/org/key_project/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ private static void proveEnvironmemt(KeYEnvironment<?> env) {
LOGGER.info("Found contract '" + contract.getDisplayName());
proveContract(env, contract);
}
} catch (InterruptedException ignored) {
} finally {
env.dispose(); // Ensure always that all instances of KeYEnvironment are disposed
}
Expand Down Expand Up @@ -134,7 +135,8 @@ private static List<Contract> getContracts(KeYEnvironment<?> env) {
* @param env the {@link KeYEnvironment} in which to prove the contract
* @param contract the {@link Contract} to be proven
*/
private static void proveContract(KeYEnvironment<?> env, Contract contract) {
private static void proveContract(KeYEnvironment<?> env, Contract contract)
throws InterruptedException {
Proof proof = null;
try {
// Create proof
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void taskStarted(TaskStartedInfo info) {
numOfInvokedMacros++;
if (superordinateListener != null) {
superordinateListener.taskStarted(new DefaultTaskStartedInfo(TaskKind.Macro,
macroName + (macroName.length() == 0 ? "" : " -- ") + info.message(),
macroName + (macroName.isEmpty() ? "" : " -- ") + info.message(),
info.size()));
}
}
Expand Down
52 changes: 44 additions & 8 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 @@ -3,10 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.proof;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;

import de.uka.ilkd.key.java.Services;
Expand All @@ -15,16 +12,15 @@
import de.uka.ilkd.key.logic.op.ProgramVariable;
import de.uka.ilkd.key.pp.LogicPrinter;
import de.uka.ilkd.key.pp.NotationInfo;
import de.uka.ilkd.key.proof.mgt.RuleJustification;
import de.uka.ilkd.key.proof.proofevent.NodeChangeJournal;
import de.uka.ilkd.key.proof.proofevent.RuleAppInfo;
import de.uka.ilkd.key.rule.AbstractExternalSolverRuleApp;
import de.uka.ilkd.key.rule.IBuiltInRuleApp;
import de.uka.ilkd.key.rule.NoPosTacletApp;
import de.uka.ilkd.key.rule.TacletApp;
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.strategy.QueueRuleApplicationManager;
import de.uka.ilkd.key.strategy.Strategy;
import de.uka.ilkd.key.util.MiscTools;
import de.uka.ilkd.key.util.properties.MapProperties;
import de.uka.ilkd.key.util.properties.Properties;
import de.uka.ilkd.key.util.properties.Properties.Property;
Expand Down Expand Up @@ -740,6 +736,13 @@ public List<RuleApp> getAllBuiltInRuleApps() {
return ruleApps;
}

/**
* Return a list with available taclet application on this goal.
*/
public List<TacletApp> getAllTacletApps() {
return getAllTacletApps(proof().getServices());
}

public List<TacletApp> getAllTacletApps(Services services) {
RuleAppIndex index = ruleAppIndex();
index.autoModeStopped();
Expand All @@ -764,4 +767,37 @@ protected boolean filter(Taclet taclet) {
return allApps;
}

/**
* Returns a list with all known rule applications within this proof goal.
*/
public List<RuleApp> getAllAvailableRules() {
var taclets = getAllTacletApps();
var builtin = getAllBuiltInRuleApps();
builtin.addAll(taclets);
return builtin;
}

public List<Rule> getAvailableRules() {
var s = new ArrayList<Rule>(2048);
for (final BuiltInRule br : ruleAppIndex().builtInRuleAppIndex()
.builtInRuleIndex().rules()) {
s.add(br);
}

Set<NoPosTacletApp> set = ruleAppIndex().tacletIndex().allNoPosTacletApps();
OneStepSimplifier simplifier = MiscTools.findOneStepSimplifier(proof());
if (simplifier != null && !simplifier.isShutdown()) {
set.addAll(simplifier.getCapturedTaclets());
}

for (final NoPosTacletApp app : set) {
RuleJustification just = proof().mgt().getJustification(app);
if (just == null) {
continue; // do not break system because of this
}
s.add(app.taclet()); // TODO not good
}
return s;
}

}
44 changes: 33 additions & 11 deletions key.core/src/main/java/de/uka/ilkd/key/proof/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-only */
package de.uka.ilkd.key.proof;

import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand All @@ -12,6 +13,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.stream.Stream;

import de.uka.ilkd.key.logic.RenamingTable;
import de.uka.ilkd.key.logic.op.IProgramVariable;
Expand Down Expand Up @@ -50,11 +52,14 @@ public class Node implements Iterable<Node> {

private static final String NODES = "nodes";

/** the proof the node belongs to */
/**
* the proof the node belongs to
*/
private final Proof proof;

/** The parent node. **/
private @Nullable Node parent = null;

/**
* The branch location of this proof node.
*/
Expand Down Expand Up @@ -82,7 +87,9 @@ public class Node implements Iterable<Node> {

private boolean closed = false;

/** contains non-logical content, used for user feedback */
/**
* contains non-logical content, used for user feedback
*/
private NodeInfo nodeInfo;

/**
Expand Down Expand Up @@ -161,7 +168,9 @@ public void setSequent(Sequent seq) {
this.seq = seq;
}

/** returns the sequent of this node */
/**
* returns the sequent of this node
*/
public Sequent sequent() {
return seq;
}
Expand All @@ -175,7 +184,9 @@ public NodeInfo getNodeInfo() {
return nodeInfo;
}

/** returns the proof the Node belongs to */
/**
* returns the proof the Node belongs to
*/
public Proof proof() {
return proof;
}
Expand Down Expand Up @@ -225,7 +236,9 @@ public RuleApp getAppliedRuleApp() {
return appliedRuleApp;
}

/** Returns the set of NoPosTacletApps at this node */
/**
* Returns the set of NoPosTacletApps at this node
*/
public Iterable<NoPosTacletApp> getLocalIntroducedRules() {
return localIntroducedRules;
}
Expand All @@ -249,7 +262,7 @@ public void addLocalProgVars(Iterable<? extends IProgramVariable> elements) {

/**
* Returns the set of freshly created function symbols known to this node.
*
* <p>
* In the resulting list, the newest additions come first.
*
* @return a non-null immutable list of function symbols.
Expand Down Expand Up @@ -471,13 +484,14 @@ public Iterator<Node> subtreeIterator() {
return new SubtreeIterator(this);
}

/** @return number of children */
/**
* @return number of children
*/
public int childrenCount() {
return children.size();
}

/**
*
* @param i an index (starting at 0).
* @return the i-th child of this node.
*/
Expand Down Expand Up @@ -667,7 +681,9 @@ public boolean sanityCheckDoubleLinks() {
return true;
}

/** marks a node as closed */
/**
* marks a node as closed
*/
Node close() {
closed = true;
Node tmp = parent;
Expand All @@ -684,7 +700,7 @@ Node close() {
/**
* Opens a previously closed node and all its closed parents.
* <p>
*
* <p>
* This is, for instance, needed for the {@link MergeRule}: In a situation where a merge node
* and its associated partners have been closed and the merge node is then pruned away, the
* partners have to be reopened again. Otherwise, we have a soundness issue.
Expand All @@ -699,7 +715,9 @@ void reopen() {
clearNameCache();
}

/** @return true iff this inner node is closeable */
/**
* @return true iff this inner node is closeable
*/
private boolean isCloseable() {
assert childrenCount() > 0;
for (Node child : children) {
Expand Down Expand Up @@ -838,4 +856,8 @@ public int getStepIndex() {
void setStepIndex(int stepIndex) {
this.stepIndex = stepIndex;
}

public Stream<Node> childrenStream() {
return children.stream();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* 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;

import java.io.Serializable;

public class ProofNodeDescription implements Serializable {
/**
* Collects the information from the tree to which branch the current node belongs:
* <ul>
* <li>Invariant Initially Valid</li>
* <li>Body Preserves Invariant</li>
* <li>Use Case</li>
* <li>...</li>
* </ul>
*
* @param node the current node
* @return a String containing the path information to display
*/
public static String collectPathInformation(Node node) {
while (node != null) {
if (node.getNodeInfo() != null && node.getNodeInfo().getBranchLabel() != null) {
String label = node.getNodeInfo().getBranchLabel();
/*
* Are there other interesting labels? Please feel free to add them here.
*/
if (label.equals("Invariant Initially Valid")
|| label.equals("Invariant Preserved and Used") // for loop scope invariant
|| label.equals("Body Preserves Invariant") || label.equals("Use Case")
|| label.equals("Show Axiom Satisfiability") || label.startsWith("Pre (")
|| label.startsWith("Exceptional Post (") // exceptional postcondition
|| label.startsWith("Post (") // postcondition of a method
|| label.contains("Normal Execution") || label.contains("Null Reference")
|| label.contains("Index Out of Bounds") || label.contains("Validity")
|| label.contains("Precondition") || label.contains("Usage")) {
return label;
}
}
node = node.parent();
}
// if no label was found we have to prove the postcondition
return "Show Postcondition/Modifiable";
}
}
36 changes: 17 additions & 19 deletions key.ui/src/main/java/de/uka/ilkd/key/core/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,25 +464,27 @@ private AbstractMediatorUserInterfaceControl createUserInterface(List<Path> file
}

public static void ensureExamplesAvailable() {
File examplesDir = getExamplesDir() == null ? ExampleChooser.lookForExamples()
: new File(getExamplesDir());
if (!examplesDir.exists()) {
Path examplesDir = getExamplesDir() == null
? ExampleChooser.lookForExamples()
: getExamplesDir();

if (!Files.exists(examplesDir)) {
examplesDir = setupExamples();
}
setExamplesDir(examplesDir.getAbsolutePath());
setExamplesDir(examplesDir.toAbsolutePath());
}

private static File setupExamples() {
private static Path setupExamples() {
try {
URL examplesURL = Main.class.getResource("/examples.zip");
if (examplesURL == null) {
throw new IOException("Missing examples.zip in resources");
}

File tempDir = createTempDirectory();
Path tempDir = createTempDirectory();

if (tempDir != null) {
IOUtil.extractZip(examplesURL.openStream(), tempDir.toPath());
IOUtil.extractZip(examplesURL.openStream(), tempDir);
}
return tempDir;
} catch (IOException e) {
Expand All @@ -491,13 +493,9 @@ private static File setupExamples() {
}
}

private static File createTempDirectory() throws IOException {
final File tempDir = File.createTempFile("keyheap-examples-", null);
tempDir.delete();
if (!tempDir.mkdir()) {
return null;
}
Runtime.getRuntime().addShutdownHook(new Thread(() -> IOUtil.delete(tempDir)));
private static Path createTempDirectory() throws IOException {
Path tempDir = Files.createTempDirectory("keyheap-examples-");
Runtime.getRuntime().addShutdownHook(new Thread(() -> IOUtil.delete(tempDir.toFile())));
return tempDir;
}

Expand Down Expand Up @@ -541,7 +539,7 @@ private void preProcessInput()
}

if (inputFiles != null && !inputFiles.isEmpty()) {
Path f = inputFiles.get(0);
Path f = inputFiles.getFirst();
if (Files.isDirectory(f)) {
workingDir = f;
} else {
Expand All @@ -552,20 +550,20 @@ private void preProcessInput()
}
}

private static String EXAMPLE_DIR = null;
private static Path EXAMPLE_DIR = null;

public static @Nullable String getExamplesDir() {
public static @Nullable Path getExamplesDir() {
return EXAMPLE_DIR;
}

/**
* Defines the examples directory. This method is used by the Eclipse
* Defines the examples' directory. This method is used by the Eclipse
* integration (KeY4Eclipse)
* to use the examples extract from the plug-in into the workspace.
*
* @param newExamplesDir The new examples directory to use.
*/
public static void setExamplesDir(String newExamplesDir) {
public static void setExamplesDir(Path newExamplesDir) {
EXAMPLE_DIR = newExamplesDir;
}
}
Loading
Loading