aboutsummaryrefslogtreecommitdiffstats
path: root/lib/evaluators/FOL.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-09-17 02:20:53 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-09-17 02:20:53 +0000
commit272ac23caa835faede38156699b40f884ad2ed11 (patch)
tree894ad3517b4ba8e331712bc0d6af50fa5ae24263 /lib/evaluators/FOL.ml
parentccfb6d58dc469a8f8a7e2e09bd520aea71f8cbf3 (diff)
downloadRNT-272ac23caa835faede38156699b40f884ad2ed11.tar.gz
RNT-272ac23caa835faede38156699b40f884ad2ed11.zip
Use handles as reference points
Diffstat (limited to 'lib/evaluators/FOL.ml')
-rw-r--r--lib/evaluators/FOL.ml26
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/evaluators/FOL.ml b/lib/evaluators/FOL.ml
index 70cf9de..257ea86 100644
--- a/lib/evaluators/FOL.ml
+++ b/lib/evaluators/FOL.ml
@@ -9,25 +9,23 @@ module Error = struct
condition "evaluation-cancelled" "An evaluation was stopped before it produced its result" empty
end
-type plan = Base of string
+type plan = Base of Protocols.Handle.t
+ | Project of plan * string BatFingerTree.t
module Program = Protocols.Program.Make (struct
type t = plan
end)
-let execute context = function
- | Base name ->
- let open Utilities.Result in
- match context.Protocols.Context.status () with
- | `Cancelled | `Exhausted -> Error (Error.cancelled ())
- | `Live ->
- let* found = Runtime.Context.resolve context name in
- let* handle = Option.to_result ~none:(Error.unknown_relation name) found in
- Fun.protect
- ~finally:(fun () -> Protocols.Handle.release handle)
- (fun () ->
- let* enumerable = Protocols.Enumerable.require handle in
- Protocols.Enumerable.enumerate enumerable context)
+let execute context =
+ let open Utilities.Result in
+ function
+ | Base relation_handle ->
+ Fun.protect
+ ~finally:(fun () -> Protocols.Handle.release relation_handle)
+ (fun () ->
+ let* enumerable = Protocols.Enumerable.require relation_handle in
+ Protocols.Enumerable.enumerate enumerable context)
+ | Project (_plan, _attributes) -> failwith "TODO"
class evaluator = object (self)
inherit Kernel.Lifecycle.null