def bin_exp(self, ast): if ast.op == "+": return pi.Sum(ast.e1, ast.e2) elif ast.op == "-": return pi.Sub(ast.e1, ast.e2) elif ast.op == "*": return pi.Mul(ast.e1, ast.e2) elif ast.op == "/": return pi.Div(ast.e1, ast.e2) elif ast.op == "and": return pi.And(ast.e1, ast.e2) elif ast.op == "or": return pi.Or(ast.e1, ast.e2) elif ast.op == "and": return pi.And(ast.e1, ast.e2) elif ast.op == "<": return pi.Lt(ast.e1, ast.e2) elif ast.op == "<=": return pi.Le(ast.e1, ast.e2) elif ast.op == ">": return pi.Gt(ast.e1, ast.e2) elif ast.op == ">=": return pi.Ge(ast.e1, ast.e2) elif ast.op == "==": return pi.Eq(ast.e1, ast.e2)
def bin_exp(self, ast): if ast.op == "+": return pi.Sum(ast.e1, ast.e2) elif ast.op == "-": return pi.Sub(ast.e1, ast.e2) elif ast.op == "*": return pi.Mul(ast.e1, ast.e2) elif ast.op == "/": return pi.Div(ast.e1, ast.e2) elif ast.op == "and": return pi.And(ast.e1, ast.e2) elif ast.op == "or": return pi.Or(ast.e1, ast.e2) elif ast.op == "<": return pi.Lt(ast.e1, ast.e2) elif ast.op == "<=": return pi.Le(ast.e1, ast.e2) elif ast.op == ">": return pi.Gt(ast.e1, ast.e2) elif ast.op == ">=": return pi.Ge(ast.e1, ast.e2) elif ast.op == "==": return pi.Eq(ast.e1, ast.e2) ### Array Implementation ### elif ast.op == "\+": return pi.ArrayConcat(ast.e1, ast.e2)
def conjunction(self, ast): return pi.And(ast.left, ast.right)