A constraint-driven system for contract assembly