Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
1375a4c
Added parser backend CLI parameter
ahelwer Dec 7, 2025
4f0dae4
Use SANY parse backend when indicated
ahelwer Dec 8, 2025
2973c8f
Stubbed out SANY parse architecture
ahelwer Dec 8, 2025
f58b5d3
Download tla2tools.jar during build
ahelwer Dec 8, 2025
408dc8e
Call SANY XML Exporter and capture XML output
ahelwer Dec 9, 2025
7425938
Integrate SANY XML processing code
ahelwer Dec 9, 2025
fb1aff0
Write some tests to explore prototype
ahelwer Dec 18, 2025
04ab246
Reorganized SANY code into its own module
ahelwer Dec 26, 2025
ff84fb0
Started conversion code
ahelwer Dec 30, 2025
d08e567
Translation cont'd
ahelwer Dec 31, 2025
06f4fc0
Translations runnable in test
ahelwer Dec 31, 2025
9067e4d
Fix deadlocked SANY call
ahelwer Dec 31, 2025
64b557d
Use maps instead of lists
ahelwer Dec 31, 2025
cbbf735
Variable conversion supported
ahelwer Jan 1, 2026
886da6a
Basic operator definition conversion supported
ahelwer Jan 1, 2026
36a0d03
Convert many expressions
ahelwer Jan 1, 2026
194f2db
Converted CHOOSE
ahelwer Jan 8, 2026
905e482
Quantification conversion begin
ahelwer Jan 8, 2026
ea19f36
Quantification conversion complete
ahelwer Jan 8, 2026
86c46bb
Theorem name conversion
ahelwer Jan 9, 2026
22fc0fc
Added comments
ahelwer Jan 9, 2026
92ca26b
Proof conversion started
ahelwer Jan 9, 2026
45ce219
Basic proof conversion complete
ahelwer Jan 13, 2026
3728b62
Simplified XML representation
ahelwer Jan 14, 2026
b6611a5
Improved XML parsing
ahelwer Jan 15, 2026
bfcb8c1
Start elaboration process
ahelwer Jan 16, 2026
25c8396
XML parsing: added data subtypes
ahelwer Jan 16, 2026
c0e4f2d
Figuring out propertiesto attach to proof steps
ahelwer Jan 17, 2026
be84a11
Parsed proof step names
ahelwer Jan 19, 2026
9f47fe1
Extract proof level from step names
ahelwer Jan 19, 2026
4dc60f2
Finish attaching proof name metadata
ahelwer Jan 20, 2026
1a1a17d
Propagate assumption/discovery of proof levels up and down tree
ahelwer Jan 21, 2026
9cf2c07
Flatten module
ahelwer Jan 21, 2026
fff604e
Now stuck on proof expansion
ahelwer Jan 23, 2026
c2fd073
Proof expansion progress
ahelwer Jan 23, 2026
1bb3840
Translating Examples specs
ahelwer Jan 24, 2026
a178534
Fix theorem node translation
ahelwer Jan 27, 2026
1a19ad3
Parse instance units
ahelwer Jan 28, 2026
7a50609
Translate recursive functions
ahelwer Jan 28, 2026
e38625e
Translate functions, ITE, and case
ahelwer Jan 29, 2026
60db57e
Translate INSTANCE substitutions
ahelwer Jan 29, 2026
e57318f
Translated CONSTANTS
ahelwer Jan 29, 2026
f581aaa
Translated set filter
ahelwer Jan 29, 2026
3afc66f
Translated record sets
ahelwer Jan 29, 2026
83203f7
Translated record constructor
ahelwer Jan 29, 2026
7110ebb
Translated cartesian product
ahelwer Jan 29, 2026
8f287e4
Translated EXCEPT
ahelwer Jan 31, 2026
0ff4bea
Translate fairness
ahelwer Jan 31, 2026
935712a
Parse assume/prove and new symbol nodes
ahelwer Feb 2, 2026
02622c1
Parsed use-or-hide
ahelwer Feb 2, 2026
a551164
Converted use-or-hide
ahelwer Feb 5, 2026
4892ec6
XML parsing improved for BoundSymbol, OpDeclNode, UserDefinedOpNode
ahelwer Feb 6, 2026
45e4b4f
Convert CASE proof step
ahelwer Feb 6, 2026
c1f19e2
Convert PICK proof step
ahelwer Feb 6, 2026
35ec791
Parse XML for all expression types
ahelwer Feb 7, 2026
dba8932
Convert PICK and TAKE proof steps properly
ahelwer Feb 9, 2026
4161e7c
Convert CASE OTHER
ahelwer Feb 9, 2026
e7d6e2a
Convert all examples specs
ahelwer Feb 9, 2026
486974a
Enumerate SANY's built-in operators
ahelwer Feb 17, 2026
c4a9361
Support using community modules & apalache jars when parsing
ahelwer Feb 19, 2026
e41a76d
Upstream SANY DecimalNode fixes
ahelwer Feb 19, 2026
17306b5
Upstream SANY LOCAL changes
ahelwer Feb 19, 2026
35841fc
Upstream SANY proof level changes
ahelwer Feb 19, 2026
c0004eb
Upstream SANY EXTENDS addition
ahelwer Feb 19, 2026
5b1167e
Handle subexpressions (or rather don't)
ahelwer Feb 21, 2026
77e66ed
Convert HAVE proof steps
ahelwer Feb 26, 2026
34ab24e
Parse M!op type references
ahelwer Feb 27, 2026
0590454
Added location info for debugging ref resolve failures
ahelwer Feb 27, 2026
2145d71
Convert DEFINE INSTANCE proof steps
ahelwer Feb 27, 2026
a4427b0
Use TLAPM standard modules
ahelwer Feb 28, 2026
30a68e6
Improve error reporting
ahelwer Feb 28, 2026
9892d23
Fixed proof step order bug
ahelwer Mar 2, 2026
68b7b70
Removed unnecessary utility functions in xml
ahelwer Mar 2, 2026
bd4a5f8
Translated ASSUME/PROVE hypotheses
ahelwer Mar 2, 2026
4e89248
Fully convert label nodes
ahelwer Mar 2, 2026
8c5ee32
Convert LAMBDA
ahelwer Mar 12, 2026
4e7e2f2
Fix sany_tests, start work on semantic test escalation
ahelwer Mar 13, 2026
38f024b
Semantic test framework
ahelwer Mar 16, 2026
4d3647d
Adding semantic tests
ahelwer Mar 20, 2026
f850406
Promote s-expression conversion code from test to library
ahelwer Mar 21, 2026
4a009d7
Order unit-level definitions by position in file
ahelwer Mar 24, 2026
b1830f6
Fixed conversion of 0-arity builtins
ahelwer Mar 25, 2026
ae1597d
Validated basic theorem translation
ahelwer Mar 25, 2026
a975b11
Tests for some proof types
ahelwer Mar 28, 2026
8c94cae
Removed AddTwo
ahelwer Mar 28, 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
11 changes: 11 additions & 0 deletions deps/tla2tools.jar/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
TLA_TOOLS_JAR_URL=https://github.com/tlaplus/tlaplus/releases/download/v1.8.0/tla2tools.jar

tla2tools.jar:
wget --progress=dot:giga $(TLA_TOOLS_JAR_URL)

clean:
rm tla2sany.jar

sany: tla2tools.jar

.PHONY: sany clean
9 changes: 9 additions & 0 deletions deps/tla2tools.jar/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; Download SANY
(rule
(deps "Makefile")
(targets tla2tools.jar)
(action (run "make" "-C" "." "sany")))

(install
(section (site (tlapm backends)))
(files (tla2tools.jar as bin/tla2tools.jar)))
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
ppx_inline_test
ppx_assert
ppx_deriving
xmlm
ounit2)
(depopts
lsp ; https://github.com/ocaml/ocaml-lsp
Expand Down
1 change: 1 addition & 0 deletions src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
dune-site
dune-build-info
camlzip ; main deps.
xmlm
sexplib)
; for inline tests only (ppx_assert).
(foreign_stubs
Expand Down
5 changes: 5 additions & 0 deletions src/params.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ let prefer_stdlib = ref false
(* If set to true, the TLAPM will prefer the modules from the STDLIB
instead of modules with the same names in the search path. *)

type parser = | Tlapm | Sany
let parser_backend = ref Tlapm

let module_jar_paths = ref []

let noproving = ref false (* Don't send any obligation to the back-ends. *)

let printallobs = ref false
Expand Down
3 changes: 3 additions & 0 deletions src/params.mli
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ val toolbox: bool ref
val toolbox_vsn: int ref
val use_stdin: bool ref
val prefer_stdlib: bool ref
type parser = | Tlapm | Sany
val parser_backend: parser ref
val module_jar_paths : string list ref

(* expr/fmt.ml *)
val debugging: string -> bool
Expand Down
20 changes: 15 additions & 5 deletions src/paths.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@ let backend_paths =
let stdlib_paths =
site_paths Setup_paths.Sites.stdlib [ "lib"; "tlapm"; "stdlib" ]

let backend_path_elems =
let site_bin bs = Filename.concat bs "bin" in
let site_isa bs = List.fold_left Filename.concat bs [ "Isabelle"; "bin" ] in
let site_paths bs = [ site_bin bs; site_isa bs ] in
List.concat (List.map site_paths backend_paths)

(** If the backends site is not available ([]), then look for executables in the PATH,
otherwise we are in the dune-based build and should look for the backends in the
specified site locations. *)
let backend_path_string =
let site_bin bs = Filename.concat bs "bin" in
let site_isa bs = List.fold_left Filename.concat bs [ "Isabelle"; "bin" ] in
let site_paths bs = [ site_bin bs; site_isa bs ] in
let path_elems = List.concat (List.map site_paths backend_paths) in
Printf.sprintf "%s:%s" (String.concat ":" path_elems) (Sys.getenv "PATH")
let paths = String.concat ":" backend_path_elems in
try Printf.sprintf "%s:%s" paths (Sys.getenv "PATH")
with Not_found -> paths


let backend_classpath_string jar_file =
let classpath = List.map (fun path -> Filename.concat path jar_file) backend_path_elems |> String.concat ":" in
try Printf.sprintf "%s:%s" classpath (Sys.getenv "CLASSPATH")
with Not_found -> classpath

let find_path_containing paths file =
let find_actual path = Sys.file_exists (Filename.concat path file) in
Expand Down
1 change: 1 addition & 0 deletions src/paths.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
val backend_path_string : string
val backend_classpath_string : string -> string
val backend_paths : string list
val stdlib_paths : string list
val find_path_containing : string list -> string -> string option
Loading
Loading