0ae7e400dfb5dfc956a77c06a0118e1be25d65a2,qiskit/aqua/components/oracles/logical_expression_oracle.py,LogicalExpressionOracle,__init__,#LogicalExpressionOracle#Any#Any#Any#,66

Before Change


                // try parsing as normal logical expression that tt recognizes
                try:
                    expression = re.sub("(?i)" + re.escape("^"), " xor ", expression)
                    expression = to_cnf(BooleanExpression(expression)).raw_expr
                    expression = re.sub("(?i)" + re.escape(" and "), " & ", expression)
                    expression = re.sub("(?i)" + re.escape("not "), "~", expression)
                    expression = re.sub("(?i)" + re.escape(" or "), " | ", expression)
                    raw_expr = BooleanExpression(expression)
                except Exception:
                    // try parsing as dimacs cnf
                    try:

After Change


        if not self._optimization == "off" and not self._pyeda:
            warnings.warn("Logical expression optimization will not be performed without PyEDA.")

        if not expression is None:
            expression = re.sub("(?i)" + re.escape(" and "), " & ", expression)
            expression = re.sub("(?i)" + re.escape(" xor "), " ^ ", expression)
            expression = re.sub("(?i)" + re.escape(" or "),  " | ", expression)
            expression = re.sub("(?i)" + re.escape("not "),  "~",   expression)

        if self._pyeda:
            from pyeda.boolalg.expr import ast2expr, expr
            from pyeda.parsing.dimacs import parse_cnf
            if expression is None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: 0ae7e400dfb5dfc956a77c06a0118e1be25d65a2
Time: 2019-06-27
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/components/oracles/logical_expression_oracle.py
Class Name: LogicalExpressionOracle
Method Name: __init__


Project Name: instacart/lore
Commit Name: e9f922745b94c3b4a1ee7badec5e2376cf689a7c
Time: 2017-10-30
Author: montanalow@users.noreply.github.com
File Name: lore/io/__init__.py
Class Name:
Method Name: upload


Project Name: Qiskit/qiskit-aqua
Commit Name: 0ae7e400dfb5dfc956a77c06a0118e1be25d65a2
Time: 2019-06-27
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/components/oracles/logical_expression_oracle.py
Class Name: LogicalExpressionOracle
Method Name: __init__


Project Name: instacart/lore
Commit Name: e9f922745b94c3b4a1ee7badec5e2376cf689a7c
Time: 2017-10-30
Author: montanalow@users.noreply.github.com
File Name: lore/io/__init__.py
Class Name:
Method Name: download