Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
2b4a9e0
Add getIonDeserializer% elaborator for generic Ion deserialization
keyboardDrummer-bot Apr 9, 2026
29bfcc7
Add Float support and nested/recursive type deserialization
keyboardDrummer-bot Apr 10, 2026
1aad1e3
Replace DDM-based Java generator with getIonSerializer% elaborator
keyboardDrummer-bot Apr 10, 2026
331f302
Merge remote-tracking branch 'origin/main' into bot/ion-deserializer
keyboardDrummer-bot Apr 29, 2026
c066e4a
Add List, Option, and Decimal support to Ion deserializer and Java se…
keyboardDrummer-bot Apr 29, 2026
c809c35
Fix #testCompile: move javac outside for loop and add dir to classpath
keyboardDrummer-bot May 1, 2026
07f8155
Add Strata.Util.IonDeserializer to Strata.lean imports
keyboardDrummer-bot May 1, 2026
71bc8ee
Remove GenDDM and its dependencies
keyboardDrummer-bot Jun 24, 2026
ae70b03
Merge branch 'reviewed-kbd-will-merge-to-main' into bot/ion-deserializer
keyboardDrummer-bot Jun 25, 2026
a840e2e
Fix Strata.Decimal → StrataDDM.Decimal and correct ion-java jar path
keyboardDrummer-bot Jun 25, 2026
a42fe6f
Revert test exclusion: run all tests with 'lake test'
keyboardDrummer-bot Jun 25, 2026
886b4c1
Add laurelJavaGen: generate Laurel Java AST from Lean types
keyboardDrummer Jun 25, 2026
bcb1884
Fix getIonSerializer%: handle parametric types and mutual inductives
keyboardDrummer Jun 25, 2026
86eb31b
Fix getIonSerializer%: handle type parameters and optParam defaults
keyboardDrummer Jun 25, 2026
64d1327
Fix Java TestGen: accommodate ToIon.java in file counts, skip jar-dep…
keyboardDrummer-bot Jun 25, 2026
c03466b
Generate Java generics for parametric Lean types
keyboardDrummer Jun 26, 2026
c7292ff
Fix Java Gen build: resolve FieldInfo name clash, String.Slice, and t…
keyboardDrummer-bot Jun 26, 2026
6d5afed
Fix getIonDeserializer% for parametric types; add Laurel Ion deserial…
keyboardDrummer Jun 26, 2026
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: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ jobs:
StrataDDM/.lake
StrataBoole/.lake
StrataPython/.lake
- name: Verify Java testdata is up to date

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Explanation from LLM:

Removed the "Verify Java testdata is up to date" step: This step previously ran StrataTestExtra/Languages/Java/regenerate-testdata.sh and checked for git diffs in the testdata directory. It's no longer needed because the old approach (generating Java from DDM dialect files, running a Java program to produce .ion test fixtures, then checking them into the repo) has been replaced. The new getIonSerializer% / getIonDeserializer% approach generates and compiles Java at test time and does roundtrip verification inline — there are no longer any checked-in .ion testdata files or a regenerate-testdata.sh script to keep in sync.

run: |
StrataTestExtra/Languages/Java/regenerate-testdata.sh
git diff --exit-code StrataTestExtra/Languages/Java/testdata/
- name: Build and run strata verify
run: lake exe strata verify ../Examples/SimpleProc.core.st
working-directory: StrataCLI
Expand Down
79 changes: 0 additions & 79 deletions Scripts/JavaGenTestData.lean

This file was deleted.

36 changes: 36 additions & 0 deletions Scripts/LaurelJavaGen.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/-
Copyright Strata Contributors

SPDX-License-Identifier: Apache-2.0 OR MIT
-/
import StrataDDM.Integration.Java.Gen
import Strata.Languages.Laurel.LaurelAST

/-!
# Laurel Java AST Generator

Generates Java source files for the Laurel AST types using `getIonSerializer%`.
The generated Java matches the Ion encoding format used by `getIonDeserializer%`.

Usage:
lake exe laurelJavaGen <package> <output-dir>

Example:
lake exe laurelJavaGen org.strata.jverify.laurel ../jverify/verifier/src/main/java
-/

open Strata.Java

/-- Pre-computed Java files for the Laurel `Program` type. -/
private def laurelFiles : GeneratedFiles := getIonSerializer% Strata.Laurel.Program "___placeholder___"

def main (args : List String) : IO Unit := do
match args with
| [package, outputDir] =>
let files := laurelFiles.files.map fun (name, content) =>
(name, content.replace "package ___placeholder___;" s!"package {package};")
writeJavaFiles outputDir package { files }
IO.println s!"Generated {files.size} Java files in {outputDir}"
| _ =>
IO.eprintln "Usage: lake exe laurelJavaGen <package> <output-dir>"
IO.Process.exit 1
1 change: 1 addition & 0 deletions Strata.lean
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Strata.DL.Lambda
import Strata.DL.Imperative

/- Utilities -/
import Strata.Util.IonDeserializer
import Strata.Util.NameProofs
import Strata.Util.Sarif

Expand Down
14 changes: 14 additions & 0 deletions Strata/Languages/Laurel.lean
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Strata.Languages.Laurel.Grammar.ConcreteToAbstractTreeTranslator
import Strata.Languages.Laurel.Grammar.AbstractToConcreteTreeTranslator
import Strata.Languages.Laurel.Grammar.LaurelGrammar
import StrataDDM.Elab
import Strata.Util.IonDeserializer

/-! ## Strata Laurel API

Expand All @@ -22,6 +23,11 @@ public section

namespace Strata

/-- Deserializer for the new struct-format Ion encoding of `Laurel.Program`,
generated by `getIonSerializer%`. -/
private partial def deserializeLaurelProgram : ByteArray → Except Std.Format Laurel.Program :=
getIonDeserializer% Laurel.Program

/-! ### File I/O -/

/--
Expand Down Expand Up @@ -64,9 +70,17 @@ def readLaurelIonFiles (bytes : ByteArray)
/--
Deserialize Laurel Ion bytes and parse all files into a single
combined `Laurel.Program`.

Supports both the new struct-format (from `getIonSerializer%`) and the
legacy DDM-based format. Tries the new format first, falls back to DDM.
-/
def readLaurelIonProgram (bytes : ByteArray)
: IO Laurel.Program := do
-- Try new struct-format deserialization first
match deserializeLaurelProgram bytes with
| .ok program => return program
| .error _ => pure ()
-- Fall back to legacy DDM path
let files ← readLaurelIonFiles bytes
let mut combined : Laurel.Program := {
staticProcedures := []
Expand Down
Loading
Loading