aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-10-12 12:00:45 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-10-12 12:00:45 -0300
commit7689433baac01b6e9f3d7f91bec0ec1b89f15104 (patch)
tree7b02425e8fd390d7b02efa7e837a61028d1abbe9
parentad33454a204aa5791445e7d15f02ba0447fff85e (diff)
downloadRNT-7689433baac01b6e9f3d7f91bec0ec1b89f15104.tar.gz
RNT-7689433baac01b6e9f3d7f91bec0ec1b89f15104.zip
temporary handle instead of type description everywhere
-rw-r--r--lib/evaluators/FOL.ml2
-rw-r--r--lib/kernel/EphemeralRelation.ml9
-rw-r--r--test/unit/evaluators/FOL.ml4
-rw-r--r--test/unit/kernel/Branch.ml2
-rw-r--r--test/unit/kernel/EphemeralRelation.ml2
5 files changed, 11 insertions, 8 deletions
diff --git a/lib/evaluators/FOL.ml b/lib/evaluators/FOL.ml
index 050e528..d5518ae 100644
--- a/lib/evaluators/FOL.ml
+++ b/lib/evaluators/FOL.ml
@@ -153,7 +153,7 @@ let derive ?decide relation description modes enumerate =
Kernel.EphemeralRelation.instantiate ~inputs:[relation] ?decide
~modes:(fun () -> Ok modes)
description
- {Kernel.EphemeralRelation.name= None; schematics= `Temporary description; pointer= None}
+ (Kernel.EphemeralRelation.temporary description)
(fun () -> enumerate relation)
let rec execute plan =
diff --git a/lib/kernel/EphemeralRelation.ml b/lib/kernel/EphemeralRelation.ml
index 250aacc..3e955ba 100644
--- a/lib/kernel/EphemeralRelation.ml
+++ b/lib/kernel/EphemeralRelation.ml
@@ -63,6 +63,8 @@ let persisted = function
Some {Persisted.name; schematics; pointer}
| _ -> None
+let temporary description = {name= None; schematics= `Temporary description; pointer= None}
+
class ephemeral_relation ?program ?decide description value modes enumerate inputs =
object (self)
inherit Lifecycle.counted
@@ -111,7 +113,7 @@ let instantiate ?(inputs = []) ?program ?decide ~modes description value enumera
let literal description tuples =
instantiate description
~modes:(fun () -> Ok [Concepts.(Mode.mode [] (Cardinality.bounded (List.length tuples)))])
- {name= None; schematics= `Temporary description; pointer= None}
+ (temporary description)
(fun () -> Ok (Generator.cursor_of (fun ~yield -> List.iter yield tuples; Ok ())))
type binding = {root: Protocols.Handle.t; within: Protocols.Handle.t}
@@ -153,8 +155,9 @@ let generated ?program ?within name description value =
description value (invoking enumerate_owned)
let of_program ?within description program =
- generated ~program ?within (Protocols.Handle.to_string program) description
- {name= None; schematics= `Temporary description; pointer= None}
+ generated ~program ?within
+ (Protocols.Handle.to_string program)
+ description (temporary description)
module Make (S : Abstract.Storage.STORAGE) = struct
module SI = Storage.Make (S)
diff --git a/test/unit/evaluators/FOL.ml b/test/unit/evaluators/FOL.ml
index 1782b2e..0deb71d 100644
--- a/test/unit/evaluators/FOL.ml
+++ b/test/unit/evaluators/FOL.ml
@@ -214,7 +214,7 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) =
in
Kernel.EphemeralRelation.instantiate description
~modes:(fun () -> Ok [Concepts.(Mode.mode [] Cardinality.Countable)])
- {Kernel.EphemeralRelation.name= None; schematics= `Temporary description; pointer= None}
+ (Kernel.EphemeralRelation.temporary description)
(fun () -> Ok (Kernel.Generator.cursor_of ~finally:(fun () -> closed := true) (count 0)))
let values source = Rnt.Evaluators.FOL.(execute (Project (Base source, BatFingerTree.singleton "value")))
@@ -268,7 +268,7 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) =
let relation =
Kernel.EphemeralRelation.instantiate ~inputs:[tracker] heading
~modes:(fun () -> Ok [])
- {Kernel.EphemeralRelation.name= None; schematics= `Temporary heading; pointer= None}
+ (Kernel.EphemeralRelation.temporary heading)
(fun () -> Ok (Kernel.Generator.cursor_of (fun ~yield:_ -> Ok ())))
in
let result = Rnt.Evaluators.FOL.(execute (Base relation)) |> Helpers.condition_as_failure in
diff --git a/test/unit/kernel/Branch.ml b/test/unit/kernel/Branch.ml
index 606d8b7..d92a6d7 100644
--- a/test/unit/kernel/Branch.ml
+++ b/test/unit/kernel/Branch.ml
@@ -114,7 +114,7 @@ type K.Program.kind += Title of string | Endless | Shout of K.Path.t
let endless () =
K.EphemeralRelation.instantiate title
~modes:(fun () -> Ok [C.(Mode.mode [] Cardinality.Countable)])
- {K.EphemeralRelation.name= None; schematics= `Temporary title; pointer= None}
+ (K.EphemeralRelation.temporary title)
(fun () ->
Ok
(K.Generator.cursor_of (fun ~yield ->
diff --git a/test/unit/kernel/EphemeralRelation.ml b/test/unit/kernel/EphemeralRelation.ml
index 1e9aa2f..151f8fc 100644
--- a/test/unit/kernel/EphemeralRelation.ml
+++ b/test/unit/kernel/EphemeralRelation.ml
@@ -12,7 +12,7 @@ let description =
{ Protocols.Schematics.domain= "integer";
provenance= [{Protocols.Schematics.source= ["example"]; attribute= "value"}] }
-let temporary = {Ephemeral.name= None; schematics= `Temporary description; pointer= None}
+let temporary = Ephemeral.temporary description
let over ?inputs ?(value = temporary) members =
Ephemeral.instantiate ?inputs description value