Skip to content
Snippets Groups Projects
Commit d7877cf6281e authored by ludal's avatar ludal
Browse files

WIP solver rql

parent 5582718a40ea
No related branches found
No related tags found
No related merge requests found
...@@ -198,4 +198,11 @@ ...@@ -198,4 +198,11 @@
class DistributeVisitor(object): class DistributeVisitor(object):
"""The purpose of this visitor is to distribute and's over
or's in the expression tree. For example if A and B is
represented as A*B and A or B as A+B we want to transform :
A*(B+C*(D+E)+A*B) into A*B+A*C*D+A*C*E+A*A*B
"""
def __init__(self):
self.stack = []
def visit_and(self, node): def visit_and(self, node):
...@@ -201,5 +208,12 @@ ...@@ -201,5 +208,12 @@
def visit_and(self, node): def visit_and(self, node):
pass first = self.cond.pop(0)
if isinstance(first, _or):
distrib = _or.cond[:]
else:
distrib = [first]
while self.cond:
next = self.cond.pop(0)
def visit_or(self, node): def visit_or(self, node):
pass pass
def visit_true(self, node): def visit_true(self, node):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment