comparison src/sql.sig @ 2203:39faa4a037f4

ML half of initial prototype. (Doesn't compile because there's no C yet.)
author Ziv Scully <ziv@mit.edu>
date Tue, 25 Mar 2014 02:04:06 -0400
parents
children 01c8aceac480
comparison
equal deleted inserted replaced
2202:606af2c9b828 2203:39faa4a037f4
1 signature SQL = sig
2
3 val fu : Mono.file -> unit
4
5 val debug : bool ref
6
7 type lvar
8
9 datatype func =
10 DtCon0 of string
11 | DtCon1 of string
12 | UnCon of string
13 | Other of string
14
15 datatype exp =
16 Const of Prim.t
17 | Var of int
18 | Lvar of lvar
19 | Func of func * exp list
20 | Recd of (string * exp) list
21 | Proj of exp * string
22
23 datatype reln =
24 Known
25 | Sql of string
26 | PCon0 of string
27 | PCon1 of string
28 | Eq
29 | Ne
30 | Lt
31 | Le
32 | Gt
33 | Ge
34
35 datatype prop =
36 True
37 | False
38 | Unknown
39 | And of prop * prop
40 | Or of prop * prop
41 | Reln of reln * exp list
42 | Cond of exp * prop
43
44 datatype ('a, 'b) sum = inl of 'a | inr of 'b
45
46 datatype Rel =
47 Exps of exp * exp -> prop
48 | Props of prop * prop -> prop
49
50 datatype sqexp =
51 SqConst of Prim.t
52 | SqTrue
53 | SqFalse
54 | SqNot of sqexp
55 | Field of string * string
56 | Computed of string
57 | Binop of Rel * sqexp * sqexp
58 | SqKnown of sqexp
59 | Inj of Mono.exp
60 | SqFunc of string * sqexp
61 | Unmodeled
62 | Null
63
64 datatype sitem =
65 SqField of string * string
66 | SqExp of sqexp * string
67
68 type query1
69
70 datatype query =
71 Query1 of query1
72 | Union of query * query
73
74 datatype dml =
75 Insert of string * (string * sqexp) list
76 | Delete of string * sqexp
77 | Update of string * (string * sqexp) list * sqexp
78
79 end