(*--------------------------------------------------------------------------- Copyright (c) 2026 Thomas Gazagnaire. All rights reserved. SPDX-License-Identifier: ISC ---------------------------------------------------------------------------*) type cmp = Eq | Ne | Lt | Le | Gt | Ge type arith = Add | Sub | Mul | Div | Mod | Band | Bor | Shl | Shr type agg_acc = { step : Catalog.Value.t array -> int -> unit; step_reg : Catalog.Register.t array -> int -> unit; finish : unit -> Catalog.Value.t; } module type REGISTER = sig type affinity val truth : Catalog.Register.t -> bool val compare : Catalog.Register.t -> Catalog.Register.t -> int val compare_with : affinity option -> Catalog.Register.t -> Catalog.Register.t -> int val settles : affinity option -> bool val settle : affinity option -> Catalog.Register.t -> unit val compare_settled : affinity option -> Catalog.Register.t -> Catalog.Register.t -> int val arith : arith -> Catalog.Register.t -> Catalog.Register.t -> Catalog.Register.t -> unit end module type S = sig include REGISTER type collation type op type action val collate : collation -> Catalog.Value.t -> Catalog.Value.t -> int val key : collation -> string -> string val compare_value : cmp -> affinity option -> collation option -> Catalog.Value.t -> Catalog.Value.t -> Catalog.Value.t val is_eq : affinity option -> collation option -> Catalog.Value.t -> Catalog.Value.t -> Catalog.Value.t val in_list : affinity option -> collation option -> Catalog.Value.t -> Catalog.Value.t list -> Catalog.Value.t val and_ : Catalog.Value.t -> Catalog.Value.t -> Catalog.Value.t val or_ : Catalog.Value.t -> Catalog.Value.t -> Catalog.Value.t val not_ : Catalog.Value.t -> Catalog.Value.t val op_calls : op -> bool val deterministic : string -> bool val aggregate : string -> nargs:int -> coll:collation option -> agg_acc end