Skip to content

Incremental#23

Open
Jabe03 wants to merge 19 commits into
kind2-mc:mainfrom
Jabe03:incremental
Open

Incremental#23
Jabe03 wants to merge 19 commits into
kind2-mc:mainfrom
Jabe03:incremental

Conversation

@Jabe03

@Jabe03 Jabe03 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Update Java API to use the new -ijson option of the Kind 2 executable and process each new object as it is printed by Kind 2.

Added the ResultListener class which fires each time the API recieves a new Kind 2 object. This is used to pass the information to the LSP incrementally.

This change requires the changes in the LSP and Kind 2 OCaml PRs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Kind2 Java API to consume Kind 2’s incremental JSON stream (-ijson) and expose incremental result updates via a listener callback, enabling downstream consumers (e.g., the LSP) to react as each JSON object arrives.

Changes:

  • Switch Kind 2 invocation to -ijson and parse output incrementally with JsonStreamParser, optionally notifying a ResultListener.
  • Extend Result with incremental parsing (initializeInc) plus a finalization step (closeInitialization) instead of parsing the entire JSON array at once.
  • Add a new ResultListener interface for incremental update callbacks.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.

File Description
src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java Stores JSON as a JsonArray and adds incremental parsing/finalization paths.
src/main/java/edu/uiowa/cs/clc/kind2/api/ResultListener.java Introduces a callback interface for incremental result updates.
src/main/java/edu/uiowa/cs/clc/kind2/api/Kind2Api.java Switches to -ijson, incrementally parses JSON output, and wires in listener notifications.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java Outdated
Comment on lines +302 to +305
if (/*init condition */ this.json == null){
this.json = new JsonArray();
}
this.json.add(jsonElement);
Comment thread src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java
Comment thread src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java
Comment thread src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java
Comment thread src/main/java/edu/uiowa/cs/clc/kind2/api/Kind2Api.java Outdated
Comment thread src/main/java/edu/uiowa/cs/clc/kind2/api/Kind2Api.java Outdated
Comment thread src/main/java/edu/uiowa/cs/clc/kind2/api/Kind2Api.java
Comment thread src/main/java/edu/uiowa/cs/clc/kind2/api/ResultListener.java
Comment thread src/main/java/edu/uiowa/cs/clc/kind2/results/Result.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants