We did a case study in intelligent internet applications using constraint logic programming and found out that constraint reasoning is essential in this context.
The calculations are based on size, age and location of the flat and a series of detailed questions about the flat and the house it is in. Some of these questions are hard to answer. However, in order to be able to calculate the rent estimate by hand, all questions must be answered. Usually, the calculation is performed by hand in about half on hour by an expert from the City of Munich or from one of the renter's associations.
The MRA brought the advising time down to the few minutes that the user needs to fill in the form. The user of the MRA need not answer all questions, he need not to reveal all he knows. He may even submit a blank form. The MRA will give an estimate of the rent, that is a price range as tight as possible. The key to computing with such partial information is to use constraint technology.
The MRA is derived from a statistical model compiled from sample data using statistical methods such as regression analysis. Due to the underlying statistical approach, there is the problem of inherent imprecision which is usually ignored when calculating the rent estimate by hand. Using constraints the MRA can also account for this statistical imprecision.
To process the answers from the questionnaire and return its result, we wrote a simple stable special-purpose web-server directly in a constraint logic programming language using its C-sockets for internet communication. This is opposed to the standard approach where for each user request a script is executed (usually written in Perl) via the CGI interface. The advantage is a direct connection of the program to the internet without unecessary overhead. The MRA server only deals with the input posted from the form, all other functionality (e.g. hyperlinks) is provided by a standard server.
The complete MRA was implemented within two man-months: For a novice to HTML and to constraint programming, it took about 4 man weeks to write the WWW user interface, only 2 weeks to write the calculation part and 1 week to debug it. We think that the coding would have taken several time slonger and dominated the implementation effort if a conventional programming language had been used.
Another advantage - and the topic of our latest work - is that constraint-based internet applications can be modified and adapted within minutes: Any part of the form comprising the application may be reused in another web-page simply by cut-and-paste - you may drop questions, you may set default values, you may fiy the answer to questions of the form and hide them from the user in order to specialize the application. The resulting web page will still work, since the missing information is dealt with by constraints. In other words, the underlying software can be reused and adapted in minutes! (A cut-and-paste version of the MRA is available on request).