Normalize query expressions into ANF

This commit is contained in:
milner committed 2017-03-03 15:09:00 +00:00
1 parent c0dc550578
commit 780136e802
5 files changed
+406 -3

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
type atom =
| AInt of int
| ABool of bool
| AString of string
| AUnit
| AVar of Ident.t
type expr = {
a : desc;
aty : Types.t;
aspan : Location.span;
}
and desc =
| AAtom of atom
| ALet of Ident.t * expr * expr
| ABinop of Syntax.binop * atom * atom
| AIf of atom * expr * expr
| ATuple of atom list
| ARecord of string * (string * atom) list
| AField of atom * string
| AApp of Ident.t * atom
| ALambda of Ident.t * expr
| AFilter of atom * Ident.t * expr
| AMap of atom * Ident.t * expr
| ASum of atom
| ACount of atom
type program = {
ap_input : Ident.t;
ap_input_element : Types.t;
ap_query : Ident.t;
ap_query_body : expr;
ap_helpers : (Ident.t * Types.scheme * expr) list;
}
val reset : unit -> unit
val program : Typed.program -> program
val to_string : expr -> string
val atom_to_string : atom -> string
val program_to_string : program -> string
val validate : Ident.t list -> expr -> unit