Re: Using declarative rules for MISMO ?

Partly this was an exercise to help flesh out a PR Dialect, so based on 
the implementation we have done we need to address the initial concerns 
we have, as expressed in the blog:
http://markproctor.blogspot.com/2007/06/w3c-rule-interchange-format-for.html

1) non-value type, i.e. objects, as fields
2) ability to have unbound patterns
3) ability to preserve the order of constraint definitions (current 
splits the constraints into two different types of defintions and loses 
the order)
3) an xml that can have more xsd validation
4) ability to work with data not in the working memory, i.e. nested 
values retrieved with "from"

See the following as part of the more complex rules. If you run the unit 
tests, which run out of the box, it will spit out all the code it generates:
rule "ACMEPlus_CC_Base_Rates_6"
when
    the_loan_application : AUSLOANAPPLICATIONType()
    eval( the_loan_application.MORTGAGETERMS.lenderCaseIdentifier == 
"ACMEPlusGroup" &&
          
the_loan_application.LOANPRODUCTDATA.LOANFEATURES.loanDocumentationType 
== mismo.AUSLoanDocumentationTypeEnumerated.FULL_DOCUMENTATION &&
          the_loan_application.MORTGAGETERMS.borrowerRequestedLoanAmount 
 >= 1000000 )
    the_borrower : AUSBORROWERType() from the_loan_application.BORROWER
    eval( the_borrower.DECLARATION.presentlyDelinquentIndicator == "N" )
    the_mortgage_score : AUSMORTGAGESCOREType(value >= 700) from 
the_loan_application.ADDITIONALCASEDATA.MORTGAGESCORE
then
    the_loan_application.MORTGAGETERMS.requestedInterestRatePercent = 11.1;
end

At the time RIF Core didn't have frames, so we stuck to the RIF Core 
elements to start with, hoping we can extend that over time as the other 
elements are agreed on.

I'm not a logitician but one thing I don't quite understand is - why is 
"equal" a special element, but none of the other operators are, they all 
need to be expressed using a uniterms. From a PR perspective an operator 
is an operator, < has no more special meaning tha ==.

Mark

Sandro Hawke wrote:
> "Paul Vincent" <pvincent@tibco.com> writes:
>   
>> Sandro: can you explain why (you believe) a rule statement like
>>     
>>>> rule "Credit Score Adjustments 1"
>>>>   date-effective "25-OCT-2001 17:26:14"
>>>>   when
>>>>     cs : CreditSCore( programGroup == "ACMEPowerBuyerGroup",
>>>>                       lienType     == "FIRST_TD; SECOND_TD",
>>>>                       devision     == "Wholesale",
>>>>                       creditScore  >= 580 & <= 679 )
>>>>   then
>>>>     cs( score = cs.score -0.3 );
>>>> end
>>>>         
>> Is not declarative?
>>
>> AFAIK the term "declarative" refers to the rule statement in the context
>> of other rule statements - and there is no requirement for rule ordering
>> implied by the above rule fragment. Unless you are referring to the
>> action "reduce score by 0.3" which (a) implies some precondition re
>> score already having a value and (b) *is* the actual MISMO "logic" (so
>> is not something we are at liberty to change :)).
>>     
>
> Ah, perhaps I'm over-using the term "declarative".  I meant "deductive"
> or "pure logic" rules; it is the action part that I'm trying to work
> around.
>
> My point is that, as far as I can tell from these rules, the MISMO logic
> could be written as deductive (condition-condition, non-action) rules.
>
> I would kind of like to understand why the MISMO community does not want
> to do that, but mostly my point is that one can, I believe, translate
> (compile) the kind of rules they are writing into deductive rules.  And
> doing so would enable such rules to be conveyed in RIF Core.  They could
> be run by non-production-rule systems, combined with other types of
> rules, and (I suspect) subject to greater optimization.  (I don't know
> if performance is an issue for them, but surely it is for some rule
> users.)
>
>   
>> PS Sorry to hear about the broken snow globe. Nothing, I'm sure, to do
>> with international baggage handlers' opinions of US government attitudes
>> to global warming...
>>     
>
> Nothing, I'm sure.  :-)
>
>     -- Sandro
>
>   


-- 
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire,
SI4 1TE, United Kingdom.
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David Owens (Ireland)

Received on Monday, 11 June 2007 12:31:26 UTC