Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31425/compiler/algebra/opt
Modified Files:
Tag: xquery-decomposition
opt_algebra_cse.c opt_complex.c opt_const.c opt_dom.c
opt_general.brg opt_guide.c opt_icol.c opt_join_graph.c
opt_join_pd.c opt_key.c opt_mvd.c opt_reqval.c opt_set.c
opt_thetajoin.c
Log Message:
propagated changes of Monday Feb 11 2008 - Saturday Feb 16 2008
from the development trunk to the xquery-decomposition branch
Index: opt_algebra_cse.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_algebra_cse.c,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -u -d -r1.11.2.1 -r1.11.2.2
--- opt_algebra_cse.c 8 Feb 2008 22:59:15 -0000 1.11.2.1
+++ opt_algebra_cse.c 16 Feb 2008 01:02:09 -0000 1.11.2.2
@@ -49,14 +49,8 @@
#include <string.h> /* strcmp */
#include <stdio.h>
-/*
- * Easily access subtree-parts.
- */
-
-/* starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/* starting from p, make a right step */
-#define R(p) ((p)->child[1])
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
/* prune already checked nodes */
#define SEEN(p) ((p)->bit_dag)
@@ -674,68 +668,6 @@
}
/**
- * Check the equivalence of two atoms.
- */
-static bool
-atom_eq (PFalg_atom_t a, PFalg_atom_t b)
-{
- if (a.type != b.type)
- return false;
-
- switch (a.type) {
- /* if type is nat, compare nat member of union */
- case aat_nat:
- if (a.val.nat_ == b.val.nat_)
- return true;
- break;
- /* if type is int, compare int member of union */
- case aat_int:
- if (a.val.int_ == b.val.int_)
- return true;
- break;
- /* if type is str, compare str member of union */
- case aat_uA:
- case aat_str:
- if (!strcmp (a.val.str,
- b.val.str))
- return true;
- break;
- /* if type is float, compare float member of union */
- case aat_dec:
- if (a.val.dec_ == b.val.dec_)
- return true;
- break;
- /* if type is double, compare double member of union */
- case aat_dbl:
- if (a.val.dbl == b.val.dbl)
- return true;
- break;
- /* if type is boolean, compare double member of union */
- case aat_bln:
- if ((a.val.bln &&
- b.val.bln) ||
- (!a.val.bln
- && !b.val.bln))
- return true;
- break;
- case aat_qname:
- if (!PFqname_eq (a.val.qname, b.val.qname))
- return true;
- break;
- /* anything else is actually bogus (e.g. there are no
- * literal nodes */
- default:
- {
- PFinfo (OOPS_WARNING, "literal value that do not make sense");
- return true;
- } break;
- }
-
- /* if you get there every test failed */
- return false;
-}
-
-/**
* Test the equality of two literal table tuples.
*
* @param a Tuple to test against tuple @a b.
@@ -755,7 +687,7 @@
for (i = 0; i < a.count; i++) {
/* check the equivalence */
- mismatch = atom_eq (a.atoms[i], b.atoms[i])?false:true;
+ mismatch = PFalg_atom_cmp (a.atoms[i], b.atoms[i])?true:false;
if (mismatch)
break;
@@ -892,8 +824,7 @@
b->sem.attach.value))
return false;
- if (!atom_eq (a->sem.attach.value,
- b->sem.attach.value))
+ if (PFalg_atom_cmp (a->sem.attach.value, b->sem.attach.value) != 0)
return false;
return true;
@@ -1281,7 +1212,8 @@
/* check every item of the column */
for (i = 0; i < littbl1->sem.lit_tbl.count; i++) {
- if (!atom_eq (a[i].atoms[col1], b[i].atoms[col2]))
+ if (!PFalg_atom_comparable (a[i].atoms[col1], b[i].atoms[col2]) ||
+ PFalg_atom_cmp (a[i].atoms[col1], b[i].atoms[col2]) != 0)
return false;
}
return true;
Index: opt_join_pd.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_join_pd.c,v
retrieving revision 1.37.2.1
retrieving revision 1.37.2.2
diff -u -d -r1.37.2.1 -r1.37.2.2
--- opt_join_pd.c 8 Feb 2008 22:59:15 -0000 1.37.2.1
+++ opt_join_pd.c 16 Feb 2008 01:02:10 -0000 1.37.2.2
@@ -82,21 +82,8 @@
/* mnemonic algebra constructors */
#include "logical_mnemonic.h"
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-/** starting from p, make two steps left */
-#define LL(p) L(L(p))
-/** starting from p, make a step left, then a step right */
-#define LR(p) R(L(p))
-/** starting from p, make a step right, then a step left */
-#define RL(p) L(R(p))
-/** starting from p, make two steps right */
-#define RR(p) R(R(p))
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
#define LEFT(p) ((p)->bit_in)
Index: opt_icol.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_icol.c,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -d -r1.20.2.1 -r1.20.2.2
--- opt_icol.c 8 Feb 2008 22:59:15 -0000 1.20.2.1
+++ opt_icol.c 16 Feb 2008 01:02:09 -0000 1.20.2.2
@@ -43,20 +43,8 @@
#include "alg_dag.h"
#include "mem.h" /* PFmalloc() */
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-/** starting from p, make two steps left */
-#define LL(p) L(L(p))
-/** and so on... */
-#define RL(p) L(R(p))
-#define LRL(p) L(R(L(p)))
-#define LLL(p) L(L(L(p)))
-#define LLR(p) R(L(L(p)))
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
Index: opt_reqval.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_reqval.c,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.2
diff -u -d -r1.12.2.1 -r1.12.2.2
--- opt_reqval.c 17 Jan 2008 08:36:37 -0000 1.12.2.1
+++ opt_reqval.c 16 Feb 2008 01:02:10 -0000 1.12.2.2
@@ -43,17 +43,8 @@
#include "alg_dag.h"
#include "mem.h" /* PFmalloc() */
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-#define LL(p) (L(L(p)))
-#define RL(p) (L(R(p)))
-#define LR(p) (R(L(p)))
-#define RR(p) (R(R(p)))
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
/* worker for PFalgopt_reqval */
static void
Index: opt_guide.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_guide.c,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- opt_guide.c 11 Jan 2008 10:46:58 -0000 1.12
+++ opt_guide.c 16 Feb 2008 01:02:09 -0000 1.12.2.1
@@ -41,20 +41,14 @@
#include "properties.h"
#include "alg_dag.h"
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
+
#define SEEN(n) ((n)->bit_dag)
/* prop of n */
#define PROP(n) ((n)->prop)
/* axis of n, n must be a step */
#define AXIS(n) ((n)->sem.step.axis)
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-/** starting from p, make two steps right */
-#define RR(p) (((p)->child[1])->child[1])
/* Merge 2 guide_steps if it is possible */
static void
Index: opt_const.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_const.c,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -d -r1.28 -r1.28.2.1
--- opt_const.c 11 Jan 2008 10:46:57 -0000 1.28
+++ opt_const.c 16 Feb 2008 01:02:09 -0000 1.28.2.1
@@ -43,13 +43,8 @@
#include "alg_dag.h"
#include "mem.h" /* PFmalloc() */
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
Index: opt_set.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_set.c,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -d -r1.8 -r1.8.2.1
--- opt_set.c 11 Jan 2008 10:46:58 -0000 1.8
+++ opt_set.c 16 Feb 2008 01:02:10 -0000 1.8.2.1
@@ -43,18 +43,8 @@
#include "alg_dag.h"
#include "mem.h" /* PFmalloc() */
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-/** and so on ... */
-#define LL(p) (L(L(p)))
-#define LR(p) (R(L(p)))
-#define RL(p) (L(R(p)))
-#define RR(p) (R(R(p)))
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
Index: opt_general.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_general.brg,v
retrieving revision 1.45.2.1
retrieving revision 1.45.2.2
diff -u -d -r1.45.2.1 -r1.45.2.2
--- opt_general.brg 8 Feb 2008 22:59:15 -0000 1.45.2.1
+++ opt_general.brg 16 Feb 2008 01:02:09 -0000 1.45.2.2
@@ -44,6 +44,9 @@
#include "mem.h" /* PFmalloc() */
#include "subtyping.h"
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
+
/*
* Accessors for the burg matcher
*/
@@ -335,22 +338,6 @@
#include "algebra_mnemonic.h"
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) (LEFT_CHILD(p))
-/** starting from p, make a step right */
-#define R(p) (RIGHT_CHILD(p))
-/** starting from p, make two steps left */
-#define LL(p) L(L(p))
-/** starting from p, make two steps right */
-#define RR(p) R(R(p))
-/** and so on... */
-#define RL(p) (L(R(p)))
-#define LLL(p) (LL(L(p)))
-#define RLL(p) (LL(R(p)))
-
#define MAX_KIDS 10
#define SEEN(p) ((p)->bit_dag)
Index: opt_complex.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_complex.c,v
retrieving revision 1.37.2.3
retrieving revision 1.37.2.4
diff -u -d -r1.37.2.3 -r1.37.2.4
--- opt_complex.c 8 Feb 2008 22:59:15 -0000 1.37.2.3
+++ opt_complex.c 16 Feb 2008 01:02:09 -0000 1.37.2.4
@@ -43,21 +43,8 @@
#include "alg_dag.h"
#include "mem.h" /* PFmalloc() */
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-#define LL(p) (L(L(p)))
-#define RL(p) (L(R(p)))
-#define LR(p) (R(L(p)))
-#define LLL(p) (LL(L(p)))
-#define LLR(p) (R(LL(p)))
-#define LRL(p) (L(LR(p)))
-#define LRLL(p) (LL(LR(p)))
-#define LLRL(p) (RL(LL(p)))
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
Index: opt_thetajoin.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_thetajoin.c,v
retrieving revision 1.14.2.2
retrieving revision 1.14.2.3
diff -u -d -r1.14.2.2 -r1.14.2.3
--- opt_thetajoin.c 8 Feb 2008 22:59:15 -0000 1.14.2.2
+++ opt_thetajoin.c 16 Feb 2008 01:02:10 -0000 1.14.2.3
@@ -61,26 +61,8 @@
/* mnemonic algebra constructors */
#include "logical_mnemonic.h"
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-/** starting from p, make two steps left */
-#define LL(p) L(L(p))
-/** starting from p, make a step left, then a step right */
-#define LR(p) R(L(p))
-/** starting from p, make a step right, then a step left */
-#define RL(p) L(R(p))
-/** starting from p, make two steps right */
-#define RR(p) R(R(p))
-/** and so on ... */
-#define LLL(p) L(L(L(p)))
-#define LRL(p) L(R(L(p)))
-#define RLL(p) L(L(R(p)))
-#define RRL(p) L(R(R(p)))
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
Index: opt_mvd.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_mvd.c,v
retrieving revision 1.32.2.1
retrieving revision 1.32.2.2
diff -u -d -r1.32.2.1 -r1.32.2.2
--- opt_mvd.c 8 Feb 2008 22:59:15 -0000 1.32.2.1
+++ opt_mvd.c 16 Feb 2008 01:02:10 -0000 1.32.2.2
@@ -56,26 +56,8 @@
/* mnemonic algebra constructors */
#include "logical_mnemonic.h"
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-/** starting from p, make two steps left */
-#define LL(p) L(L(p))
-/** starting from p, make a step left, then a step right */
-#define LR(p) R(L(p))
-/** starting from p, make a step right, then a step left */
-#define RL(p) L(R(p))
-/** starting from p, make two steps right */
-#define RR(p) R(R(p))
-/** and so on ... */
-#define LLL(p) L(L(L(p)))
-#define LRL(p) L(R(L(p)))
-#define RLL(p) L(L(R(p)))
-#define RRL(p) L(R(R(p)))
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
Index: opt_dom.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_dom.c,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -d -r1.10 -r1.10.2.1
--- opt_dom.c 11 Jan 2008 10:46:57 -0000 1.10
+++ opt_dom.c 16 Feb 2008 01:02:09 -0000 1.10.2.1
@@ -43,13 +43,8 @@
#include "alg_dag.h"
#include "mem.h" /* PFmalloc() */
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
Index: opt_join_graph.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_join_graph.c,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -d -r1.9.2.1 -r1.9.2.2
--- opt_join_graph.c 8 Feb 2008 22:59:15 -0000 1.9.2.1
+++ opt_join_graph.c 16 Feb 2008 01:02:10 -0000 1.9.2.2
@@ -49,16 +49,8 @@
#include "alg_dag.h"
#include "mem.h" /* PFmalloc() */
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
-#define LL(p) (L(L(p)))
-#define RL(p) (L(R(p)))
-#define LR(p) (R(L(p)))
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
Index: opt_key.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_key.c,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -d -r1.18 -r1.18.2.1
--- opt_key.c 11 Jan 2008 10:46:58 -0000 1.18
+++ opt_key.c 16 Feb 2008 01:02:10 -0000 1.18.2.1
@@ -43,13 +43,8 @@
#include "alg_dag.h"
#include "mem.h" /* PFmalloc() */
-/*
- * Easily access subtree-parts.
- */
-/** starting from p, make a step left */
-#define L(p) ((p)->child[0])
-/** starting from p, make a step right */
-#define R(p) ((p)->child[1])
+/* Easily access subtree-parts */
+#include "child_mnemonic.h"
#define SEEN(p) ((p)->bit_dag)
-------------------------------------------------------------------------
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