From 932e657e38665afa1da1aab549977841abbd9dcf Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Wed, 7 Oct 2026 18:25:43 -0300 Subject: drop journal in favor of local branch history --- lib/evaluators/FOL.ml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'lib/evaluators') diff --git a/lib/evaluators/FOL.ml b/lib/evaluators/FOL.ml index e436eeb..1c52265 100644 --- a/lib/evaluators/FOL.ml +++ b/lib/evaluators/FOL.ml @@ -198,10 +198,22 @@ class evaluator = inherit Kernel.Identity.of_id method to_string = "fol-evaluator" - method invoke program = - Protocols.Handle.into program (function Plan plan -> Some plan | _ -> None) - |> Option.to_result ~none:(Error.not_a_plan (Protocols.Handle.to_string program)) - |> Utilities.Result.fmap (fun plan -> Protocols.Handle.invoke plan execute) + (* A plan comes resolved; stored source names its relations by path, + read against [within]. *) + method invoke program ~within = + let open Utilities.Result in + match + ( Protocols.Handle.into program (function Plan plan -> Some plan | _ -> None), + stored program ) + with + | Some plan, _ -> Protocols.Handle.invoke plan execute + | None, Some (evaluator, _) when not (String.equal evaluator name) -> + Error (Error.foreign_program evaluator) + | None, Some (_, code) -> + let* term = decode code in + let* plan = instantiate (Kernel.Path.lookup within) term in + execute plan + | None, None -> Error (Error.not_a_plan (Protocols.Handle.to_string program)) method protocols : Protocols.Handle.protocol list = [Protocols.Evaluator.make self] end -- cgit v1.2.3