semantic interpreter v1, semantic interpreter tests, fixes

This commit is contained in:
ProgramSnail 2025-12-14 15:59:18 +03:00
parent 1c74f0c3ef
commit a2d4bb93e6
4 changed files with 350 additions and 4 deletions

View file

@ -64,6 +64,19 @@ type l_prog = (l_fun_decl, l_body) a_prog ilogic
(* --- comments --- *)
(*
f 0:
WRITE(0)
f' 0:
READ(0)
main:
f(0)
READ(0)
*)
(*
>> ref | const ref | copy:
@ -90,7 +103,7 @@ call function with arg ref that modifies & write after any function call => !ref
(* module Tree = struct *)
(* ocanren type 'a tree = Leaf | Node of 'a * 'a tree * 'a tree *)
(* type inttree = GT.int tree [@@deriving gt ~options:{show}] *)
(* type int tree = GT.int tree [@@deriving gt ~options:{show}] *)
(* A shortcut for "ground" tree we're going to work with in "functional" code *)
(* type rtree = Std.Nat.ground tree [@@deriving gt ~options:{show}] *)