aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/mono_env.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-01-15 14:53:13 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-01-15 14:53:13 -0500
commit5ec949e910342f6212c85c8df75283d091817408 (patch)
treef006a9c9104c45938d59a3ee34e251ada814e5e1 /src/mono_env.sml
parente3ce087d0a3473e3905556c226d6c5bbb2bc9a39 (diff)
Allow subqueries to reference aggregate-only columns of free tables; treat non-COUNT aggregate functions as possibly returning NULL
Diffstat (limited to 'src/mono_env.sml')
-rw-r--r--src/mono_env.sml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mono_env.sml b/src/mono_env.sml
index 1df38db3..7f9a6e62 100644
--- a/src/mono_env.sml
+++ b/src/mono_env.sml
@@ -85,6 +85,19 @@ val liftExpInExp =
bind = fn (bound, U.Exp.RelE _) => bound + 1
| (bound, _) => bound}
+val subExpInExp =
+ U.Exp.mapB {typ = fn t => t,
+ exp = fn (xn, rep) => fn e =>
+ case e of
+ ERel xn' =>
+ (case Int.compare (xn', xn) of
+ EQUAL => #1 rep
+ | GREATER=> ERel (xn' - 1)
+ | LESS => e)
+ | _ => e,
+ bind = fn ((xn, rep), U.Exp.RelE _) => (xn+1, liftExpInExp 0 rep)
+ | (ctx, _) => ctx}
+
fun pushERel (env : env) x t eo =
{datatypes = #datatypes env,
constructors = #constructors env,