Removed test code to run the optimizer interactively

master
Salvo 'LtWorf' Tomaselli 2015-11-11 16:36:14 +07:00
parent 7b26423d90
commit bdddb29b64
1 changed files with 0 additions and 46 deletions

@ -100,49 +100,3 @@ def general_optimize(expression):
Return value: this will return an optimized version of the expression'''
return optimize_all(expression, None, specific=False, general=True)
if __name__ == "__main__":
# n=node(u"((a b) - c d) - b")
# n=node(u"π a,b (d-a*b)")
# print n.__str__()
# 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)")
import relation
import optimizations
'''rels={}
rels["P1"]= relation.relation("/home/salvo/dev/relational/trunk/samples/people.csv")
rels["P2"]= relation.relation("/home/salvo/dev/relational/trunk/samples/people.csv")
rels["R1"]= relation.relation("/home/salvo/dev/relational/trunk/samples/person_room.csv")
rels["R2"]= relation.relation("/home/salvo/dev/relational/trunk/samples/person_room.csv")
rels["D1"]= relation.relation("/home/salvo/dev/relational/trunk/samples/dates.csv")
rels["S1"]= relation.relation("/home/salvo/dev/relational/trunk/samples/skillo.csv")
print rels'''
n = tree(u"π indice,qq,name (ρ age➡qq,id➡indice (P1-P2))")
# n=tree("σ id==3 and indice==2 and name==5 or name<2(P1 * S1)")
print (n)
print (n.toPython())
# print optimizations.selection_and_product(n,rels)
'''
σ skill=='C' (π id,name,chief,age (σ chief==i and age>a (ρ idi,agea(π id,age(people))*people)) ᐅᐊ skills)
(π id,name,chief,age (σ chief == i and age > a ((ρ agea,idi (π id,age (people)))*people)))ᐅᐊ(σ skill == 'C' (skills))
'''
# print specific_optimize("σ name==skill and age>21 and id==indice and
# skill=='C'(P1ᐅᐊS1)",rels)
# print n
# print n.result_format(rels)
'''σ k (r) r with r
σ k (r) r with σ k (r)'''
# a=general_optimize('π indice,qq,name (ρ age➡qq,id➡indice (P1-P2))')
# a=general_optimize("σ i==2 (σ b>5 (d))")
# print a
# print node(a)
# print tokenize("(a)")