The Constraint Technology Package allows almost any resource allocation task to be handled in a declarative and efficient manner.
The programming package groups different constraint classes into different Prolog modules. The modularity is a significant feature for IF/Prolog and has proved well in industrial appli- cations. Furthermore it ensures compatibility with existing application code.
Railway signaling and traffic control: a prototype development for re-scheduling a rail timetable based on real time informa- tion.
System Verification Tool: SVE (System Verification Environment) is a tool to cope with the economic validation of current technical system by means of formal verification. Used by several Siemens industrial units.
Circuit Verification Tool: CVE (Circuit Verification Environment) is a tool to ensure that newly developed cir- cuits are logically correct. In operational use at ASIC Design Centres of Siemens.
Big integers and rationals: Exact arithmetic with integers of arbitrary length and rationals.
Coroutines: Data driven computation activated upon the instantiation of a variable.
Linear constraints: Solving systems of linear equations and inequations over rationals, including high level predicates for accumulation, disjunction, minimization, maximization ...
Finite domains: Narrowing actively the range of possible values associated with a variable this tech- nique significantly reduces the search space by considering only a valid set of possible values.
Boolean constraints: Relations formulated with boolean expressions provide efficient decision tree manipulation.
Together with the very high level language Prolog these constructs allow for both easier programming and faster execution of the same problems. Details on the improvements can be found below.
This environment is available as both ASCII and Motif variants with an hypertext-style on- line help facility available under Motif.
The Constraint Technology Package is compatible with all database interfaces, programming language interfaces, character-sets and graphical windowing systems used in conjunction with IF/Prolog. The package is available as an option on all IF/Prolog hardware platforms.
How much the Constraint Technology Package accelerates the problem solving can be seen in the following table. Implemented in IF/Prolog V4.1 and IF/Prolog V5.0 on a Sun SPARC- station IPX hardware platform the execution times for toy programs are compared. Program- ming the IF/Prolog V5.0 solution with and without the Constraint Technology Package shows the degree of enhancement achieved by applying constraint problem solving methods.
_______________________________________________
| | (1) | (2) | (3) |
|___________________|___________|________|______|
| Eight-Queens | 30.13 | 18.01 | 4.19 |
|___________________|___________|________|______|
| Farmer | 4.50 | 3.42 | 0.98 |
|___________________|___________|________|______|
| SEND MORE MONEY | 65.50 | 53.47 | 0.85 |
|___________________|___________|________|______|
(1) Traditional Prolog IF/Prolog V4.1
(2) Traditional Prolog IF/Prolog V5.0
(3) Constraint Solving IF/Prolog V5.0
CPU time given in Seconds per 100 evaluations
However coroutines are not sufficient as a general constraint mechanism since, as is the case in standard Prolog, they test consistency conditions passively. The more efficient method is to restrict the domain of a variable in advance which allows active handling of consistency conditions. Coroutines are though useful to define more complex constraints.
[Example]
The following queries give a good example for the improved declarative programming capa- bilities provided by the use of coroutines. In accordance with the proof model, Prolog proves subgoals procedurally from left to right. This may result in cases which, from the declarative point of view, are not correct:
[user] ?- A \= a, A = b.
no
[user] ?- A = b, A \= a.
A = b
yes
From the logical viewpoint, the order of subgoals is
equivalent with respect to satisfiability.
Using freeze/2 , a built-in predicate of the coroutine
constraint class, it is possible to delay
the proof of the first goal ( A \= a ) until the
variable A is instantiated.
[user] ?- freeze(A, A \= a), A = b.
A = b
yes
A finite domain variable may be any integer restricted as an interval, enumeration or se- quence. The variable may then only take a value present in its restricted domain. Within the class of constraints for finite domains it is possible to specify arithmetic as well as symbolic constraints between variables. Furthermore, cumulative constraints are provided.
During execution truth values are propagated over a number of "logical-built-in" predicates. The boolean unification algorithm operates over the truth domain allowing decisions to be combined easily.