Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory 
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20105/compiler/algebra/opt

Modified Files:
      Tag: PF_ROX
        opt_const.c opt_reqval.c 
Log Message:
propagated changes of Monday May 19 2008 - Thursday May 22 2008
from the development trunk to the PF_ROX branch



U opt_reqval.c
Index: opt_reqval.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_reqval.c,v
retrieving revision 1.13.2.2
retrieving revision 1.13.2.3
diff -u -d -r1.13.2.2 -r1.13.2.3
--- opt_reqval.c        17 Apr 2008 14:31:14 -0000      1.13.2.2
+++ opt_reqval.c        22 May 2008 08:48:32 -0000      1.13.2.3
@@ -99,6 +99,7 @@
                 }
 
         if (L(p) && L(p)->kind == la_disjunion &&
+            PFprop_req_bool_val (L(p)->prop, att) &&
             PFprop_const (LL(p)->prop, att) &&
             PFprop_const (LR(p)->prop, att) &&
             (PFprop_const_val (LL(p)->prop, att)).val.bln !=
@@ -110,6 +111,7 @@
         }
 
         if (R(p) && R(p)->kind == la_disjunion &&
+            PFprop_req_bool_val (R(p)->prop, att) &&
             PFprop_const (RL(p)->prop, att) &&
             PFprop_const (RR(p)->prop, att) &&
             (PFprop_const_val (RL(p)->prop, att)).val.bln !=

U opt_const.c
Index: opt_const.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_const.c,v
retrieving revision 1.28.4.2
retrieving revision 1.28.4.3
diff -u -d -r1.28.4.2 -r1.28.4.3
--- opt_const.c 17 Apr 2008 14:31:10 -0000      1.28.4.2
+++ opt_const.c 22 May 2008 08:48:31 -0000      1.28.4.3
@@ -43,6 +43,9 @@
 #include "alg_dag.h"
 #include "mem.h"          /* PFmalloc() */
 
+/** mnemonic algebra constructors */
+#include "logical_mnemonic.h"
+
 /* Easily access subtree-parts */
 #include "child_mnemonic.h"
 
@@ -806,8 +809,40 @@
             }
             break;
 
-        case la_seqty1:
         case la_all:
+            if (p->sem.aggr.part &&
+                PFprop_const_left (p->prop, p->sem.aggr.att)) {
+                PFla_op_t *op, *ret;
+                
+                if (PFprop_const_left (p->prop, p->sem.aggr.part)) {
+                    op = lit_tbl (attlist (p->sem.aggr.part),
+                                  tuple (PFprop_const_val_left (
+                                             p->prop,
+                                             p->sem.aggr.part)));
+                } else {
+                    op = distinct (
+                             project (L(p),
+                                      proj (p->sem.aggr.part,
+                                            p->sem.aggr.part)));
+                }
+
+                ret = add_attach (op, p->sem.aggr.att,
+                                  PFprop_const_val_left (
+                                      p->prop,
+                                      p->sem.aggr.att));
+                *p = *ret;
+                SEEN(p) = true;
+            }
+            else if (PFprop_const_left (p->prop, p->sem.aggr.att)) {
+                PFla_op_t *ret = lit_tbl (attlist (p->sem.aggr.att),
+                                          tuple (PFprop_const_val_left (
+                                                     p->prop,
+                                                     p->sem.aggr.att)));
+                *p = *ret;
+                SEEN(p) = true;
+            }
+            /* fall through */
+        case la_seqty1:
             /* introduce attach if necessary */
             if (PFprop_const_left (p->prop, p->sem.aggr.att)) {
                 L(p) = add_attach (L(p), p->sem.aggr.att,


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to