Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a JSON-RPC for KeY #3303

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft

Create a JSON-RPC for KeY #3303

wants to merge 39 commits into from

Conversation

wadoon
Copy link
Member

@wadoon wadoon commented Oct 17, 2023

A remote KeY api as promised in KeY++

Design Descisions

  • We use handles to refer to large entities like, KeYEnvironment, Proof, or Node.
    These handles are called *Id and are aligned hierarchical:

    EnvironemntId < ProofId < NodeId 
    

    If you have a NodeId, you can get a ProofId by calling nodeId.proofId().

  • We do not use expose any key.core classes. For example, Key's Examples are converted into ExampleDesc for the serialization. Every information holding class ends with Desc.

  • Given complex arguments (especially optional/nullable parameters) are packed into a class which ends with Params.

TODO

  • Implement a client in non-java, non-jvm (Python)

@wadoon wadoon self-assigned this Oct 17, 2023
@wadoon wadoon marked this pull request as draft October 17, 2023 14:22
@wadoon wadoon added this to the v2.14.0 milestone Oct 24, 2023
@wadoon wadoon requested a review from Drodt October 30, 2023 18:45
@KeYProject KeYProject deleted a comment from github-actions bot Oct 30, 2023
Copy link
Member

@Drodt Drodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach. It seems like a good setup.

For what languages do you want to write a client? What's on your TODO list?

```


### client/sm (`server ~~> client`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer verbose names. Avoid abbreviations like "sm".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, something from the beginning.

I am still very unhappy with the client API. It is mainly the progress listener, which is not very good, especially with parallel processes.

api.meta.md Outdated Show resolved Hide resolved
@wadoon
Copy link
Member Author

wadoon commented Nov 2, 2023

For what languages do you want to write a client? What's on your TODO list?

I make a simple one in Python. The Python stubs are mostly generated by using Java Reflection. I am creating a JSON with meta information, markdown and Python classes.

I don't know whether you want a rust client. In general, you need a background thread for reading messages, and a shared map from request ids to wait conditions/locks for block synchronous requests until return value is received.

The Python API is more for testing, I am not planning a production-worthy state.

Do we have a use case? For JVM programs I would still recommend to use KeY directly.

wadoon and others added 3 commits November 24, 2023 13:31
* origin/weigl/jsonrpc: (71 commits)
  Bump com.diffplug.spotless from 6.22.0 to 6.23.0
  Bump ch.qos.logback:logback-classic from 1.4.11 to 1.4.12
  prepare config using dedicated labels
  Add a configuration for automatic generation of changelogs by Github
  Prevent second reading of declarations in KeYUserProblemFile
  Re-enable check for non-unique taclet names and remove two taclet duplicates
  Bump org.junit.vintage:junit-vintage-engine from 5.10.0 to 5.10.1
  Improve selection consistency in task tree view
  Undo unrelated change that got checked in.
  Use selection in task tree view to change chosen problem not mouse events
  Slight alternative in who selects the first node after loading (should be safer)
  Remove further unnecessary proof change events
  Fix (for issue #3347) that node selection gets forgotten when switching between proofs
  Merge errors
  spotless and merge errors
  add throwable adapter
  running for primitive data types, somethings wrong in de-/serialization
  more doc and py generation
  working on a working minimal version
  Creating an JSON-RPC API
  ...
@wadoon wadoon modified the milestones: v2.14.0, v2.16.0 Dec 29, 2023
@Drodt Drodt added the HacKeYthon Candidate Issue for HacKeYthon '24 label Jan 26, 2024
wadoon and others added 2 commits February 25, 2024 21:01
* refs/heads/main: (197 commits)
  reformat files
  remove unused imports
  Fixed crash with invalid SMT solver path on start.
  IsInstalled check for SMT solvers is is now dependet on OS.
  fix reviewer comments
  Add key features for the FM tutorial
  Bump ch.qos.logback:logback-classic in the gradle-deps group
  Bump ch.qos.logback:logback-classic from 1.5.3 to 1.5.5
  Bump org.slf4j:slf4j-api from 2.0.12 to 2.0.13
  applying spotless
  Boyer Moore Majority Vote
  Added test case for the bugfix
  Fixes a StackOverflow when pretty printing a taclet
  updating test case descriptions for error reporting
  Update dependabot.yml
  Update dependabot configuration
  unified naming of operator to "seq_upd".
  Bump org.ow2.asm:asm from 9.6 to 9.7
  reformat after merge
  fix hashing of set statements and assert statements
  ...

# Conflicts:
#	key.core/src/main/java/de/uka/ilkd/key/api/Matcher.java
#	key.core/src/main/java/de/uka/ilkd/key/control/KeYEnvironment.java
@wadoon wadoon removed the HacKeYthon Candidate Issue for HacKeYthon '24 label Apr 23, 2024
wadoon and others added 7 commits May 5, 2024 18:42
…onrpc

* refs/remotes/origin/main: (26 commits)
  Fix comment
  Fix checkstyle workflow
  Fix checkstyle workflow
  Fix merge conflicts & spotless
  Remove todo
  Spotless
  Fix? resolving error
  Move ParsableVariable to ncore
  Spotless
  Spotless
  Rename AbstractSV to OperatorSV
  Beautified code
  Fix settings test for SE
  Spotless fixes
  Fix taclet prefix check when parsing
  Fix taclet equality test
  Fix parsing of variable conditions
  Fix errors resulting from changing ParseableVar
  Delete Legacy Matcher and adapt VM matcher for new Modality operator
  Fix errors after changing ParsableVars
  ...
* also fix some encoding in recorder/src files
* weigl/codequality:
  reenable sonarqube, disable the crappy things
  adding comments to jml spec factory default contracts
  EQ version of seqSwapPreservesSeqPerm + proof
  added rule for sequences: swap preserves perm
  Fix test case that failed with new default-contract behavior
  Fix code format
  Add test
  Add documentation
  Add proof setting for sound or unsound default contracts
  Don't add default contracts for Object or <init> methods
  Default contract for contractless methods
  Fix compiler check when using classpath
  Add printf to JavaRedux
wadoon added 2 commits June 26, 2024 16:09
* refs/heads/main:
  Fix and test goToNext()
  Fix goToNextSibling() (thx Tobias)
  Format
  Add comments and next() method
  Remove SVSubstitute
  Clean up inheritance
  Implement missing methods
  Start implementation of traversal
  Implement cursor
  Increase Java version
  API design
Copy link

sonarcloud bot commented Jun 26, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
4 Security Hotspots
0.0% Coverage on New Code (required ≥ 80%)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link

sonarcloud bot commented Aug 4, 2024

wadoon and others added 6 commits October 18, 2024 16:28
# By Mattias Ulbrich (15) and others
# Via GitHub (21) and others
* origin/main: (36 commits)
  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
  improving code for heatmap activation
  applied spotless
  Missed nonnullness of map keys.
  type annotations for test cases
  repairing a nullness type error
  some more NonNull annotations
  Adding a test case for immutable maps.
  extending the nonnull type system to the immutable maps
  repairing type annotations in key.util ... it compiles again.
  repairing heatmap updates for inner nodes
  ...

# Conflicts:
#	.github/workflows/code_quality.yml
#	build.gradle
Copy link

sonarcloud bot commented Dec 3, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
184 New Major Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants