From 4ba720996463ec0b930cea889667db52f709416f Mon Sep 17 00:00:00 2001 From: LtWorf Date: Wed, 29 Apr 2009 07:25:39 +0000 Subject: [PATCH] now handles more than 2 nested selections git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@137 014f5005-505e-4b48-8d0a-63407b615a7c --- relational/optimizations.py | 1 + relational/optimizer.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/relational/optimizations.py b/relational/optimizations.py index a517093..7d058da 100644 --- a/relational/optimizations.py +++ b/relational/optimizations.py @@ -30,6 +30,7 @@ def duplicated_select(n): if n.prop != n.child.prop: #Nested but different, joining them n.prop = n.prop + " and " + n.child.prop n.child=n.child.child + duplicated_select(n) #recoursive scan if n.kind==optimizer.UNARY: diff --git a/relational/optimizer.py b/relational/optimizer.py index a16e8e4..032aa7b 100644 --- a/relational/optimizer.py +++ b/relational/optimizer.py @@ -177,7 +177,7 @@ if __name__=="__main__": #a= tokenize("(a - (a ᑌ b) * π a,b (a-b)) - ρ 123 (a)") #a= tokenize(u"π a,b (a*b)") #a=tokenize("(a-b*c)*(b-c)") - a=general_optimize("σ b>5 ( σ a>2 (C)) * σ a>2 ( σ a>2 (C))") + a=general_optimize("σ i==2 (σ b>5 ( σ a>2 (C))) * σ a>2 ( σ a>2 (C))") print a #print node(a) #print tokenize("(a)") \ No newline at end of file