From 6ed1f50733d86d0da2adbde9e650f53f828f638e Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Wed, 9 Sep 2026 22:10:21 -0300 Subject: evaluator and program protocols --- lib/protocols/Program.ml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/protocols/Program.ml (limited to 'lib/protocols/Program.ml') diff --git a/lib/protocols/Program.ml b/lib/protocols/Program.ml new file mode 100644 index 0000000..b82cafc --- /dev/null +++ b/lib/protocols/Program.ml @@ -0,0 +1,17 @@ +class type implementation = object + method entry_points : string BatFingerTree.t + + method invoke : + entry:string -> + bindings:Concepts.Tuple.t -> + Context.t -> + (Handle.t, Concepts.Condition.condition) result +end + +type Handle.protocol += Program of implementation +type t = implementation + +let make impl = Program (impl :> implementation) +let from handle = Handle.into handle (function Program impl -> Some impl | _ -> None) +let entry_points i = Handle.invoke i (fun o -> o#entry_points) +let invoke i ~entry ~bindings ctx = Handle.invoke i (fun o -> o#invoke ~entry ~bindings ctx) -- cgit v1.2.3