Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-394

Add RexUtil.toCnf, to convert expressions to conjunctive normal form (CNF)

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.1-incubating
    • Component/s: None
    • Labels:
      None

      Issue Links

        Activity

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-optiq/commit/fda19af1 .
        Hide
        julianhyde Julian Hyde added a comment -

        I think the right answer is

            (x=1 OR x=2 OR x=3)
        AND (x=1 OR x=2 OR a=3)
        AND (x=1 OR x=2 OR b=3)
        AND (x=1 OR y=2 OR x=3)
        AND (x=1 OR y=2 OR a=3)
        AND (x=1 OR y=2 OR b=3)
        AND (x=1 OR a=2 OR x=3)
        AND (x=1 OR a=2 OR a=3)
        AND (x=1 OR a=2 OR b=3)
        AND (y=1 OR x=2 OR x=3)
        AND (y=1 OR x=2 OR a=3)
        AND (y=1 OR x=2 OR b=3)
        AND (y=1 OR y=2 OR x=3)
        AND (y=1 OR y=2 OR a=3)
        AND (y=1 OR y=2 OR b=3)
        AND (y=1 OR a=2 OR x=3)
        AND (y=1 OR a=2 OR a=3)
        AND (y=1 OR a=2 OR b=3)
        AND (z=1 OR x=2 OR x=3)
        AND (z=1 OR x=2 OR a=3)
        AND (z=1 OR x=2 OR b=3)
        AND (z=1 OR y=2 OR x=3)
        AND (z=1 OR y=2 OR a=3)
        AND (z=1 OR y=2 OR b=3)
        AND (z=1 OR a=2 OR x=3)
        AND (z=1 OR a=2 OR a=3)
        AND (z=1 OR a=2 OR b=3)
        
        Show
        julianhyde Julian Hyde added a comment - I think the right answer is (x=1 OR x=2 OR x=3) AND (x=1 OR x=2 OR a=3) AND (x=1 OR x=2 OR b=3) AND (x=1 OR y=2 OR x=3) AND (x=1 OR y=2 OR a=3) AND (x=1 OR y=2 OR b=3) AND (x=1 OR a=2 OR x=3) AND (x=1 OR a=2 OR a=3) AND (x=1 OR a=2 OR b=3) AND (y=1 OR x=2 OR x=3) AND (y=1 OR x=2 OR a=3) AND (y=1 OR x=2 OR b=3) AND (y=1 OR y=2 OR x=3) AND (y=1 OR y=2 OR a=3) AND (y=1 OR y=2 OR b=3) AND (y=1 OR a=2 OR x=3) AND (y=1 OR a=2 OR a=3) AND (y=1 OR a=2 OR b=3) AND (z=1 OR x=2 OR x=3) AND (z=1 OR x=2 OR a=3) AND (z=1 OR x=2 OR b=3) AND (z=1 OR y=2 OR x=3) AND (z=1 OR y=2 OR a=3) AND (z=1 OR y=2 OR b=3) AND (z=1 OR a=2 OR x=3) AND (z=1 OR a=2 OR a=3) AND (z=1 OR a=2 OR b=3)
        Hide
        jpullokkaran Laljo John Pullokkaran added a comment -

        Example:
        (x=1 and y = 1 and z = 1) or (X=2 and Y = 2 and a =2) or (X=3 and a=3 and b =3) -->
        (x=1 or x=2 or x=3) and ((y=1 and z=1) or ( y=2 and a=2) or (a=3 and b=3)) -->
        (x=1 or x=2 or x=3) and ( ((y=1 or y=2) and (z=1 or a=2)) or (a=3 and b=3) )

        Show
        jpullokkaran Laljo John Pullokkaran added a comment - Example: (x=1 and y = 1 and z = 1) or (X=2 and Y = 2 and a =2) or (X=3 and a=3 and b =3) --> (x=1 or x=2 or x=3) and ((y=1 and z=1) or ( y=2 and a=2) or (a=3 and b=3)) --> (x=1 or x=2 or x=3) and ( ((y=1 or y=2) and (z=1 or a=2)) or (a=3 and b=3) )

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            julianhyde Julian Hyde
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development