Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14484/algebra/opt
Modified Files:
opt_algebra_cse.c opt_general.brg opt_join_pd.c opt_mvd.c
opt_thetajoin.c
Log Message:
-- Implemented generic function application facility (for the logical algebra).
Generic functions can now be implemented in the logical algebra using
the following 4 operators:
o la_fun_call:
The head of a function call whose left child is the loop relation and the
right child a function parameter list. The operator is prepared for a set
of different kinds (e.g., xrpc and tijah), stores the function name and a
pointer to an arbitrary context (for XRPC this is a reference to the core
apply node).
o la_fun_param:
An item of the function parameter list refering to an algebra expression
(left child) and to the rest of the function parameter list (right child).
Its schema stores the names of all input columns. The order of columns
in the schema is important!
o la_fun_frag_param:
An item of the function parameter list refering to a fragment (left child)
and to the rest of the function parameter list (right child). It has a
further position argument that indicates to which column of the next
la_fun_param operator in the right child the fragment information refers
to. This operator is only used if a column contains node references.
o la_frag_extract:
If a function call returns nodes a frag_extract operator sits on top of
the la_fun_call operator to fix the fragment information needed by our
compilation scheme. Similar to the la_fun_frag_param operator it stores
the schema position of the item column it refers to.
Index: opt_general.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_general.brg,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- opt_general.brg 10 Dec 2007 15:10:00 -0000 1.43
+++ opt_general.brg 13 Dec 2007 13:08:16 -0000 1.44
@@ -132,8 +132,9 @@
%term merge_adjacent = 69
%term roots_ = 70
%term fragment = 71
-%term frag_union = 72
-%term empty_frag = 73
+%term frag_extract = 72
+%term frag_union = 73
+%term empty_frag = 74
%term error = 79
%term cond_err = 80
%term nil = 81
@@ -144,6 +145,9 @@
%term rec_param = 86
%term rec_arg = 87
%term rec_base = 88
+%term fun_call = 90
+%term fun_param = 91
+%term fun_frag_param = 92
%term string_join = 102
%term dummy = 120
@@ -243,16 +247,22 @@
Rec: nil = 101 (10);
Arg: rec_arg (Rel, Rel) = 102 (10);
-Rel: string_join (Rel, Rel) = 103 (10);
-Rel: dummy (Rel) = 104 (10);
+Rel: fun_call (Rel, Param) = 105 (10);
+Param: fun_param (Rel, Param) = 106 (10);
+Param: fun_frag_param (Frag, Param) = 107 (10);
+Param: nil = 108 (10);
-Rel: EmptyRel = 107 (0);
+Rel: string_join (Rel, Rel) = 110 (10);
+Rel: dummy (Rel) = 111 (10);
+Rel: EmptyRel = 112 (0);
-Frag: fragment (doc_tbl (Rel)) = 108 (10);
-Frag: fragment (twig (Twig)) = 109 (10);
-Frag: fragment (merge_adjacent (Frag, Rel)) = 110 (10);
+Frag: fragment (doc_tbl (Rel)) = 114 (10);
+Frag: fragment (twig (Twig)) = 115 (10);
+Frag: fragment (merge_adjacent (Frag, Rel)) = 116 (10);
+
+Frag: frag_extract (Rel) = 117 (10);
Frag: frag_union (Frag, Frag) = 118 (10);
Frag: empty_frag = 119 (10);
@@ -316,6 +326,7 @@
EmptyRel: roots_ (merge_adjacent (Frag,
EmptyRel)) = 189 (0);
EmptyRel: cond_err (EmptyRel, Rel) = 190 (0);
+EmptyRel: fun_call (EmptyRel, Param) = 191 (0);
EmptyRel: string_join (EmptyRel, Rel) = 201 (0);
EmptyRel: dummy (EmptyRel) = 202 (0);
@@ -1163,7 +1174,7 @@
break;
/* Rel: EmptyRel */
- case 107:
+ case 112:
{
/*
* Replace any sub-tree that we determined empty with these
Index: opt_mvd.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_mvd.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- opt_mvd.c 13 Dec 2007 09:08:24 -0000 1.30
+++ opt_mvd.c 13 Dec 2007 13:08:17 -0000 1.31
@@ -1584,9 +1584,8 @@
break;
case la_fragment:
- break;
+ case la_frag_extract:
case la_frag_union:
- break;
case la_empty_frag:
break;
@@ -1614,6 +1613,12 @@
/* do not rewrite anything that has to do with recursion */
break;
+ case la_fun_call:
+ case la_fun_param:
+ case la_fun_frag_param:
+ /* do not rewrite anything that has to do with function application */
+ break;
+
case la_proxy:
/**
* ATTENTION: The proxies (especially the kind=1 version) are
Index: opt_thetajoin.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_thetajoin.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- opt_thetajoin.c 10 Dec 2007 15:10:00 -0000 1.12
+++ opt_thetajoin.c 13 Dec 2007 13:08:17 -0000 1.13
@@ -1869,9 +1869,8 @@
break;
case la_fragment:
- break;
+ case la_frag_extract:
case la_frag_union:
- break;
case la_empty_frag:
break;
@@ -1903,6 +1902,13 @@
/* do not rewrite anything that has to do with recursion */
break;
+ case la_fun_call:
+ case la_fun_param:
+ case la_fun_frag_param:
+ /* do not rewrite anything
+ that has to do with function application */
+ break;
+
case la_proxy:
/**
* ATTENTION: The proxies (especially the kind=1 version) are
Index: opt_join_pd.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_join_pd.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- opt_join_pd.c 13 Dec 2007 09:00:49 -0000 1.35
+++ opt_join_pd.c 13 Dec 2007 13:08:16 -0000 1.36
@@ -326,6 +326,7 @@
case la_merge_adjacent:
case la_roots:
case la_fragment:
+ case la_frag_extract:
case la_frag_union:
case la_empty_frag:
case la_error:
@@ -338,6 +339,9 @@
case la_rec_param:
case la_rec_arg:
case la_rec_base:
+ case la_fun_call:
+ case la_fun_param:
+ case la_fun_frag_param:
case la_proxy:
case la_proxy_base:
case la_cross_mvd:
@@ -463,6 +467,7 @@
case la_merge_adjacent:
case la_roots:
case la_fragment:
+ case la_frag_extract:
case la_frag_union:
case la_empty_frag:
case la_string_join:
@@ -1775,6 +1780,13 @@
/* do not rewrite anything that has to do with recursion */
break;
+ case la_fun_call:
+ case la_fun_param:
+ case la_fun_frag_param:
+ /* do not rewrite anything
+ that has to do with function application */
+ break;
+
case la_proxy:
case la_proxy_base:
PFoops (OOPS_FATAL,
@@ -1839,6 +1851,7 @@
case la_merge_adjacent:
case la_roots:
case la_fragment:
+ case la_frag_extract:
case la_frag_union:
case la_empty_frag:
case la_string_join:
@@ -1849,6 +1862,9 @@
case la_rec_param:
case la_rec_arg:
case la_rec_base:
+ case la_fun_call:
+ case la_fun_param:
+ case la_fun_frag_param:
case la_proxy:
case la_proxy_base:
case la_dummy:
Index: opt_algebra_cse.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_algebra_cse.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- opt_algebra_cse.c 10 Dec 2007 15:10:00 -0000 1.7
+++ opt_algebra_cse.c 13 Dec 2007 13:08:16 -0000 1.8
@@ -754,6 +754,7 @@
}
} break;
case la_fragment:
+ case la_frag_extract:
case la_frag_union:
case la_empty_frag:
{
@@ -797,6 +798,18 @@
{
assert (!"la_rec_base not yet supported");
} break;
+ case la_fun_call:
+ {
+ assert (!"la_fun_call not yet supported");
+ } break;
+ case la_fun_param:
+ {
+ assert (!"la_fun_param not yet supported");
+ } break;
+ case la_fun_frag_param:
+ {
+ assert (!"la_fun_frag_param not yet supported");
+ } break;
case la_proxy:
{
assert (!"la_proxy not yet supported");
@@ -985,6 +998,7 @@
case la_merge_adjacent:
case la_roots:
case la_fragment:
+ case la_frag_extract:
case la_frag_union:
case la_empty_frag:
case la_error:
@@ -1022,6 +1036,18 @@
{
assert (!"la_rec_base not yet supported");
} break;
+ case la_fun_call:
+ {
+ assert (!"la_fun_call not yet supported");
+ } break;
+ case la_fun_param:
+ {
+ assert (!"la_fun_param not yet supported");
+ } break;
+ case la_fun_frag_param:
+ {
+ assert (!"la_fun_frag_param not yet supported");
+ } break;
case la_proxy:
{
assert (!"la_proxy not yet supported");
@@ -1560,6 +1586,7 @@
return true;
} break;
case la_fragment:
+ case la_frag_extract:
case la_frag_union:
case la_empty_frag:
{
@@ -1619,6 +1646,18 @@
{
assert (!"la_rec_base not yet supported!");
} break;
+ case la_fun_call:
+ {
+ assert (!"la_fun_call not yet supported");
+ } break;
+ case la_fun_param:
+ {
+ assert (!"la_fun_param not yet supported");
+ } break;
+ case la_fun_frag_param:
+ {
+ assert (!"la_fun_frag_param not yet supported");
+ } break;
case la_proxy:
{
assert (!"la_proxy not yet supported!");
@@ -2085,6 +2124,7 @@
eff_schema_patch (effmap, schema, EFF(child));
} break;
case la_fragment:
+ case la_frag_extract:
case la_frag_union:
case la_empty_frag:
{
@@ -2131,6 +2171,18 @@
{
assert (!"la_rec_base not yet supported");
} break;
+ case la_fun_call:
+ {
+ assert (!"la_fun_call not yet supported");
+ } break;
+ case la_fun_param:
+ {
+ assert (!"la_fun_param not yet supported");
+ } break;
+ case la_fun_frag_param:
+ {
+ assert (!"la_fun_frag_param not yet supported");
+ } break;
case la_proxy:
{
assert (!"la_proxy not yet supported");
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins