Implement `solve_constraint' in the Engine module.
Modify some modules are contained own type to contain record.