isa-group/IDLReasoner

Recreate constraints file before executing any analysis operation

Closed this issue · 1 comments

AML14 commented

When the analyzer object is created, it should initialize a mapper and a resolutor. The mapper, in turn, should initialize two mappers, the constraintMapper and the variableMapper IN THIS ORDER, because the constraintMapper will delete the file and recreate it (due to how the Xtext generator is implemented). The variable mapper will append the variables to the beginning of the file.

Any analysis operation will make changes to the constraints file, therefore, the file should be recreated prior to the execution of the operation.

AML14 commented

Done. However, there is a slight change: there's an auxiliary file called "base_constraints.mzn" which is created only once, when the mappers are constructed. Then, when an analysis operation is run, the file "full_constraints.mzn" is recreated and the contents of "base_constraints.mzn" are copied on it.