On 21/07/12 17:30, [email protected] wrote:
Generally I know there is no guarantee in which order rules are
executed. However, how exactly is this the case in hybrid mode?

Let's say one forward rule is executed, are all following backward rules
executed before another forward rule is executed, or is this too
unpredicatable?

No hybrid mode is predicable in that there are two distinct layers. All forward rules are run before any backward rules.

Indeed you can even choose to run forward rules by calling prepare() and no backward rules will be run at all. Backward rules are (and can only) be run in response to a query. A query triggers a check to see if a new prepare() is needed, if so that is run to completion before any backward rules are

I'd like to know, because I don't know how to avoid using "noValue" for
my rules. I am checking, if something is invalid, so the absence of an
"invalid" statement should automatically imply that it is valid.

When starting the reasoner of course noValue would always be true,
therefore I'd like to know if it is safe to use the "isChecked" statment
as I did in the example below, or could "noValue" still mean, that there
was no invalidity check yet?

The safe thing to do here is to perform all your checks as forward rules and then do the test (rule 1) as a static backward rule.

Dave


[rule1:
        (?x :hasY ?y)
        (?y :isChecked ?checked)
        noValue(?y, :isInvalid)

        ...

         ->
        ...
]

[rule2:
         (?x :hasY ?y)
         ....
         ->
         (?y :isChecked "true")

         [rule3:
             (?y :isInvalid "true")
             <-
             ...
         ]
         [rule4:
             (?y :isInvalid "true")
             <-
             ...
         ]
]


Reply via email to