diff --git a/lib/compiler.ml b/lib/compiler.ml index be4c443..f89d995 100644 --- a/lib/compiler.ml +++ b/lib/compiler.ml @@ -88,7 +88,6 @@ let compile (env : Env.t) (pred : Pred.t) (exp : Exp.t) : Graph.t * Det_exp.t = let fvs = Set.union (Det_exp.fv de1) (Pred.fv pred) in if not @@ Set.is_empty (Det_exp.fv de2) then raise Not_closed_observation; - let g' = { vertices = [ v ]; diff --git a/lib/compiler.mli b/lib/compiler.mli deleted file mode 100644 index f25fefe..0000000 --- a/lib/compiler.mli +++ /dev/null @@ -1,8 +0,0 @@ -val gen_sym : unit -> string -val gen_vertex : unit -> string -val sub : Program.Exp.t -> string -> Program.Det_exp.t -> Program.Exp.t -val gather_functions : Program.program -> Env.t - -exception Not_closed_observation - -val compile : Env.t -> Pred.t -> Program.Exp.t -> Graph.t * Program.Det_exp.t diff --git a/lib/dist.mli b/lib/dist.mli deleted file mode 100644 index 027a179..0000000 --- a/lib/dist.mli +++ /dev/null @@ -1,22 +0,0 @@ -type t - -val t_of_sexp : Sexplib0.Sexp.t -> t -val sexp_of_t : t -> Sexplib0.Sexp.t - -type one = One - -val one_of_sexp : Sexplib0.Sexp.t -> one -val sexp_of_one : one -> Sexplib0.Sexp.t - -type exp = - | If_de of Program.Det_exp.t * exp * exp - | If_pred of Pred.t * exp * one - | Dist_obj of { dist : t; var : string; args : Program.Det_exp.t list } - -val exp_of_sexp : Sexplib0.Sexp.t -> exp -val sexp_of_exp : exp -> Sexplib0.Sexp.t - -exception Score_invalid_arguments - -val prim_to_dist : string -> t -val score : Program.Det_exp.t -> string -> exp diff --git a/lib/env.mli b/lib/env.mli deleted file mode 100644 index c535c99..0000000 --- a/lib/env.mli +++ /dev/null @@ -1,11 +0,0 @@ -type t = Program.fn Base.Map.M(Program.Id).t - -val empty : t - -val add_exn : - t -> - name:string -> - fn:Program.fn -> - (string, Program.fn, Base.String.comparator_witness) Base.Map.t - -val find : t -> name:string -> Program.fn option diff --git a/lib/graph.mli b/lib/graph.mli deleted file mode 100644 index f961ecb..0000000 --- a/lib/graph.mli +++ /dev/null @@ -1,33 +0,0 @@ -type vertex = string - -val vertex_of_sexp : Sexplib0.Sexp.t -> vertex -val sexp_of_vertex : vertex -> Sexplib0.Sexp.t - -type arc = vertex * vertex - -val arc_of_sexp : Sexplib0.Sexp.t -> arc -val sexp_of_arc : arc -> Sexplib0.Sexp.t - -type det_map = Dist.exp Base.Map.M(Program.Id).t - -val det_map_of_sexp : Sexplib0.Sexp.t -> det_map -val sexp_of_det_map : det_map -> Sexplib0.Sexp.t - -type obs_map = Program.Det_exp.t Base.Map.M(Program.Id).t - -val obs_map_of_sexp : Sexplib0.Sexp.t -> obs_map -val sexp_of_obs_map : obs_map -> Sexplib0.Sexp.t - -type t = { - vertices : vertex list; - arcs : arc list; - det_map : det_map; - obs_map : obs_map; -} - -val t_of_sexp : Sexplib0.Sexp.t -> t -val sexp_of_t : t -> Sexplib0.Sexp.t -val empty : t -val union : t -> t -> t -val pp : t -> string -val ( @+ ) : t -> t -> t diff --git a/lib/pred.mli b/lib/pred.mli deleted file mode 100644 index d666163..0000000 --- a/lib/pred.mli +++ /dev/null @@ -1,8 +0,0 @@ -type t = - | Empty - | And of Program.Det_exp.t * t - | And_not of Program.Det_exp.t * t - -val t_of_sexp : Sexplib0.Sexp.t -> t -val sexp_of_t : t -> Sexplib0.Sexp.t -val fv : t -> Base.Set.M(Program.Id).t diff --git a/lib/program.mli b/lib/program.mli deleted file mode 100644 index b038f0d..0000000 --- a/lib/program.mli +++ /dev/null @@ -1,79 +0,0 @@ -module Id = Core.String - -module Exp : sig - type t = - | Int of int - | Real of float - | Var of string - | Add of t * t - | Radd of t * t - | Minus of t * t - | Rminus of t * t - | Neg of t - | Rneg of t - | Mult of t * t - | Rmult of t * t - | Div of t * t - | Rdiv of t * t - | Eq of t * t - | Noteq of t * t - | Less of t * t - | And of t * t - | Or of t * t - | Seq of t * t - | Not of t - | List of t list - | Record of (t * t) list - | Assign of string * t * t - | If of t * t * t - | Call of string * t list - | Sample of t - | Observe of t * t - - val t_of_sexp : Sexplib0.Sexp.t -> t - val sexp_of_t : t -> Sexplib0.Sexp.t -end - -type fn = { name : string; params : string list; body : Exp.t } - -val fn_of_sexp : Sexplib0.Sexp.t -> fn -val sexp_of_fn : fn -> Sexplib0.Sexp.t - -type program = { funs : fn list; exp : Exp.t } - -val program_of_sexp : Sexplib0.Sexp.t -> program -val sexp_of_program : program -> Sexplib0.Sexp.t - -module Det_exp : sig - type t = - | Int of int - | Real of float - | Var of string - | Add of t * t - | Radd of t * t - | Minus of t * t - | Rminus of t * t - | Neg of t - | Rneg of t - | Mult of t * t - | Rmult of t * t - | Div of t * t - | Rdiv of t * t - | Eq of t * t - | Noteq of t * t - | Less of t * t - | And of t * t - | Or of t * t - | Not of t - | List of t list - | Record of (t * t) list - | If of t * t * t - | Prim_call of string * t list - - val t_of_sexp : Sexplib0.Sexp.t -> t - val sexp_of_t : t -> Sexplib0.Sexp.t - val to_exp : t -> Exp.t - val fv : t -> (string, Id.comparator_witness) Base.Set.t -end - -val pp : program -> unit