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

Modified Files:
        prop_icol.c prop_ori_names.c prop_reqval.c prop_set.c 
        prop_trace_names.c 
Log Message:
-- Cleaned up code:
   o The state_label field in the logical algebra is again
     a short and thus aligned with the field child_state_label.
     (This perhaps fixes a 64bit related bug.)
   o The state_label field is not (mis-)used as reference counter anymore.


Index: prop_reqval.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_reqval.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- prop_reqval.c       18 Feb 2008 15:54:42 -0000      1.39
+++ prop_reqval.c       19 Mar 2008 13:27:20 -0000      1.40
@@ -47,7 +47,7 @@
 #define SEEN(p) ((p)->bit_dag)
 
 /* store the number of incoming edges for each operator
-   in the state_label field */
+   in the refctr field */
 #define EDGE(n) ((n)->refctr)
 
 #define empty_list 0

Index: prop_icol.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_icol.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- prop_icol.c 18 Feb 2008 15:54:42 -0000      1.35
+++ prop_icol.c 19 Mar 2008 13:27:19 -0000      1.36
@@ -43,6 +43,9 @@
 /* Easily access subtree-parts */
 #include "child_mnemonic.h"
 
+#define SEEN(n)       (n)->bit_dag
+#define EDGE(n)       (n)->refctr
+
 /**
  * Test if @a attr is in the list of icol columns in container @a prop
  */
@@ -194,7 +197,7 @@
 /**
  * worker for PFprop_infer
  * infers the icols property during the second run
- * (uses edge counter stored in n->state_label from the first run)
+ * (uses edge counter stored in EDGE(n) from the first run)
  */
 static void
 prop_infer_icols (PFla_op_t *n, PFalg_att_t icols)
@@ -210,8 +213,8 @@
 
     /* nothing to do if we haven't collected
        all incoming icols lists of that node */
-    if (n->state_label > 1) {
-        n->state_label--;
+    if (EDGE(n) > 1) {
+        EDGE(n)--;
         return;
     }
 
@@ -815,20 +818,20 @@
 
     /* count number of incoming edges
        (during first run) */
-    n->state_label++;
+    EDGE(n)++;
 
     /* nothing to do if we already visited that node */
-    if (n->bit_dag)
+    if (SEEN(n))
         return;
     /* otherwise initialize edge counter (first occurrence) */
     else
-        n->state_label = 1;
+        EDGE(n) = 1;
 
     /* infer properties for children */
     for (unsigned int i = 0; i < PFLA_OP_MAXCHILD && n->child[i]; i++)
         prop_infer (n->child[i]);
 
-    n->bit_dag = true;
+    SEEN(n) = true;
 
     /* reset icols property */
     n->prop->icols = 0;

Index: prop_ori_names.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_ori_names.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- prop_ori_names.c    17 Mar 2008 17:41:19 -0000      1.31
+++ prop_ori_names.c    19 Mar 2008 13:27:20 -0000      1.32
@@ -60,8 +60,8 @@
 /* initial value for lists that encode free variables */
 #define ALL (~att_NULL)
 /* store the number of incoming edges for each operator
-   in the state_label field */
-#define EDGE(n) ((n)->state_label)
+   in the refctr field */
+#define EDGE(n) ((n)->refctr)
 
 /* worker for PFprop_ori_name* */
 static PFalg_att_t

Index: prop_trace_names.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_trace_names.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- prop_trace_names.c  17 Mar 2008 17:41:20 -0000      1.19
+++ prop_trace_names.c  19 Mar 2008 13:27:21 -0000      1.20
@@ -44,8 +44,8 @@
 #include "child_mnemonic.h"
 
 /* store the number of incoming edges for each operator
-   in the state_label field */
-#define EDGE(n) ((n)->state_label)
+   in the refctr field */
+#define EDGE(n) ((n)->refctr)
 
 #define CUR_AT(n,i) (((name_pair_t *) PFarray_at ((n), (i)))->unq)
 #define ORI_AT(n,i) (((name_pair_t *) PFarray_at ((n), (i)))->ori)

Index: prop_set.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_set.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- prop_set.c  15 Feb 2008 12:15:59 -0000      1.22
+++ prop_set.c  19 Mar 2008 13:27:21 -0000      1.23
@@ -45,6 +45,9 @@
 /* Easily access subtree-parts */
 #include "child_mnemonic.h"
 
+#define SEEN(n)       (n)->bit_dag
+#define EDGE(n)       (n)->refctr
+
 /**
  * Test if an operator referenced via its container @a prop
  * may result a set of tuples instead of a bag of tuples.
@@ -58,7 +61,7 @@
 /**
  * worker for PFprop_infer_set
  * infers the set property during the second run
- * (uses edge counter stored in n->state_label from the first run)
+ * (uses edge counter stored in EDGE(n) from the first run)
  */
 static void
 prop_infer_set (PFla_op_t *n, bool set)
@@ -73,8 +76,8 @@
 
     /* nothing to do if we haven't collected
        all incoming set properties of the parents */
-    if (n->state_label > 1) {
-        n->state_label--;
+    if (EDGE(n) > 1) {
+        EDGE(n)--;
         return;
     }
 
@@ -254,20 +257,20 @@
 
     /* count number of incoming edges
        (during first run) */
-    n->state_label++;
+    EDGE(n)++;
 
     /* nothing to do if we already visited that node */
-    if (n->bit_dag)
+    if (SEEN(n))
         return;
     /* otherwise initialize edge counter (first occurrence) */
     else
-        n->state_label = 1;
+        EDGE(n) = 1;
 
     /* infer properties for children */
     for (unsigned int i = 0; i < PFLA_OP_MAXCHILD && n->child[i]; i++)
         prop_infer (n->child[i]);
 
-    n->bit_dag = true;
+    SEEN(n) = true;
 
     /* reset set property */
     n->prop->set = true;


-------------------------------------------------------------------------
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