Supervisors: Patrick Abela and Gordon Pace
Principal goals of task:
Build a domain specific language based on Haskell to describe either business
rules or personalization rules, and write tools which analyze the rules and
compile these rules to another language (Java code/Microsoft Excel macros).
Description: Domain specific languages are simple languages
designed to express succinctly and elegantly tasks for a narrow domain.
One problem with designing such a language is that despite their simplicity,
one usually has to build a structure above the basic domain-specific
language constructs to enable normal programming features such as
modularization, iteration, recursion, conditionals, variables, etc.
One solution proposed to minimize this problem is to embed the
basic domain specific language within another programming language.
When embedding a language one builds a small library to describe,
manipulate, and execute the embedded language within another language
(called the host language). The programmer can then, using the host
language, write programs in the embedded language and use the standard
features (such as iteration and conditionals) from the host language.
The aim of the project is to design and develop an embedded language
designed for business rules domain which is embeddable within the
Java language and Excel scripts.
This project is being organized together with the local companies
Ixaris Systems Ltd and CrimsonWing, who will provide test case rules
for specific domains (business rules for financial transactions
(Ixaris) and personalization rules for customization (Crimsonwing)
for which the students will build a combinator library in Haskell
to describe the rules in one of these domains. XML input to these
rules should also be allowed using HaXml or a similar library. An
example of a rule which the user may want to describe is:
If the transient fraud risk is between 1/3 to 2/3 of the max,
then we can go ahead with any acquirer (Acquirer:ALL) provided
the validation mechanism is 3D-secure plus CVV2 (Validation:3DSecure
AND ANYOF{BasicCVV2Check, StrictCVV2Check} ), and provided that
the chargeback rate in the month is less than 50% of the threshold
(CurrentChargebackRate:LESSTHAN(50%))
The students should then build a simple library to analyze rules
described in the language. Analysis can be done via test-case generation,
or by manipulating the rules to make them simpler, or find contradictions
within them.
Finally, the user should also be allowed to generate a Java class
or Excel sheet (with embedded macros) which calculates the output
of a rule, which will allow end users to access frequently used rules
more easily.
References:
- Paul Hudak, Building Domain-Specific Embedded Languages,
ACM Computing Surveys 28A(4), December 1996.
- Simon Peyton Jones (editor),
Haskell 98 Language and Libraries: The Revised Report,
available from www.haskell.org ,
December 2002.
- Simon Peyton Jones, Jean-Marc Eber and Julian Seward,
Composing contracts: an adventure in financial engineering,,
Proceedings of the fifth ACM SIGPLAN international conference on Functional
programming, 2000.
- Malcolm Wallace and Colin Runciman,
Haskell and XML: Generic Combinators or Type-Based Translation?,
International Conference on Functional Programming (ICFP '99), 1999.
|