title: How to expand and print non-global constraints in DOcplex?
body: <p>I have recently migrated from AMPL/CPLEX-CP to Python/DOcplex.CP-MP. In AMPL, one can display the expanded version of the constraints using 'expand _constraint_name' command, which is helpful when debugging the model.</p>
  
  <p>Is there such functionality in DOcplex? For example: </p>
  
  <p>In DOcplex, one can somehow do it for global constraints such as all_diff, as follows:</p>
  
  <pre><code>import docplex.cp.model as cp
  
  NB_QUEEN = 8
  mdl = cp.CpoModel()
  x = cp.integer_var_list(NB_QUEEN, 0, NB_QUEEN - 1, "X")
  
  # add the constraints to the model
  mdl.add(mdl.all_diff(x[i] + i for i in range(NB_QUEEN)))
  
  # print the constraints
  test_constraint = mdl.all_diff(x[i] - i for i in range(NB_QUEEN))
  print(test_constraint)
  </code></pre>
  
  <p>which will print:</p>
  
  <pre><code>alldiff([X_0 - 0, X_1 - 1, X_2 - 2, X_3 - 3, X_4 - 4, X_5 - 5, X_6 - 6, X_7 - 7])
  </code></pre>
  
  <p>Is there a way to print the expanded version of the following constraints?</p>
  
  <pre><code> mdl.add(mdl.sum( X[i]+j for j in R1) ==1 for i in R2)
  </code></pre>
  
  <p>Simply calling the print() on the above constraitns won't do.</p>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Thanks to Alex Fleischer, I made a small working example that follows, showing how to print a constraint from a set of constraints.</p>
  
  <pre><code>x = mdl.integer_var_list(5, name='X')
  ct = ( [1 == sum( x[i]+j for i in range(0, 5) ) for j in range(0,5) ])
  print(ct[2])
  </code></pre>
  
  <p>which prints</p>
  
  <pre><code>0 + (X_0 + 2) + (X_1 + 2) + (X_2 + 2) + (X_3 + 2) + (X_4 + 2) == 1
  </code></pre>
  
  <p>If one wishes to print all constraints in the set, they may do</p>
  
  <pre><code>for j in range(0, 5)
      print(c[j])
  </code></pre>