Update of /cvsroot/monetdb/pathfinder/compiler/include
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14645/compiler/include

Modified Files:
      Tag: PF_ROX
        Makefile.ag algebra.h algopt.h functions.h logical.h 
        logical_mnemonic.h mil.h mil_mnemonic.h ordering.h physical.h 
        physical_mnemonic.h sql_mnemonic.h string_utils.h subtyping.h 
        xml2lalg.h xml2lalg_converters.h xml2lalg_xpath_utils.h 
Added Files:
      Tag: PF_ROX
        child_mnemonic.h 
Removed Files:
      Tag: PF_ROX
        mildebug.h 
Log Message:
propagated changes of Friday 15 Feb 2008 - Monday Feb 18 2008
from the development trunk to the PF_ROX branch


Index: physical.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/physical.h,v
retrieving revision 1.36.4.1
retrieving revision 1.36.4.2
diff -u -d -r1.36.4.1 -r1.36.4.2
--- physical.h  9 Feb 2008 08:40:32 -0000       1.36.4.1
+++ physical.h  18 Feb 2008 16:57:30 -0000      1.36.4.2
@@ -54,10 +54,6 @@
     , pa_attach         =   4 /**< ColumnAttach */
     , pa_cross          =  10 /**< Cross */
     , pa_leftjoin       =  11 /**< LeftJoin */
-#if 0                        
-    , pa_nljoin         =  12 /**< NestedLoopJoin */
-    , pa_merge_join     =  13 /**< MergeJoin */
-#endif                       
     , pa_eqjoin         =  14 /**< Generic join implementation */
     , pa_semijoin       =  15 /**< Semijoin implementation */
     , pa_thetajoin      =  16 /**< Thetajoin implementation */
@@ -78,16 +74,14 @@
                                    by the values of a single row (cardinality 
                                    stays the same) */
     , pa_eq             =  40 /**< Numeric or String Equality */
-    , pa_eq_atom        =  41 /**< Numeric or String Equality */
     , pa_gt             =  42 /**< Numeric or String GreaterThan */
-    , pa_gt_atom        =  43 /**< Numeric or String GreaterThan */
     , pa_bool_not       =  45 /**< Boolean negation */
     , pa_bool_and       =  46 /**< Boolean and */
     , pa_bool_or        =  47 /**< Boolean or */
-    , pa_bool_and_atom  =  48 /**< Boolean and, where one arg is an atom */
-    , pa_bool_or_atom   =  49 /**< Boolean or, where one arg is an atom */
     , pa_to             =  50 /**< op:to operator */
-    , pa_hash_count     =  55 /**< Hash-based count operator */
+    , pa_count_ext      =  54 /**< Count operator with loop backup
+                                   for empty values*/
+    , pa_count          =  55 /**< Count operator */
     , pa_avg            =  56 /**< Avg operator */
     , pa_max            =  57 /**< Max operator */
     , pa_min            =  58 /**< Min operator */    
@@ -101,17 +95,7 @@
                                    certain type */
     , pa_type_assert    =  64 /**< restriction of the type of a given column */
     , pa_cast           =  65 /**< cast a table to a given type */
-    , pa_llscj_anc      = 100 /**< Loop-Lifted StaircaseJoin Ancestor */
-    , pa_llscj_anc_self = 101 /**< Loop-Lifted StaircaseJoin AncestorOrSelf */
-    , pa_llscj_attr     = 102 /**< Loop-Lifted StaircaseJoin AncestorOrSelf */
-    , pa_llscj_child    = 103 /**< Loop-Lifted StaircaseJoin Child */
-    , pa_llscj_desc     = 104 /**< Loop-Lifted StaircaseJoin Descendant */
-    , pa_llscj_desc_self= 105 /**< Loop-Lifted StaircaseJoin DescendantOrSelf 
*/
-    , pa_llscj_foll     = 106 /**< Loop-Lifted StaircaseJoin Following */
-    , pa_llscj_foll_sibl= 107 /**< Loop-Lifted StaircaseJoin FollowingSibling 
*/
-    , pa_llscj_parent   = 108 /**< Loop-Lifted StaircaseJoin Parent */
-    , pa_llscj_prec     = 109 /**< Loop-Lifted StaircaseJoin Preceding */
-    , pa_llscj_prec_sibl= 110 /**< Loop-Lifted StaircaseJoin PrecedingSibling 
*/
+    , pa_llscjoin       = 100 /**< Loop-Lifted StaircaseJoin */
     , pa_doc_tbl        = 120 /**< Access to persistent document relation */
     , pa_doc_access     = 121 /**< Access to string content of loaded docs */
     , pa_twig           = 122 /**< twig root operator */
@@ -123,12 +107,8 @@
     , pa_comment        = 128 /**< comment-constructing operator */
     , pa_processi       = 129 /**< processing instruction-constr. operator */
     , pa_content        = 130 /**< constructor content operator (elem|doc) */
-    , pa_merge_adjacent = 131
-    , pa_roots          = 132
-    , pa_fragment       = 133
-    , pa_frag_extract   = 134
-    , pa_frag_union     = 135
-    , pa_empty_frag     = 136
+    , pa_slim_content   = 131 /**< shallow constructor content operator */
+    , pa_merge_adjacent = 132
     , pa_error          = 139 /**< error operator */
     , pa_cond_err       = 140 /**< conditional error operator */
     , pa_nil            = 141 /**< end of the list of parameters */
@@ -143,7 +123,6 @@
     , pa_rec_border     = 149 /**< border of the DAG describing the recursion 
*/
     , pa_fun_call       = 150 /**< function application */
     , pa_fun_param      = 151 /**< function application parameter */
-    , pa_fun_frag_param = 152 /**< function application parameter */
     , pa_string_join    = 160 /**< Concatenation of multiple strings */
 };
 /** algebra operator kinds */
@@ -236,15 +215,6 @@
         PFalg_att_t     res;      /**< attribute to hold the result */
     } binary;
 
-    /* semantic content for binary (arithmetic and boolean) operators
-     * where the second argument is an atom (if we know that an
-     * attribute will be constant) */
-    struct {
-        PFalg_att_t     att1;     /**< first operand */
-        PFalg_atom_t    att2;     /**< second operand */
-        PFalg_att_t     res;      /**< attribute to hold the result */
-    } bin_atom;
-
     /**
      * semantic content for unary (numeric or Boolean) operators
      * (e.g. Boolean negation)
@@ -258,6 +228,7 @@
     struct {
         PFalg_att_t         res;  /**< Name of result attribute */
         PFalg_att_t         part; /**< Partitioning attribute */
+        PFalg_att_t         loop; /**< loop attribute */
     } count;
 
     /*
@@ -306,8 +277,7 @@
 
     /** semantic content for staircase join operator */
     struct {
-        PFty_t           ty;      /**< sequence type that describes the
-                                       node test */
+        PFalg_step_spec_t spec;   /**< step specification */
         PFord_ordering_t in;      /**< input ordering */
         PFord_ordering_t out;     /**< output ordering */
         PFalg_att_t      iter;    /**< iter column */
@@ -373,13 +343,6 @@
                                        iter column of the result
                                        (used for optimizations) */
     } fun_call;
