19.2.4 Modelization Techniques

This last point concerns a more specific issue: practically, how does one go about modeling a complex problem in a way that benefits from concurrent constraint programming? There is, of course, no simple or easy answer to this question. However, we illustrate various modelization techniques on the following two issues:

Partial vs Total Functions

To take advantage of constraint propagation, it is desirable to state global truths. Partial functions have the disadvantage that you can only state properties at points where they are defined. For example, the features of a feature structure are often regarded as partial functions.

We demonstrate a nice trick to turn partial functions into total functions:

Given a partial function f:A\rightarrow B replace it by the total function F:A\rightarrow 2^B

where F(x) is of cardinality at most 1. f(x)\in F(x) if f is defined at x, else F(x)=\emptyset. Thus F will map to the empty set at points where f was not previously defined, and to a singleton set elsewhere.


Denys Duchier, Claire Gardent and Joachim Niehren
Version 1.3.99 (20050412)