Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-115

Add support for strong negation

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Minor Minor
    • 6.1.0.CR1
    • None
    • None
    • None
    • Documentation (Ref Guide, User Guide, etc.)

      Drools "not" operator implements a type of "negation by failure", i.e. not X() behaves as the negation of "exists" or, in other words, translates as "it is NOT asserted that ...".
      However, another form of stronger negation is needed to express conditionals such as "it is asserted that NOT ..."

      It should be possible, then, to assert facts both in a "positive" and "negative" way, to assert THAT and THAT NOT.

      The language should also support a "neg" CE to create "negative" patterns which will match with negative facts. I.e. it should be possible to write rules such as:

      when $p : Person() and Car( owner == $p ) then
      // a positive, matching Car is present in the WM

      when $p : Person() and neg Car( owner == $p ) then
      // a negative, matching Car is present in the WM

      when $p : Person() and not Car( owner == $p ) then
      // neither a positive nor a negative fact exists in the WM

      For a more detailed description and motivation see e.g.:
      https://oxygen.informatik.tu-cottbus.de/publications/wagner/WebRules2Neg.pdf

              dsotty Davide Sottara (Inactive)
              dsotty Davide Sottara (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: