New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compound NOT clause when multiple facts should not exist #85

Closed
williamwsmith opened this Issue Oct 17, 2013 · 0 comments

Comments

Projects
None yet
2 participants
@williamwsmith

williamwsmith commented Oct 17, 2013

I would like to have an OR constraint contain multiple NOT conditions. Basically WHEN any of 2 facts do not exist in working memory THEN. There is the issue that Or only takes 2 conditions, but, that aside, how is this typically done? Being new to rules I may be completely missing the obvious. I understand I could make more rules to get the OR behavior, but, then I have to replicate the THEN logic, or, I have to have some flag/book keeping fact.

Something like below, when there is not a String OR a Count, AND there is a Date.

rule OrNotRule {
    when {
        or (
                  not(s : String),
                  not(count : Count)
            );
            day:Date;
    }
    then {
        //do something
    }
}

@ghost ghost assigned doug-martin Nov 3, 2013

doug-martin added a commit to doug-martin/nools that referenced this issue Nov 8, 2013

v0.2.1
* Added support for js expression in the `from` node addressing issue [noolsjs#86](noolsjs#86)
* Enhanced `JoinReferenceNode` performance in the default assert case where there are no `references` to left or right context.
* Added ability to use `or` and `not` in tandem to check for the non-existence of multiple facts. [noolsjs#85](noolsjs#85)
* You can now define a custom resolution strategy.
* Compiling nools files now supports the from modifier.
* Documentation updates
   * Updates about from node support with js values.
   * New documentation about using `or` and `not` constratints together.
   * Updated `or` documentation to include a three constraint example.

@doug-martin doug-martin referenced this issue Nov 8, 2013

Merged

v0.2.1 #90

doug-martin added a commit to doug-martin/nools that referenced this issue Nov 8, 2013

v0.2.1
* Added support for js expression in the `from` node addressing issue [noolsjs#86](noolsjs#86)
* Enhanced `JoinReferenceNode` performance in the default assert case where there are no `references` to left or right context.
* Added ability to use `or` and `not` in tandem to check for the non-existence of multiple facts. [noolsjs#85](noolsjs#85)
* Fixed issue with `from` node where an undefined property would be tested. [noolsjs#89](noolsjs#89)
* You can now define a custom resolution strategy.
* Compiling nools files now supports the from modifier.
* Documentation updates
   * Updates about from node support with js values.
   * New documentation about using `or` and `not` constratints together.
   * Updated `or` documentation to include a three constraint example.

@doug-martin doug-martin closed this Nov 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment