package OCanren

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Useful functions to test running relational queries

Helper functions to provide names for top-level variables

val wrap : ('a -> 'b -> < is_open : bool.. > as 'c -> 'd) -> ('a -> 'b -> 'c -> 'd) -> 'a -> ('b * 'c) -> 'd
val qh : (int -> string -> < is_open : bool.. > as 'a -> unit) -> (int -> string -> 'a -> unit) -> 'a -> unit -> unit
val qrh : (int -> string -> < is_open : bool.. > as 'a -> unit) -> (int -> string -> 'a -> unit) -> 'a -> 'a -> unit -> unit
val qrsh : (int -> string -> < is_open : bool.. > as 'a -> unit) -> (int -> string -> 'a -> unit) -> 'a -> 'a -> 'a -> unit -> unit
val qrsth : (int -> string -> < is_open : bool.. > as 'a -> unit) -> (int -> string -> 'a -> unit) -> 'a -> 'a -> 'a -> 'a -> unit -> unit
val make_title : int -> string -> unit
exception NoMoreAnswers
val run_gen : 'a -> 'b -> int -> (unit -> ('c -> OCanren.State.t -> 'd) * ('e -> OCanren.Env.t -> 'f) * ('d -> 'e * OCanren.State.t OCanren.Stream.t) * ('g -> 'f -> unit -> 'h)) -> ('a -> 'b -> 'g) -> (string * 'c) -> unit
val run_exn : ('a -> string) -> int -> (unit -> ('b -> OCanren.State.t -> 'c) * ('d -> OCanren.Env.t -> 'e) * ('c -> 'd * OCanren.State.t OCanren.Stream.t) * ('f -> 'e -> unit -> 'g)) -> ((int -> string -> < prj : 'a.. > -> unit) -> ('h -> 'i -> 'j -> 'k) -> 'f) -> (string * 'b) -> unit

run_exn printer n name_helper goal prints answers supposing there are no free variables there (i.e. reification is not required)

val runR : 'a -> ('b -> string) -> ('c -> string) -> int -> (unit -> ('d -> OCanren.State.t -> 'e) * ('f -> OCanren.Env.t -> 'g) * ('e -> 'f * OCanren.State.t OCanren.Stream.t) * ('h -> 'g -> unit -> 'i)) -> ((int -> string -> < prj : 'b.. > -> unit) -> (int -> string -> < reify : 'a -> 'c.. > -> unit) -> 'h) -> (string * 'd) -> unit

runR reifier print_plain print_injected n name_helper goal prints answers both with free varibles and without them. In the first cases it uses print_plain as printer fuction. In the latter case it does reification using reifier and prints the result wit print_ibjected

val run_prjc : 'a -> ('b -> string) -> int -> (unit -> ('c -> OCanren.State.t -> 'd) * ('e -> OCanren.Env.t -> 'f) * ('d -> 'e * OCanren.State.t OCanren.Stream.t) * ('g -> 'f -> unit -> 'h)) -> ((int -> string -> < prj : 'b.. > -> unit) -> (int -> string -> < prjc : 'a -> 'b.. > -> unit) -> 'g) -> (string * 'c) -> unit
OCaml

Innovation. Community. Security.