-    
-    /* semantic content of the function call fragment paramter and
-       the fragment extraction operator */
-    struct {
-        unsigned int    pos;      /**< position of the referenced column */
-    } col_ref;
-
 };
 /** semantic content in physical algebra operators */
 typedef union PFpa_op_sem_t PFpa_op_sem_t;
@@ -429,8 +392,7 @@
  * A `serialize' node will be placed on the very top of the algebra
  * expression tree.
  */
-PFpa_op_t * PFpa_serialize (const PFpa_op_t *doc, const PFpa_op_t *alg,
-                            PFalg_att_t item);
+PFpa_op_t * PFpa_serialize (const PFpa_op_t *alg, PFalg_att_t item);
 
 /****************************************************************/
 
@@ -455,7 +417,7 @@
     foreach $a in a
       foreach $b in b
         return ($a, $b) .
[EMAIL PROTECTED]
[EMAIL PROTECTED]
  *
  * That is, the left operand is in the *outer* loop.
  */
@@ -596,18 +558,6 @@
                     PFalg_att_t att1, PFalg_att_t att2);
 
 /**
- * Comparison operator eq, where one column is an atom (constant).
- */
-PFpa_op_t *PFpa_eq_atom (const PFpa_op_t *, PFalg_att_t res,
-                         PFalg_att_t att1, PFalg_atom_t att2);
-
-/**
- * Comparison operator gt, where one column is an atom (constant).
- */
-PFpa_op_t *PFpa_gt_atom (const PFpa_op_t *, PFalg_att_t res,
-                         PFalg_att_t att1, PFalg_atom_t att2);
-
-/**
  * Boolean negation
  */
 PFpa_op_t *PFpa_bool_not (const PFpa_op_t *,
@@ -626,30 +576,27 @@
                     PFalg_att_t att1, PFalg_att_t att2);
 
 /**
- * Boolean and, where one column is an atom (constant).
- */
-PFpa_op_t *PFpa_and_atom (const PFpa_op_t *, PFalg_att_t res,
-                          PFalg_att_t att1, PFalg_atom_t att2);
-
-/**
- * Boolean or, where one column is an atom (constant).
- */
-PFpa_op_t *PFpa_or_atom (const PFpa_op_t *, PFalg_att_t res,
-                         PFalg_att_t att1, PFalg_atom_t att2);
-
-/**
  * Constructor for op:to operator
  */
 PFpa_op_t * PFpa_to (const PFpa_op_t *n, PFalg_att_t res,
                      PFalg_att_t att1, PFalg_att_t att2);
 
 /**
- * HashCount: Hash-based Count operator. Does neither benefit from
+ * Count: Count function operator with a loop relation to
+ * correctly fill in missing values. Does neither benefit from
  * any existing ordering, nor does it provide/preserve any input
  * ordering.
  */
-PFpa_op_t *PFpa_hash_count (const PFpa_op_t *,
-                            PFalg_att_t, PFalg_att_t);
+PFpa_op_t *PFpa_count_ext (const PFpa_op_t *, const PFpa_op_t *,
+                           PFalg_att_t, PFalg_att_t, PFalg_att_t);
+
+/**
+ * Count: Count function operator. Does neither benefit from
+ * any existing ordering, nor does it provide/preserve any input
+ * ordering.
+ */
+PFpa_op_t *PFpa_count (const PFpa_op_t *,
+                       PFalg_att_t, PFalg_att_t);
 
 /**
  * Aggr: Aggregation function operator. Does neither benefit from
@@ -695,85 +642,14 @@
 /**
  * StaircaseJoin operator.
  *
- * Input must have iter|item schema, and be sorted on iter.
+ * Input must have iter|item schema
  */
-PFpa_op_t *PFpa_llscj_anc (const PFpa_op_t *frag,
-                           const PFpa_op_t *ctx,
-                           const PFty_t test,
-                           const PFord_ordering_t in,
-                           const PFord_ordering_t out,
-                           PFalg_att_t iter,
-                           PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_anc_self (const PFpa_op_t *frag,
-                                const PFpa_op_t *ctx,
-                                const PFty_t test,
-                                const PFord_ordering_t in,
-                                const PFord_ordering_t out,
-                                PFalg_att_t iter,
-                                PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_attr (const PFpa_op_t *frag,
-                            const PFpa_op_t *ctx,
-                            const PFty_t test,
-                            const PFord_ordering_t in,
-                            const PFord_ordering_t out,
-                            PFalg_att_t iter,
-                            PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_child (const PFpa_op_t *frag,
-                             const PFpa_op_t *ctx,
-                             const PFty_t test,
-                             const PFord_ordering_t in,
-                             const PFord_ordering_t out,
-                             PFalg_att_t iter,
-                             PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_desc (const PFpa_op_t *frag,
-                            const PFpa_op_t *ctx,
-                            const PFty_t test,
-                            const PFord_ordering_t in,
-                            const PFord_ordering_t out,
-                            PFalg_att_t iter,
-                            PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_desc_self (const PFpa_op_t *frag,
-                                 const PFpa_op_t *ctx,
-                                 const PFty_t test,
-                                 const PFord_ordering_t in,
-                                 const PFord_ordering_t out,
-                                 PFalg_att_t iter,
-                                 PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_foll (const PFpa_op_t *frag,
-                            const PFpa_op_t *ctx,
-                            const PFty_t test,
-                            const PFord_ordering_t in,
-                            const PFord_ordering_t out,
-                            PFalg_att_t iter,
-                            PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_foll_sibl (const PFpa_op_t *frag,
-                                 const PFpa_op_t *ctx,
-                                 const PFty_t test,
-                                 const PFord_ordering_t in,
-                                 const PFord_ordering_t out,
-                                 PFalg_att_t iter,
-                                 PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_parent (const PFpa_op_t *frag,
-                              const PFpa_op_t *ctx,
-                              const PFty_t test,
-                              const PFord_ordering_t in,
-                              const PFord_ordering_t out,
-                              PFalg_att_t iter,
-                              PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_prec (const PFpa_op_t *frag,
-                            const PFpa_op_t *ctx,
-                            const PFty_t test,
-                            const PFord_ordering_t in,
-                            const PFord_ordering_t out,
-                            PFalg_att_t iter,
-                            PFalg_att_t item);
-PFpa_op_t *PFpa_llscj_prec_sibl (const PFpa_op_t *frag,
-                                 const PFpa_op_t *ctx,
-                                 const PFty_t test,
-                                 const PFord_ordering_t in,
-                                 const PFord_ordering_t out,
-                                 PFalg_att_t iter,
-                                 PFalg_att_t item);
+PFpa_op_t *PFpa_llscjoin (const PFpa_op_t *ctx,
+                          PFalg_step_spec_t spec,
+                          const PFord_ordering_t in,
+                          const PFord_ordering_t out,
+                          PFalg_att_t iter,
+                          PFalg_att_t item);
 
 /**
  * Access to persistently stored document table.
@@ -785,8 +661,7 @@
 /**
  * Access to the string content of loaded documents
  */
-PFpa_op_t * PFpa_doc_access (const PFpa_op_t *doc, 
-                             const PFpa_op_t *alg,
+PFpa_op_t * PFpa_doc_access (const PFpa_op_t *alg,
                              PFalg_att_t res,
                              PFalg_att_t att,
                              PFalg_doc_t doc_col);
@@ -834,45 +709,22 @@
                            PFalg_att_t val);
 
 /** Constructor for constructor content operators (elem|doc). */
-PFpa_op_t * PFpa_content (const PFpa_op_t *doc,
-                          const PFpa_op_t *cont,
+PFpa_op_t * PFpa_content (const PFpa_op_t *cont,
                           PFalg_att_t iter,
                           PFalg_att_t item);
 
+/** Constructor for shallow constructor content operators (elem|doc). */
+PFpa_op_t * PFpa_slim_content (const PFpa_op_t *cont,
+                               PFalg_att_t iter,
+                               PFalg_att_t item);
+
 /** Constructor for pf:merge-adjacent-text-nodes() functionality */
-PFpa_op_t * PFpa_merge_adjacent (const PFpa_op_t *fragment,
-                                 const PFpa_op_t *n,
+PFpa_op_t * PFpa_merge_adjacent (const PFpa_op_t *n,
                                  PFalg_att_t,
                                  PFalg_att_t,
                                  PFalg_att_t);
 
 /**
- * Extract result part from a (frag, result) pair.
- */
-PFpa_op_t *PFpa_roots (const PFpa_op_t *n);
-
-/**
- * Extract fragment part from a (frag, result) pair.
- */
-PFpa_op_t *PFpa_fragment (const PFpa_op_t *n);
-
-/**
- * Constructor for a fragment extract operator
- * (to be used in combination with a function call)
- */
-PFpa_op_t * PFpa_frag_extract (const PFpa_op_t *n, unsigned int col_pos);
-
-/**
- * Form disjoint union between two fragments.
- */
-PFpa_op_t *PFpa_frag_union (const PFpa_op_t *n1, const PFpa_op_t *n2);
-
-/**
- * Empty fragment list
- */
-PFpa_op_t *PFpa_empty_frag (void);
-
-/**
  * Constructor for a runtime error message
  */
 PFpa_op_t * PFpa_error (const PFpa_op_t *n,  PFalg_att_t att,
@@ -972,14 +824,6 @@
                            const PFpa_op_t *param_list,
                            PFalg_schema_t schema);
                                    
-/**
- * Constructor for the fragment information of a list item
- * of a parameter list related to function application
- */
-PFpa_op_t *PFpa_fun_frag_param (const PFpa_op_t *argument,
-                                const PFpa_op_t *param_list,
-                                unsigned int col_pos);
-
 /****************************************************************/
 /* operators introduced by built-in functions */
 

Index: logical_mnemonic.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/logical_mnemonic.h,v
retrieving revision 1.34.4.1
retrieving revision 1.34.4.2
diff -u -d -r1.34.4.1 -r1.34.4.2
--- logical_mnemonic.h  9 Feb 2008 08:40:30 -0000       1.34.4.1
+++ logical_mnemonic.h  18 Feb 2008 16:57:29 -0000      1.34.4.2
@@ -137,12 +137,12 @@
 #define all(a,b,c,d)      PFla_all((a), (b), (c), (d))
 
 /* path step */
-#define step(a,b,c,d,e,f,g,h) PFla_step ((a),(b),(c),(d),(e),(f),(g),(h))
-#define step_join(a,b,c,d,e,f,g) PFla_step_join ((a),(b),(c),(d),(e),(f),(g))
-#define guide_step(a,b,c,d,e,f,g,h,i,j) \
-        PFla_guide_step ((a),(b),(c),(d),(e),(f),(g),(h),(i),(j))
-#define guide_step_join(a,b,c,d,e,f,g,h,i) \
-        PFla_guide_step_join ((a),(b),(c),(d),(e),(f),(g),(h),(i))
+#define step(a,b,c,d,e,f,g) PFla_step ((a),(b),(c),(d),(e),(f),(g))
+#define step_join(a,b,c,d,e,f) PFla_step_join ((a),(b),(c),(d),(e),(f))
+#define guide_step(a,b,c,d,e,f,g,h,i) \
+        PFla_guide_step ((a),(b),(c),(d),(e),(f),(g),(h),(i))
+#define guide_step_join(a,b,c,d,e,f,g,h) \
+        PFla_guide_step_join ((a),(b),(c),(d),(e),(f),(g),(h))
 
 /* doc index join */
 #define doc_index_join(a,b,c,d,e,f) \

Index: sql_mnemonic.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/sql_mnemonic.h,v
retrieving revision 1.34.2.1
retrieving revision 1.34.2.2
diff -u -d -r1.34.2.1 -r1.34.2.2
--- sql_mnemonic.h      9 Feb 2008 08:40:32 -0000       1.34.2.1
+++ sql_mnemonic.h      18 Feb 2008 16:57:30 -0000      1.34.2.2
@@ -122,8 +122,8 @@
                                      
 /* .......... Aggregate Functions .......... */
 #define count(c)                     PFsql_count(c)
-#define max(c)                       PFsql_max(c)
-#define min(c)                       PFsql_min(c)
+#define max_(c)                      PFsql_max(c)
+#define min_(c)                      PFsql_min(c)
 #define avg(c)                       PFsql_avg(c)
 #define sum(c)                       PFsql_sum(c)
 

Index: ordering.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/ordering.h,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -d -r1.6 -r1.6.4.1
--- ordering.h  11 Jan 2008 10:47:07 -0000      1.6
+++ ordering.h  18 Feb 2008 16:57:30 -0000      1.6.4.1
@@ -32,9 +32,6 @@
 #ifndef ORDERING_H
 #define ORDERING_H
 
-/* Always include pathfinder.h first! */
-#include "pathfinder.h"
-
 /* Orderings use arrays of column names. */
 #include "array.h"
 
@@ -93,6 +90,12 @@
 bool PFord_order_dir_at (const PFord_ordering_t ordering,
                          unsigned int index);
 
+void PFord_set_order_col_at (PFord_ordering_t ordering, unsigned int index,
+                             PFalg_att_t name);
+
+void PFord_set_order_dir_at (PFord_ordering_t ordering, unsigned int index,
+                             bool dir);
+
 /**
  * Return true if the ordering @a a implies the ordering @a b.
  * I.e., ordering @a a is a refinement of ordering @a b.

Index: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/Makefile.ag,v
retrieving revision 1.46
retrieving revision 1.46.4.1
diff -u -d -r1.46 -r1.46.4.1
--- Makefile.ag 11 Jan 2008 10:47:03 -0000      1.46
+++ Makefile.ag 18 Feb 2008 16:57:27 -0000      1.46.4.1
@@ -34,6 +34,7 @@
        array.h \
        bitset.h \
        builtins.h \
+        child_mnemonic.h \
        compile.h \
        compile_interface.h \
        core2alg.h \
@@ -57,7 +58,6 @@
         map_names.h \
        mem.h \
        mil_dce.h \
-       mildebug.h \
        milgen.h \
        mil.h \
        mil_mnemonic.h \

Index: algopt.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/algopt.h,v
retrieving revision 1.21
retrieving revision 1.21.2.1
diff -u -d -r1.21 -r1.21.2.1
--- algopt.h    14 Jan 2008 14:03:29 -0000      1.21
+++ algopt.h    18 Feb 2008 16:57:28 -0000      1.21.2.1
@@ -52,7 +52,7 @@
 PFla_op_t * PFalgopt_key (PFla_op_t *root);
 PFla_op_t * PFalgopt_mvd (PFla_op_t *root, unsigned int noneffective_tries);
 PFla_op_t * PFalgopt_reqval (PFla_op_t *root);
-PFla_op_t * PFalgopt_rowrank (PFla_op_t *root);
+PFla_op_t * PFalgopt_rank (PFla_op_t *root);
 PFla_op_t * PFalgopt_set (PFla_op_t *root);
 PFla_op_t * PFalgopt_thetajoin (PFla_op_t *root);
 

--- NEW FILE: child_mnemonic.h ---
/* -*- c-basic-offset:4; c-indentation-style:"k&r"; indent-tabs-mode:nil -*- */

/**
 * @file
 *
 * Mnemonic abbreviations for subtree accesses.
 *
 * @if COPYRIGHT
 *
 * Copyright Notice:
 * -----------------
 *
 * The contents of this file are subject to the Pathfinder Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License.  You may obtain a copy of the License at
 * http://monetdb.cwi.nl/Legal/PathfinderLicense-1.1.html
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
 * the License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is the Pathfinder system.
 *
 * The Original Code has initially been developed by the Database &
 * Information Systems Group at the University of Konstanz, Germany and
 * is now maintained by the Database Systems Group at the Technische
 * Universitaet Muenchen, Germany.  Portions created by the University of
 * Konstanz and the Technische Universitaet Muenchen are Copyright (C)
 * 2000-2005 University of Konstanz and (C) 2005-2008 Technische
 * Universitaet Muenchen, respectively.  All Rights Reserved.
 *
 * @endif COPYRIGHT
 *
 * $Id: child_mnemonic.h,v 1.1.4.2 2008/02/18 16:57:28 sjoerd Exp $
 */

#ifndef CHILD_MNEMONIC_H
#define CHILD_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 LLR(p) R(L(L(p)))
#define LRL(p) L(R(L(p)))
#define LRR(p) R(R(L(p)))
#define RLL(p) L(L(R(p)))
#define RLR(p) R(L(R(p)))
#define RRL(p) L(R(R(p)))
#define RRR(p) R(R(R(p)))

#define LLLL(p) L(L(L(L(p))))
#define LLLR(p) R(L(L(L(p))))
#define LLRL(p) L(R(L(L(p))))
#define LRLL(p) L(L(R(L(p))))
#define RLLL(p) L(L(L(R(p))))
#define LLRR(p) R(R(L(L(p))))
#define LRLR(p) R(L(R(L(p))))
#define RLLR(p) R(L(L(R(p))))
#define RRLR(p) R(L(R(R(p))))
#define RLRL(p) L(R(L(R(p))))
#define RRLL(p) L(L(R(R(p))))
#define RRRL(p) L(R(R(R(p))))

#define LLLLL(p) L(L(L(L(L(p)))))
#define LLLLR(p) R(L(L(L(L(p)))))
#define RRRRL(p) L(R(R(R(R(p)))))

#define RRRRRL(p) L(R(R(R(R(R(p))))))
#define RRRRRR(p) R(R(R(R(R(R(p))))))

#endif

/* vim:set shiftwidth=4 expandtab: */

Index: functions.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/functions.h,v
retrieving revision 1.19
retrieving revision 1.19.4.1
diff -u -d -r1.19 -r1.19.4.1
--- functions.h 11 Jan 2008 10:47:06 -0000      1.19
+++ functions.h 18 Feb 2008 16:57:29 -0000      1.19.4.1
@@ -39,7 +39,6 @@
 
 #define FUNCTIONS_H
 
-#include "pathfinder.h"
 /* PFty_t */
 #include "types.h"
 /* PFenv_t */

--- mildebug.h DELETED ---

Index: mil_mnemonic.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/mil_mnemonic.h,v
retrieving revision 1.44.2.1
retrieving revision 1.44.2.2
diff -u -d -r1.44.2.1 -r1.44.2.2
--- mil_mnemonic.h      9 Feb 2008 08:40:31 -0000       1.44.2.1
+++ mil_mnemonic.h      18 Feb 2008 16:57:29 -0000      1.44.2.2
@@ -257,7 +257,7 @@
 #define mmult(a,b) PFmil_mmult ((a), (b))
 
 /** arithmetic divide */
-#define div(a,b) PFmil_div ((a), (b))
+#define div_(a,b) PFmil_div ((a), (b))
 
 /** multiplexed arithmetic divide */
 #define mdiv(a,b) PFmil_mdiv ((a), (b))
@@ -280,6 +280,9 @@
 /** multiplexed comparison (equality) */
 #define meq(a,b) PFmil_meq ((a), (b))
 
+/** multiplexed and */
+#define mand(a,b) PFmil_mand ((a), (b))
+
 /** multiplexed or */
 #define mor(a,b) PFmil_mor ((a), (b))
 

Index: subtyping.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/subtyping.h,v
retrieving revision 1.18
retrieving revision 1.18.4.1
diff -u -d -r1.18 -r1.18.4.1
--- subtyping.h 11 Jan 2008 10:47:09 -0000      1.18
+++ subtyping.h 18 Feb 2008 16:57:30 -0000      1.18.4.1
@@ -35,8 +35,6 @@
 #ifndef SUBTYPING_H
 #define SUBTYPING_H
 
-#include "pathfinder.h"
-
 #include "types.h"
 
 /** 

Index: physical_mnemonic.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/physical_mnemonic.h,v
retrieving revision 1.28.4.1
retrieving revision 1.28.4.2
diff -u -d -r1.28.4.1 -r1.28.4.2
--- physical_mnemonic.h 9 Feb 2008 08:40:32 -0000       1.28.4.1
+++ physical_mnemonic.h 18 Feb 2008 16:57:30 -0000      1.28.4.2
@@ -32,7 +32,7 @@
 /* Also import generic algebra stuff */
 #include "algebra_mnemonic.h"
 
-#define serialize(a,b,c)     PFpa_serialize ((a), (b), (c))
+#define serialize(a,b)       PFpa_serialize ((a), (b))
 
 /** literal table construction */
 #define lit_tbl(a,b,c)       PFpa_lit_tbl ((a), (b), (c))
@@ -49,14 +49,6 @@
 /** join that preserves the order of the first argument */
 #define leftjoin(a,b,c,d)    PFpa_leftjoin ((a), (b), (c), (d))
 
-#if 0
-/** NestedLoopJoin */
-#define nljoin(a,b,c,d)      PFpa_nljoin ((a), (b), (c), (d))
-
-/** MergeJoin */
-#define merge_join(a,b,c,d)  PFpa_merge_join ((a), (b), (c), (d))
-#endif
-
 /** standard join operator */
 #define eqjoin(a,b,c,d)      PFpa_eqjoin ((a), (b), (c), (d))
 
@@ -85,11 +77,8 @@
 
 #define intersect(a,b)       PFpa_intersect ((a), (b))
 #define difference(a,b)      PFpa_difference ((a), (b))
-/** HashDistinct */
 #define sort_distinct(a,b)   PFpa_sort_distinct ((a), (b))
-/** StandardSort */
 #define std_sort(a,b)        PFpa_std_sort ((a), (b))
-/** RefineSort */
 #define refine_sort(a,b,c)   PFpa_refine_sort ((a), (b), (c))
 
 #define fun_1to1(a,b,c,d)    PFpa_fun_1to1 ((a), (b), (c), (d))
@@ -98,7 +87,8 @@
 
 #define to(a,b,c,d)          PFpa_to ((a), (b), (c), (d))
 
-#define hash_count(a,b,c)    PFpa_hash_count ((a), (b), (c))
+#define count(a,b,c)         PFpa_count ((a), (b), (c))
+#define ecount(a,b,c,d,e)    PFpa_count_ext ((a), (b), (c), (d), (e))
 #define aggr(a,b,c,d,e)      PFpa_aggr ((a), (b), (c), (d), (e))
 
 /** a sort specification list is just another attribute list */
@@ -114,31 +104,10 @@
 #define cast(a,b,c,d)        PFpa_cast ((a), (b), (c), (d))
 
 /** StaircaseJoin */
-#define llscj_anc(a,b,c,d,e,f,g) PFpa_llscj_anc ((a), (b), (c), \
-        (d), (e), (f), (g))
-#define llscj_anc_self(a,b,c,d,e,f,g) PFpa_llscj_anc_self ((a), (b), (c), \
-        (d), (e), (f), (g))
-#define llscj_attr(a,b,c,d,e,f,g) PFpa_llscj_attr ((a), (b), (c), \
-        (d), (e), (f), (g))
-#define llscj_child(a,b,c,d,e,f,g) PFpa_llscj_child ((a), (b), (c), \
-        (d), (e), (f), (g))
-#define llscj_desc(a,b,c,d,e,f,g) PFpa_llscj_desc ((a), (b), (c), \
-        (d), (e), (f), (g))
-#define llscj_desc_self(a,b,c,d,e,f,g) PFpa_llscj_desc_self ((a),(b), (c), \
-        (d), (e), (f), (g))
-#define llscj_foll(a,b,c,d,e,f,g) PFpa_llscj_foll ((a), (b), (c), \
-        (d), (e), (f), (g))
-#define llscj_foll_self(a,b,c,d,e,f,g) PFpa_llscj_foll_self ((a),(b), (c), \
-        (d), (e), (f), (g))
-#define llscj_parent(a,b,c,d,e,f,g) PFpa_llscj_parent ((a), (b), (c), \
-        (d), (e), (f), (g))
-#define llscj_prec(a,b,c,d,e,f,g) PFpa_llscj_prec ((a), (b), (c), \
-        (d), (e), (f), (g))
-#define llscj_prec_self(a,b,c,d,e,f,g) PFpa_llscj_prec_self ((a),(b), (c), \
-        (d), (e), (f), (g))
+#define llscjoin(a,b,c,d,e,f) PFpa_llscjoin ((a), (b), (c), (d), (e), (f))
 
 #define doc_tbl(a,b,c)       PFpa_doc_tbl ((a), (b), (c))
-#define doc_access(a,b,c,d,e) PFpa_doc_access ((a), (b), (c), (d), (e))
+#define doc_access(a,b,c,d)  PFpa_doc_access ((a), (b), (c), (d))
 
 /* twig root operator */
 #define twig(a,b,c)          PFpa_twig ((a),(b),(c))
@@ -165,19 +134,12 @@
 #define processi(a,b,c,d)    PFpa_processi ((a),(b),(c),(d))
 
 /* constructor content operator (elem|doc) */
-#define content(a,b,c,d)     PFpa_content ((a),(b),(c),(d))
-
-#define merge_adjacent(a,b,c,d,e) PFpa_merge_adjacent ((a),(b),(c),(d),(e))
-
-/** roots() operator */
-#define roots(a)             PFpa_roots (a)
+#define content(a,b,c)       PFpa_content ((a),(b),(c))
 
-#define fragment(a)          PFpa_fragment (a)
-#define frag_extract(a,b)    PFpa_frag_extract ((a),(b))
-#define frag_union(a,b)      PFpa_frag_union ((a), (b))
+/* slim constructor content operator (elem|doc) */
+#define slim_content(a,b,c)  PFpa_slim_content ((a),(b),(c))
 
-/** empty fragment list */
-#define empty_frag()         PFpa_empty_frag ()
+#define merge_adjacent(a,b,c,d) PFpa_merge_adjacent ((a),(b),(c),(d))
 
 #define error(a,b,c)         PFpa_error ((a), (b), (c))
 #define cond_err(a,b,c,d)    PFpa_cond_err ((a), (b), (c), (d))
@@ -197,10 +159,7 @@
 #define fun_call(a,b,c,d,e,f,g,h) \
         PFpa_fun_call ((a),(b),(c),(d),(e),(f),(g),(h))
 #define fun_param(a,b,c)  PFpa_fun_param ((a),(b),(c))  
-#define fun_frag_param(a,b,c) PFpa_fun_frag_param ((a),(b),(c))  
 
-#define fn_concat(a,b,c,d)   PFpa_fn_concat ((a), (b), (c), (d))
-#define fn_contains(a,b,c,d) PFpa_fn_contains ((a), (b), (c), (d))
 #define string_join(a,b,c,d) PFpa_string_join ((a),(b),(c),(d))
 
 /* vim:set shiftwidth=4 expandtab: */

Index: xml2lalg_converters.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/xml2lalg_converters.h,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -u -d -r1.2.4.1 -r1.2.4.2
--- xml2lalg_converters.h       9 Feb 2008 08:40:33 -0000       1.2.4.1
+++ xml2lalg_converters.h       18 Feb 2008 16:57:30 -0000      1.2.4.2
@@ -38,10 +38,6 @@
 #ifndef XML2LALG_CONVERTERS_H
 #define XML2LALG_CONVERTERS_H
 
-
-
-#include "pathfinder.h"
-
 #include <stdio.h>
 #ifdef HAVE_STDBOOL_H
     #include <stdbool.h>
@@ -51,15 +47,10 @@
 #include <assert.h>
 #include <stdlib.h>
 
-
-
 #include "algebra.h"
 #include "logical.h"
 #include "logical_mnemonic.h"
 
-
-
-
 PFla_op_kind_t 
 PFxml2la_conv_2PFLA_OpKind(const char* s);
 
@@ -68,16 +59,13 @@
 PFalg_att_t 
 PFxml2la_conv_2PFLA_attributeName_unq(const char* s);
 
-
 PFalg_simple_type_t 
 PFxml2la_conv_2PFLA_atomType(char* typeString);
  
-
 PFalg_atom_t 
 PFxml2la_conv_2PFLA_atom(PFalg_simple_type_t,
                          char *prefix, char *uri, char* valueString);
 
-
 PFalg_comp_t 
 PFxml2la_conv_2PFLA_comparisonType(char* s);
 
@@ -90,6 +78,9 @@
 PFalg_axis_t 
 PFxml2la_conv_2PFLA_xpathaxis(char* s);
 
+PFalg_node_kind_t 
+PFxml2la_conv_2PFLA_nodekind(char* s);
+
 PFalg_doc_t 
 PFxml2la_conv_2PFLA_docType(char* s);
 

Index: string_utils.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/string_utils.h,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -d -r1.2 -r1.2.4.1
--- string_utils.h      11 Jan 2008 10:47:08 -0000      1.2
+++ string_utils.h      18 Feb 2008 16:57:30 -0000      1.2.4.1
@@ -36,8 +36,6 @@
 #ifndef STRING_UTILS_H
 #define STRING_UTILS_H
 
-#include "pathfinder.h"
-
 #include <stdio.h>
 #ifdef HAVE_STDBOOL_H
     #include <stdbool.h>

Index: mil.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/mil.h,v
retrieving revision 1.54.2.1
retrieving revision 1.54.2.2
diff -u -d -r1.54.2.1 -r1.54.2.2
--- mil.h       9 Feb 2008 08:40:30 -0000       1.54.2.1
+++ mil.h       18 Feb 2008 16:57:29 -0000      1.54.2.2
@@ -32,8 +32,6 @@
 #ifndef MIL_H
 #define MIL_H
 
-#include "pathfinder.h"
-
 /** maximum number of children of a MIL tree node */
 #define MIL_MAXCHILD 8
 
@@ -54,6 +52,8 @@
 #define PF_MIL_VAR_KIND_PI      7
 #define PF_MIL_VAR_KIND_REF     8
 
+#define PF_MIL_VAR_GENTYPE      9
+
 #define PF_MIL_VAR_ATTR        10
 #define PF_MIL_VAR_ELEM        11
 
@@ -77,12 +77,13 @@
 #define PF_MIL_VAR_ATTR_CONT   31
 #define PF_MIL_VAR_QN_LOC      32
 #define PF_MIL_VAR_QN_URI      33
-#define PF_MIL_VAR_QN_PREFIX   34
-#define PF_MIL_VAR_PROP_VAL    35
-#define PF_MIL_VAR_PROP_TEXT   36
-#define PF_MIL_VAR_PROP_COM    37
-#define PF_MIL_VAR_PROP_INS    38
-#define PF_MIL_VAR_PROP_TGT    39
+#define PF_MIL_VAR_QN_URI_LOC  34
+#define PF_MIL_VAR_QN_PREFIX   35
+#define PF_MIL_VAR_PROP_VAL    36
+#define PF_MIL_VAR_PROP_TEXT   37
+#define PF_MIL_VAR_PROP_COM    38
+#define PF_MIL_VAR_PROP_INS    39
+#define PF_MIL_VAR_PROP_TGT    40
 
 #define PF_MIL_VAR_LE          42
 #define PF_MIL_VAR_LT          43

Index: xml2lalg.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/xml2lalg.h,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -d -r1.3 -r1.3.4.1
--- xml2lalg.h  11 Jan 2008 10:47:09 -0000      1.3
+++ xml2lalg.h  18 Feb 2008 16:57:30 -0000      1.3.4.1
@@ -32,35 +32,21 @@
  * $Id$
  */
 
-
-
-
 #ifndef XML2ALG_H
 #define XML2ALG_H
 
-
-#include "pathfinder.h"
-
-
 #include "logical.h"
 
 #include "array.h"
 
-
 typedef struct XML2LALGContext XML2LALGContext;
 
-
 struct XML2LALGContext {
-
-    PFarray_t* nodeStore;   
-
-    void* docXPathCtx;
-   
+    PFarray_t*    nodeStore;   
+    void*         docXPathCtx;
     PFalg_att_t (*convert2PFLA_attributeName)(const char* s);
 };
 
-
-
 XML2LALGContext* 
 PFxml2la_xml2lalgContext(void);
 
@@ -70,7 +56,4 @@
 PFla_op_t* 
 PFxml2la_importXMLFromMemory(XML2LALGContext* ctx, const char* xml, int size);
 
-
-
 #endif
-

Index: algebra.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/algebra.h,v
retrieving revision 1.70
retrieving revision 1.70.2.1
diff -u -d -r1.70 -r1.70.2.1
--- algebra.h   28 Jan 2008 16:31:41 -0000      1.70
+++ algebra.h   18 Feb 2008 16:57:27 -0000      1.70.2.1
@@ -48,35 +48,52 @@
  *
  * Observe that the type #aat_node has four bits set, as nodes are split
  * in MonetDB into attribute nodes (#aat_anode) and other nodes (#aat_pnode).
- * Both node kinds require two bits each, to represented the nodes using a
- * node id (#aat_pre/#aat_attr) and a document fragment 
(#aat_pfrag/#aat_afrag).
+ * Both node kinds require three bits each, to represented the nodes using a
+ * node id (#aat_pre), a document fragment (#aat_frag), and based on the
+ * node kind either the attribute id (#aat_attr) or a kind identifier
+ * (#aat_nkind).
  *
  * @note
- *   The bits for #aat_pfrag and #aat_afrag @b must be lower than the bit
- *   for #aat_pre and #aat_attr, respectively. Our sort implementation will
- *   first sort by the frag BAT, then by the pre BAT this way.
- *   This implements document order across documents correctly.
+ *   The bits for #aat_frag must be lower than the bit
+ *   for #aat_pre and the bit for #aat_pre must be lower
+ *   than the bit for #aat_attr, respectively. Our sort
+ *   implementation will first sort by the frag BAT,
+ *   then by the pre BAT, and then by the attribute id
+ *   this way. This implements document order across
+ *   documents and attributes correctly.
  */
-#define aat_nat     0x00000001 /**< algebra simple atomic type natural number 
*/
-#define aat_int     0x00000002 /**< algebra simple atomic type integer */
-#define aat_str     0x00000004 /**< algebra simple atomic type string  */
-#define aat_dec     0x00000008 /**< algebra simple atomic type decimal */
-#define aat_dbl     0x00000010 /**< algebra simple atomic type double  */
-#define aat_bln     0x00000020 /**< algebra simple atomic type boolean  */
-#define aat_qname   0x00000040 /**< algebra simple atomic type QName  */
-#define aat_uA      0x00000080 /**< algebra simple atomic type untypedAtomic  
*/
-#define aat_node    0x00000F00 /**< algebra simple atomic type node */
-#define aat_anode   0x00000C00 /**< algebra simple atomic type attribute */
-#define aat_attr    0x00000800 /**< an attribute is represented
-                                     by an attr value... */
-#define aat_afrag   0x00000400 /**< ...and a attribute fragment */
-#define aat_pnode   0x00000300 /**< algebra simple atomic type representing
-                                     all other nodes */
-#define aat_pre     0x00000200 /**< a node is represented by a pre value... */
-#define aat_pfrag   0x00000100 /**< ...and a node fragment */
+#define aat_nat         0x00000001 /**< algebra simple atomic type natural 
number */
+#define aat_int         0x00000002 /**< algebra simple atomic type integer */
+#define aat_str         0x00000004 /**< algebra simple atomic type string  */
+#define aat_dec         0x00000008 /**< algebra simple atomic type decimal */
+#define aat_dbl         0x00000010 /**< algebra simple atomic type double  */
+#define aat_bln         0x00000020 /**< algebra simple atomic type boolean  */
+#define aat_uA          0x00000040 /**< algebra simple atomic type 
untypedAtomic  */
 
-#define aat_charseq 0x00010000 /**< this type represents the CHAR type in SQL 
*/
-#define aat_update  0x00010000 /**< and it represents the update kind in MIL */
+/* qname representation in MIL and SQL */ 
+#define aat_qname_id    0x00000100 /**< MIL id column representing a QName */
+#define aat_qname_loc   0x00000100 /**< SQL local name column representing a 
QName */
+#define aat_qname_cont  0x00000200 /**< MIL container column representing a 
QName */
+#define aat_qname_uri   0x00000200 /**< SQL uri column representing a QName */
+/* qname representation in the algebra */
+#define aat_qname       0x00000300 /**< algebra simple atomic type QName  */
+
+/* node representation in MIL and SQL */
+#define aat_frag        0x00001000 /**< node fragment */
+#define aat_pre         0x00002000 /**< pre value */
+#define aat_attr        0x00004000 /**< attr value */
+#define aat_nkind       0x00008000 /**< node kind indicating that
+                                        a node is not an attribute */
+/* attribute node representation in the algebra */
+#define aat_anode       0x00007000 /**< algebra simple atomic type attribute */
+/* element/document/text/pi/comment node representation in the algebra */
+#define aat_pnode       0x0000B000 /**< algebra simple atomic type 
+                                        representing all other nodes */
+/* node representation in the algebra */
+#define aat_node        0x0000F000 /**< algebra simple atomic type node */
+
+#define aat_charseq     0x00100000 /**< this type represents the CHAR type in 
SQL */
+#define aat_update      0x00100000 /**< and it represents the update kind in 
MIL */
 /**
  * The following types represent the first parameter of an update function
  * (which is a always of kind node). This allows an update item to correctly
@@ -85,29 +102,33 @@
  * at the serialize operator.
  *
  * @note
- *    The bits encoding the node1 information #aat_att1, #aat_afrag1, 
#aat_pre1,
- *    and #aat_pfrag1 represent the normal node information shifted 4 bits
+ *    The bits encoding the node1 information #aat_frag1, #aat_pre1, 
#aat_attr1,
+ *    and #aat_nkind1 represent the normal node information shifted 4 bits
  *    to the left.
  */
-#define aat_node1   0x0000F000 /**< algebra simple atomic type node */
-#define aat_anode1  0x0000C000 /**< algebra simple atomic type attribute */
-#define aat_attr1   0x00008000 /**< an attribute is represented
-                                     by an attr value... */
-#define aat_afrag1  0x00004000 /**< ...and a attribute fragment */
-#define aat_pnode1  0x00003000 /**< algebra simple atomic type representing
-                                     all other nodes */
-#define aat_pre1    0x00002000 /**< a node is represented by a pre value... */
-#define aat_pfrag1  0x00001000 /**< ...and a node fragment */
+/* node representation in MIL and SQL */
+#define aat_frag1       0x00010000 /**< node fragment */
+#define aat_pre1        0x00020000 /**< pre value */
+#define aat_attr1       0x00040000 /**< attr value */
+#define aat_nkind1      0x00080000 /**< node kind indicating that
+                                        a node is not an attribute */
+/* attribute node representation in the algebra */
+#define aat_anode1      0x00070000 /**< algebra simple atomic type attribute */
+/* element/document/text/pi/comment node representation in the algebra */
+#define aat_pnode1      0x000B0000 /**< algebra simple atomic type 
+                                        representing all other nodes */
+/* node representation in the algebra */
+#define aat_node1       0x000F0000 /**< algebra simple atomic type node */
 
 /**
  * The following types are for the document management functions. We introduce
  * one new type, aat_docmgmt, to signify document management queries, and 3 
  * new types for path, document name and collection name.
  */
-#define aat_docmgmt  0x00100000 /**< represents the doc management type */
-#define aat_path     0x00020000 /**< the path where a document resides*/
-#define aat_docnm    0x00040000 /**< the name of the document */
-#define aat_colnm    0x00080000 /**< the name of the collection */
+#define aat_docmgmt  0x01000000 /**< represents the doc management type */
+#define aat_path     0x02000000 /**< the path where a document resides*/
+#define aat_docnm    0x04000000 /**< the name of the document */
+#define aat_colnm    0x08000000 /**< the name of the collection */
 
 /** Simple atomic types in our algebra */
 typedef unsigned int PFalg_simple_type_t;
@@ -116,8 +137,8 @@
                         || (a) == aat_dec || (a) == aat_dbl || (a) == aat_bln \
                         || (a) == aat_qname || (a) == aat_uA \
                         || (a) == aat_anode || (a) == aat_pnode \
-                        || ((a) == aat_pre || (a) == aat_pfrag) \
-                        || ((a) == aat_attr || (a) == aat_afrag) \
+                        || ((a) == aat_pre || (a) == aat_frag) \
+                        || ((a) == aat_attr || (a) == aat_nkind) \
                         || ((a) == 0))
 
 typedef unsigned int nat;
@@ -263,15 +284,12 @@
 };
 typedef enum PFalg_node_kind_t PFalg_node_kind_t;
 
-struct PFalg_scj_spec_t {
-    PFalg_axis_t        axis;    /**< represented axis */
-    PFalg_node_kind_t   kind;    /**< node kind to test for */
-    union {
-        char           *target;  /**< target specified for pi's */
-        PFqname_t       qname;   /**< for name tests */
-    } str;
+struct PFalg_step_spec_t {
+    PFalg_axis_t      axis;    /**< represented axis */
+    PFalg_node_kind_t kind;    /**< node kind to test for */
+    PFqname_t         qname;   /**< for name tests */
 };
-typedef struct PFalg_scj_spec_t PFalg_scj_spec_t;
+typedef struct PFalg_step_spec_t PFalg_step_spec_t;
 
 /** function call result occurrence indicator */
 enum PFalg_occ_ind_t {
@@ -473,24 +491,24 @@
 PFalg_att_t PFalg_ori_name (PFalg_att_t unq, PFalg_att_t free);
 
 /**
- * Print simple type name
+ * Print XPath axis
  */
-char * PFalg_simple_type_str (PFalg_simple_type_t att);
+char * PFalg_axis_str (PFalg_axis_t axis);
 
 /**
- * Print function call kind
+ * Print node kind
  */
-char * PFalg_fun_call_kind_str (PFalg_fun_call_t kind);
+char * PFalg_node_kind_str (PFalg_node_kind_t kind);
 
 /**
- * Extract all possible algebra types from the XQuery type.
+ * Print simple type name
  */
-PFalg_simple_type_t PFalg_type (PFty_t ty);
+char * PFalg_simple_type_str (PFalg_simple_type_t att);
 
 /**
- * Extract occurrence indicator from the XQuery type.
+ * Print function call kind
  */
-PFalg_occ_ind_t PFalg_type_occ (PFty_t ty);
+char * PFalg_fun_call_kind_str (PFalg_fun_call_t kind);
 
 /**
  * Print function name

Index: logical.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/logical.h,v
retrieving revision 1.51.4.1
retrieving revision 1.51.4.2
diff -u -d -r1.51.4.1 -r1.51.4.2
--- logical.h   9 Feb 2008 08:40:30 -0000       1.51.4.1
+++ logical.h   18 Feb 2008 16:57:29 -0000      1.51.4.2
@@ -336,13 +336,12 @@
 
     /* store the semantic information for path steps (with guide information) 
*/
     struct {
-        PFalg_axis_t    axis;
-        PFty_t          ty;
-        unsigned int    guide_count;
-        PFguide_tree_t **guides;
-        int             level;
-        PFalg_att_t     iter;    /**< column to look up the iterations */
-        PFalg_att_t     item;    /**< column to look up the context nodes */
+        PFalg_step_spec_t spec;   /**< step specification */
+        unsigned int    guide_count; /**< number of attached guide nodes */
+        PFguide_tree_t **guides;  /**< list of attached guide nodes */
+        int             level;    /**< level of the result nodes */
+        PFalg_att_t     iter;     /**< column to look up the iterations */
+        PFalg_att_t     item;     /**< column to look up the context nodes */
         PFalg_att_t     item_res; /**< column to store the resulting nodes */
     } step;
 
@@ -825,7 +824,7 @@
  * Constructor for XPath step evaluation.
  */
 PFla_op_t * PFla_step_simple (const PFla_op_t *doc, const PFla_op_t *n,
-                              PFalg_axis_t axis, PFty_t seqty,
+                              PFalg_step_spec_t spec,
                               PFalg_att_t iter, PFalg_att_t item,
                               PFalg_att_t item_res);
 
@@ -833,7 +832,7 @@
  * Constructor for XPath step evaluation.
  */
 PFla_op_t * PFla_step (const PFla_op_t *doc, const PFla_op_t *n,
-                       PFalg_axis_t axis, PFty_t seqty, int level,
+                       PFalg_step_spec_t spec, int level,
                        PFalg_att_t iter, PFalg_att_t item,
                        PFalg_att_t item_res);
 
@@ -841,7 +840,7 @@
  * Constructor for XPath step evaluation (without duplicate removal).
  */
 PFla_op_t * PFla_step_join_simple (const PFla_op_t *doc, const PFla_op_t *n,
-                                   PFalg_axis_t axis, PFty_t seqty,
+                                   PFalg_step_spec_t spec,
                                    PFalg_att_t item,
                                    PFalg_att_t item_res);
 
@@ -849,7 +848,7 @@
  * Constructor for XPath step evaluation (without duplicate removal).
  */
 PFla_op_t * PFla_step_join (const PFla_op_t *doc, const PFla_op_t *n,
-                            PFalg_axis_t axis, PFty_t seqty, int level,
+                            PFalg_step_spec_t spec, int level,
                             PFalg_att_t item,
                             PFalg_att_t item_res);
 
@@ -857,7 +856,7 @@
  * Constructor for XPath step evaluation (with guide information).
  */
 PFla_op_t * PFla_guide_step_simple (const PFla_op_t *doc, const PFla_op_t *n,
-                                    PFalg_axis_t axis, PFty_t seqty,
+                                    PFalg_step_spec_t spec,
                                     unsigned int guide_count,
                                     PFguide_tree_t **guides,
                                     PFalg_att_t iter, PFalg_att_t item,
@@ -867,7 +866,7 @@
  * Constructor for XPath step evaluation (with guide information).
  */
 PFla_op_t * PFla_guide_step (const PFla_op_t *doc, const PFla_op_t *n,
-                             PFalg_axis_t axis, PFty_t seqty,
+                             PFalg_step_spec_t spec,
                              unsigned int guide_count,
                              PFguide_tree_t **guides, int level,
                              PFalg_att_t iter, PFalg_att_t item,
@@ -879,7 +878,7 @@
  */
 PFla_op_t * PFla_guide_step_join_simple (const PFla_op_t *doc,
                                          const PFla_op_t *n,
-                                         PFalg_axis_t axis, PFty_t seqty,
+                                         PFalg_step_spec_t spec,
                                          unsigned int guide_count,
                                          PFguide_tree_t **guides,
                                          PFalg_att_t item,
@@ -890,7 +889,7 @@
  * with guide information).
  */
 PFla_op_t * PFla_guide_step_join (const PFla_op_t *doc, const PFla_op_t *n,
-                                  PFalg_axis_t axis, PFty_t seqty,
+                                  PFalg_step_spec_t spec,
                                   unsigned int guide_count,
                                   PFguide_tree_t **guides, int level,
                                   PFalg_att_t item,

Index: xml2lalg_xpath_utils.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/include/xml2lalg_xpath_utils.h,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -d -r1.3 -r1.3.4.1
--- xml2lalg_xpath_utils.h      11 Jan 2008 10:47:09 -0000      1.3
+++ xml2lalg_xpath_utils.h      18 Feb 2008 16:57:31 -0000      1.3.4.1
@@ -38,16 +38,11 @@
 #ifndef LIBXML_XPATH_UTILS_H
 #define LIBXML_XPATH_UTILS_H
 
-#include "pathfinder.h"
-
-
 #include <stdio.h>
 #ifdef HAVE_STDBOOL_H
     #include <stdbool.h>
 #endif
 
-
-
 /* SAX parser interface (libxml2) */
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
@@ -55,10 +50,6 @@
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 
-
-
-
-
 xmlXPathObjectPtr 
 PFxml2la_xpath_evalXPathFromDocCtx(xmlXPathContextPtr xpathCtx, 
                                    const char* xpathExpression);
@@ -68,7 +59,6 @@
                      xmlNodePtr nodeXpathCtx, 
                      const char* xpathExpression);
 
-
 int 
 PFxml2la_xpath_getNodeCount(xmlXPathObjectPtr xpathObjPtr);
 
@@ -90,7 +80,6 @@
 char* 
 PFxml2la_xpath_getElementValue(xmlNodePtr nodePtr);
 
-
 int 
 PFxml2la_xpath_getIntValue(char* s);
 
@@ -100,7 +89,4 @@
 bool 
 PFxml2la_xpath_getBoolValue(char* s);
 
-
-
 #endif
-


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