aboutsummaryrefslogtreecommitdiffstats
path: root/lib/algebra.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-06-23 23:53:26 -0300
committerGitHub <noreply@github.com>2026-06-23 23:53:26 -0300
commitc284fcd570342c31bc21169960579a20a763e32e (patch)
treece7485055116d794c55090ad0978e0b3f5ff4c2a /lib/algebra.ml
parentb81586ee4a0543a5f9866586c78dccdd6328934a (diff)
downloadSakura-c284fcd570342c31bc21169960579a20a763e32e.tar.gz
Sakura-c284fcd570342c31bc21169960579a20a763e32e.zip
Format
Diffstat (limited to '')
-rw-r--r--lib/algebra.ml20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/algebra.ml b/lib/algebra.ml
index 9c620ee..5416f65 100644
--- a/lib/algebra.ml
+++ b/lib/algebra.ml
@@ -10,26 +10,22 @@ type error = UnsupportedOperator of string
REPL exploration; it does not go through the VM.
TODO: materialise const tuples into InMemoryBackend and SCAN them so they
can participate in VM JOINs. *)
-let const_relation (pairs : (string * Conventions.AbstractValue.t) list) :
- Relation.ephemeral =
+let const_relation (pairs : (string * Conventions.AbstractValue.t) list) : Relation.ephemeral =
let make_gen () =
let attrs =
List.fold_left
- (fun acc (k, v) -> Tuple.AttributeMap.add k { Attribute.value = v } acc)
+ (fun acc (k, v) -> Tuple.AttributeMap.add k {Attribute.value= v} acc)
Tuple.AttributeMap.empty pairs
in
- let tuple =
- Tuple.Materialized { Tuple.relation = "const"; attributes = attrs }
- in
+ let tuple = Tuple.Materialized {Tuple.relation= "const"; attributes= attrs} in
let gen = function
| None | Some 0 -> Generator.Value (tuple, fun _ -> Generator.Done)
- | _ -> Generator.Done
+ | _ -> Generator.Done
in
gen
in
- let schema = List.map (fun (k, _) -> (k, "abstract")) pairs in
- new Relation.ephemeral ~name:"const" ~schema ~constraints:None
- ~cardinality:(Conventions.Cardinality.Finite 1)
+ let schema = List.map (fun (k, _) -> k, "abstract") pairs in
+ new Relation.ephemeral
+ ~name:"const" ~schema ~constraints:None ~cardinality:(Conventions.Cardinality.Finite 1)
~membership_criteria:(fun _ -> true)
- ~lineage:None ~provenance:None
- ~generator:(make_gen ())
+ ~lineage:None ~provenance:None ~generator:(make_gen ())