Improve support for named variables
Named variables are weakly supported by class Model. When constructing solvers, each named variable is assigned a running index; consequently, the solvers internally know variables only by their index.
This construction lead to inconveniencies. We could improve:
- in the definition of constraint and function classes, the conversion needs to be done explicitly (using the idx method of the model). This could possibly be improved by implicitly passing the dependency lists returned by the init function through model.idx if it contains named variable descriptions.
- Named variable descriptions look ugly ('Y',i) - nicer would be Y(i), but this would require to define Y as a class...; names like "Y_7" (or even "Y7"), which could be generated as f"Y_{i}" is possible. This could simplify the named var support dramatically and lead to nicer syntax - so, consider regulated strings for variables.
- Model could provide high level functions to maintain variables, eg. return a list of variable names; a range of indices for a named var series...
- Tree decompositions are not generated with proper variable names (only with raw internal indices), since this requires knowledge from model. We could by default postprocess tree decompositions before plotting by re-translating internal variable indices to named vars
Edited by WILL Sebastian