AW: [RuleML-all] Test-driven development of RuleML rule bases

Adrian Paschke adrian.paschke at biotec.tu-dresden.de
Wed Jan 23 16:53:33 AST 2008


Dear Marco,

 

Support for test-driven development of RuleML / Reaction RuleML rule bases
could be also a very interesting topic for a demo at the RuleML-2008
Challenge or a paper. More information about RuleML-2008 will be available
on the web page soon:  <http://2008.ruleml.org/> http://2008.ruleml.org/

 

RuleML 0.91 also supports an <Entails> construct which can be used to
formulate integrity constraints on a closed rules set / rule base. As shown
in literature it is possible to transform common classes of production rule
programs to logic programs which would give a bridge e.g. to logic
entailment.

 

Here are some more references on our verification, validation and integrity
approach which you might follow up:

 

Paschke, A.: Verification, Validation and Integrity of Distributed and
Interchanged Rule Based Policies and Contracts in the Semantic Web, Int.
Semantic Web and Policy Workshop (
<http://sunsite.informatik.rwth-aachen.de/Publications/CEUR-WS/Vol-207/>
SWPW' 06), Athens, Georgia, USA.
<http://ibis.in.tum.de/staff/paschke/docs/SWPW06_Validation.pdf>
http://ibis.in.tum.de/staff/paschke/docs/SWPW06_Validation.pdf

 

Paschke, A., Dietrich, J., Giurca, A., Wagner, G., Lukichev, S.: On
Self-Validating Rule Bases, Int. Semantic Web Enabled Software Engineering
Workshop (SWESE'06), Athnes, Georgia, USA.
<http://ibis.in.tum.de/staff/paschke/docs/Rule_Validation.pdf>
http://ibis.in.tum.de/staff/paschke/docs/Rule_Validation.pdf

 

Jens Dietrich and Adrian Paschke, On the Test-Driven Development and
Validation of Business Rules, 4th International Conference on Information
Systems Technology and its Applications (ISTA 2005), New Zealand, May 2005.
<http://ibis.in.tum.de/staff/paschke/docs/ista2005-final.pdf>
http://ibis.in.tum.de/staff/paschke/docs/ista2005-final.pdf

 

Paschke, A.: Rule-Based Service Level Agreements - Knowledge Representation
for Automated e-Contract, SLA and Policy Management, ISBN 978-3-88793-221-3,
Idea Verlag GmbH, München.

 

Paschke, A., Boley, H., Dietrich, J.:
<http://www.w3.org/2005/rules/wg/wiki/Rule_Interchange_Through_Test-Driven_V
erification_and_Validation?action=fullsearch&value=linkto%3A%22Rule+Intercha
nge+Through+Test-Driven+Verification+and+Validation%22&context=180> Rule
Interchange Through Test-Driven Verification and Validation, W3C RIF Use
Case, , submitted December 2005.
<http://www.w3.org/2005/rules/wg/wiki/Rule_Interchange_Through_Test-Driven_V
erification_and_Validation>
http://www.w3.org/2005/rules/wg/wiki/Rule_Interchange_Through_Test-Driven_Ve
rification_and_Validation

 

 

Best, 

 

Adrian

 

  _____  

Von: Marco Ensing [mailto:l.a.marco at sbcglobal.net] 
Gesendet: Sonntag, 13. Januar 2008 19:04
An: 'Adrian Paschke'; david at dossot.net
Cc: ruleml-all at ruleml.org
Betreff: RE: [RuleML-all] modeling the premisse A and B or C

 

Definitely. Currently we have an internal xml format for storing testcases,
but it would be more interesting to have this into a general format. 

Let me start reading up on your research. Could you sent this to m.ensing
(at) acumenbusiness.com

 

Looking forward to get this integrated into the product. 

 

Marco

 

From: Adrian Paschke [mailto:adrian.paschke at biotec.tu-dresden.de] 
Sent: Saturday, January 12, 2008 1:37 PM
To: 'Marco Ensing'; david at dossot.net
Cc: ruleml-all at ruleml.org
Subject: AW: [RuleML-all] modeling the premisse A and B or C

 

Hi Marco,

 

That’s interesting.

 

We have several other papers where we detail the test-driven approach
towards self validating rule bases and also describe rule markup for
representing test cases and test suites.

 

In particular for Reaction RuleML where data, events, and complete rule sets
are interchanged as part of messaging reaction rule actions safeguarding the
execution of interchanged rule sets in the target environments is very
important.

 

Would you be interested in helping and working towards integrating markup
for test cases in Reaction RuleML?

 

Best,

 

Adrian

 

  _____  

Von: Marco Ensing [mailto:l.a.marco at sbcglobal.net] 
Gesendet: Samstag, 12. Januar 2008 19:54
An: 'Adrian Paschke'; david at dossot.net
Cc: ruleml-all at ruleml.org
Betreff: RE: [RuleML-all] modeling the premisse A and B or C

 

Hi Adrian,

 

Thanks for the research paper. That is a good read. We have been thinking
along similar lines.

We are currently discovering rule redundancies, inconsistencies and
incompleteness in a rule policy with the Rule Manager.

We have been working on a Test Case Driven Design for rule policies as well.
See 

 http://bizknowledge.blogspot.com/2007/06/test-suite-for-business-rules.html

but this has not been released in the product yet. 

 

On the export; we can make it an option to export the model only with
conjunctive premises. Although every ‘option’ makes a product more difficult
to use. It is in conflict with our Simplicity design goal. It’s always a
fine line to walk.

 

Marco

 

 

From: Adrian Paschke [mailto:adrian.paschke at biotec.tu-dresden.de] 
Sent: Friday, January 11, 2008 9:03 AM
To: 'Marco Ensing'; david at dossot.net
Cc: ruleml-all at ruleml.org
Subject: AW: [RuleML-all] modeling the premisse A and B or C

 

Hi Marco,

 

Reaction RuleML supports both conjunctions and disjunctions in arbitrary
combinations, e.g.

 

IF a or b THEN c

 

<Rule style=”reasoning”> <!-- derivation rule -->

  <if>

     <Or>

        <Atom><Rel>a</Rel></Atom>

        <Atom><Rel>b</Rel></Atom>

    </Or>

   </if>

   <then>

        <Atom><Rel>c</Rel></Atom>

   </then>

</Rule>

 

I totally agree with you: on the PIM level a rule writer should not be
concerned with the intrinsic of different rule engines. The burden should be
on the translator >from Reaction RuleML to the platform-specific execution
syntax. As I explained the translator needs to translate into a
disjunction-free format if the rule engine does not support disjunctions.
And, it possibly needs to do other refactorings of the rule base such as
removing redundancies or narrowing of the rule sets. Attached a paper where
we described a XP based technique for validating quality of rule bases and
gave several examples for refactorings of rule bases.

 

Cheers,

 

Adrian

 

  _____  

Von: Marco Ensing [mailto:l.a.marco at sbcglobal.net] 
Gesendet: Freitag, 11. Januar 2008 17:05
An: 'Adrian Paschke'; david at dossot.net
Cc: ruleml-all at ruleml.org
Betreff: RE: [RuleML-all] modeling the premisse A and B or C

 

Hi Adrian,

 

Thank you for your reply. Am I correct to infer from your email that
Reaction RuleML does not support the single rule construct? (I know this is
logically incorrect :-))

 

Personally I think that a rule writer should not be concerned with the
intrinsic of different rule engines. 

Ideally a rule policy specified in a Rule Markup Language should be able to
execute on different RuleML compliant engines. 

(Probably that is why semantics on simple mathematical operators like the
relational comparison ‘<’, is also important) 

 

One problem I see with splitting the rule is that rule auditing and rule
tracing from the execution environment will have to reverse this split. It
is also possible that this split into two rule implementations occurs inside
this platform-specific rule engine. 

 

You probably know my view of the world; I always hope that a Business
Analyst / Business User can take the role of a Rule Engineer.  It’s a matter
of providing the necessary tools to guide them. E.g. a construction of ‘if
(A and B) or A  then 
.’ will be identified in the rule verification as an
anomaly. 

 

For the time being we can let the RuleManager export two disjunct rules for
the Reaction RuleML format.

 

Regards,

 

Marco

 

 

 

 

From: Adrian Paschke [mailto:adrian.paschke at biotec.tu-dresden.de] 
Sent: Friday, January 11, 2008 3:11 AM
To: david at dossot.net; 'Marco Ensing'
Cc: ruleml-all at ruleml.org
Subject: AW: [RuleML-all] modeling the premisse A and B or C

 

Hi Marco,

 

To some extend it is also a question of what kind of rule program the rule
engineer wants to write. If your platform-specific rule engine does not
support disjunction then you would need to translate a rule such as:

 

IF (A and B) or C THEN D

 

to two rules

 

IF A and B THEN D

IF C THEN D

 

That is, the translator from RuleML or Reaction RuleML needs to split a
disjunctive RuleML rule into two rules if the platform-specific rule engine
/ execution environment does not support disjunctions. But the engineer
might also avoid disjunctions and directly write two rules on the
platform-independent RuleML level. 

 

Cheers, Adrian

  _____  

Von: ruleml-all-bounces at ruleml.org [mailto:ruleml-all-bounces at ruleml.org] Im
Auftrag von David Dossot
Gesendet: Donnerstag, 10. Januar 2008 19:31
An: Marco Ensing
Cc: ruleml-all at ruleml.org
Betreff: Re: [RuleML-all] modeling the premisse A and B or C

 

Marco,

Except the <Atom> element that you have put around the <Or> one, the single
implication is correct. Note that you can always validate RuleML with the
provided schemas, the gain confidence in the correctness of what you output.


Cheers,
David

On Jan 10, 2008 10:25 AM, Marco Ensing <l.a.marco at sbcglobal.net> wrote:

David,

 

Thank you for your quick reply. The extrapolation on the 'Or' was where I
was uncertain about.

To extend your referenced example with an or construct (expression in
italic):

 
 
        The first rule implies that a person owns an object
        if that person buys the object from a merchant 
or that person inherited object from relatives and the person keeps the
object.

 

So would it be correct to generate:

 

<Implies>

    <!-- explicit 'And' -->

    <And>

      <Atom>

        <Or>

          <Atom>                

           <Rel>buy</Rel>

           <Var>person</Var>

           <Var>merchant</Var>

           <Var>object</Var>

          </Atom>              

          <Atom>               

           <Rel>inherited</Rel> 

           <Var>person</Var> 

           <Var>relatives</Var> 

           <Var>object</Var> 

          </Atom>              

        </Or> 

      </Atom>

      <Atom>

        <Rel>keep</Rel>

        <Var>person</Var>

        <Var>object</Var>

      </Atom>

    </And>

    <Atom>

      <Rel>own</Rel>

      <Var>person</Var>

      <Var>object</Var>

    </Atom>

 

</Implies>

 

Or must I generate two implies statements

 

<Implies>

    <!-- explicit 'And' -->

    <And>

      <Atom>

        <Rel>buy</Rel>

        <Var>person</Var>

        <Var>merchant</Var>

        <Var>object</Var>

      </Atom>

      <Atom>

        <Rel>keep</Rel>

        <Var>person</Var>

        <Var>object</Var>

      </Atom>

    </And>

    <Atom>

      <Rel>own</Rel>

      <Var>person</Var>

      <Var>object</Var>

    </Atom>

 

</Implies>

 

<Implies> 

    <!-- explicit 'And' --> 

    <And> 

        <Atom>          

           <Rel>inherited</Rel> 

           <Var>person</Var> 

           <Var>relatives</Var> 

           <Var>object</Var> 

         </Atom>       

        <Atom> 

           <Rel>keep</Rel> 

           <Var>person</Var> 

           <Var>object</Var> 

      </Atom> 

    </And> 

    <Atom> 

      <Rel>own</Rel> 

      <Var>person</Var> 

      <Var>object</Var> 

    </Atom> 

 

</Implies> 

 

 

From: ddossot at gmail.com [mailto:ddossot at gmail.com] On Behalf Of David Dossot
Sent: Thursday, January 10, 2008 10:04 AM
To: Marco Ensing
Cc: ruleml-all at ruleml.org
Subject: Re: [RuleML-all] modeling the premisse A and B or C

 

Hi Marco,

This is great news! Thank you.

I will let experts reply for Reaction RuleML, but as far as NxBRE is
concerned, the syntax must be the one defined by the Naf Datalog
sub-language of RuleML 0.9.

Here is an example of:

IF (A and B)
THEN
 D

--> http://www.ruleml.org/0.9/exa/own_compact.ruleml

You can easily extrapolated to adding an Or (by nesting XML elements). 

Hope this helps,
David

On Jan 9, 2008 7:54 PM, Marco Ensing <l.a.marco at sbcglobal.net> wrote:

Hi All,


Currently we are exporting to the Reaction RuleML format from the Rule
Manager. This product is available for free from the website
www.acumenbusiness.com  <http://www.acumenbusiness.com> . The trial period
to create rules and export them to
Reaction RuleML has been removed.


I was wondering what we should generate for the construction

IF (A and B) or C
THEN
 D



How would this be expressed in RuleML 0.9 release (for NxBRE) or Reaction
Rules?
Can this be expressed in one <Rule> or does this require to generate
multiple rules?

You feedback is appreciated (and in return you will get a product with your 
desired format)


Regards,

Marco Ensing

_______________________________________________
RuleML-all mailing list
RuleML-all at ruleml.org
http://mail.ruleml.org/mailman/listinfo/ruleml-all

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ruleml.org/pipermail/ruleml-all/attachments/20080123/1f9fea89/attachment-0001.htm


More information about the RuleML-all mailing list