Source code for "Synthesis and Abstraction of Constraint Models for Hierarchical Resource Allocation"