Ejemplo n.º 1
0
def test_expand_probability_estimate():
    expression = ast.ExpOp(ast.OP_LT, [
        ast.ExpBQLMutInf(['c0'], ['c1', 'c2'],
                         [('c3', ast.ExpLit(ast.LitInt(3)))], None),
        ast.ExpLit(ast.LitFloat(0.1)),
    ])
    probest = ast.ExpBQLProbEst(expression)
    assert macro.expand_probability_estimate(probest, 'p', 'g') == \
        ast.ExpSub(
            ast.Select(ast.SELQUANT_ALL,
                [ast.SelColExp(
                    ast.ExpApp(False, 'AVG', [ast.ExpCol(None, 'x')]),
                    None)],
                [ast.SelTab(
                    ast.SimulateModelsExp([ast.SelColExp(expression, 'x')],
                        'p', 'g'),
                    None)],
                None, None, None, None))
Ejemplo n.º 2
0
 def p_bqlfn_prob_est(self, e):
     return ast.ExpBQLProbEst(e)
Ejemplo n.º 3
0
    def p_bqlfn_prob_est(self, e):              return ast.ExpBQLProbEst(e)

    def p_predrel_of_opt_none(self):            return None