%************************************************
\chapter{Abstract}\label{ch:abstract}
%************************************************

\vspace{-5em}

\noindent{}\Cmls{} are a prominent way to model and solve real world problems.
They are used in areas such as scheduling, supply chain management, and transportation, among many others.
The \gls{rewriting} process of a \cml{} transforms a \cmodel{} into a \gls{slv-mod}, the input required by the program that solves the problem.
In the past, these languages served mainly as a standardized interface between different \solvers{} and the \gls{rewriting} required was negligible.
However, \cmls{} have evolved to include functionality that is not directly supported by the target \solvers{}.
As such, the \gls{rewriting} process has become more important and complex.

\minizinc{}, one such language, was originally designed for constraint programming \solvers{}, whose \glspl{slv-mod} contain few, highly complex \constraints{}.
The same \minizinc{} models can now target mixed integer programming and Boolean satisfiability \solvers{}, resulting in numerous, very simple \constraints{}.
Distinctively, \minizinc{}'s \gls{rewriting} process is founded on its functional language.
It generates \glspl{slv-mod} through the application of increasingly complex \minizinc{} functions from \solver{}-specific libraries.
Consequently, the performance of the functional evaluation of the language can be a limiting factor.
For many applications, the current \minizinc{} implementation now requires a significant, and sometimes prohibitive, amount of time to rewrite \instances{}.
This problem is exacerbated by the emerging use of \gls{meta-optimization} algorithms, which require the rewriting and solving of a sequence of closely related \instances{}.

In this thesis we revisit the \gls{rewriting} of functional \cmls{} into \glspl{slv-mod}.
We design and evaluate an architecture for \cmls{} that can accommodate its modern uses.
At its core lies a formal execution model that allows us to rewrite \cmodels{} efficiently and actively manage the \gls{slv-mod}.
We show how it can better detect and eliminate parts of the model that have become unused.
The architecture is extended using a range of well-known simplification techniques to ensure the quality of the produced \glspl{slv-mod}.
In addition, we incorporate new analysis techniques to avoid the use of \glspl{reif} or replace them with \glspl{half-reif}, where possible.

The architecture is designed to incorporate incremental \constraint{} modelling in two ways.
Primarily, the \gls{rewriting} process is fully incremental: changes made to the \instance{} through a provided interface require minimal additional \gls{rewriting} effort.
Moreover, we introduce \gls{rbmo}, a way to specify \gls{meta-optimization} algorithms directly in \minizinc{}.
These specifications are executed directly by a \minizinc{} \solver{}, using a simple extension.

Together, the functionality of this architecture helps to make constraint modelling a more powerful and attractive approach to solve real world problems.
