From e4feaf8a11380589bd52d3a133f5b8e0dc86f08b Mon Sep 17 00:00:00 2001 From: wout4 Date: Thu, 6 Jun 2024 16:00:56 +0200 Subject: [PATCH] fix subcircuit with variables. Add todo in globals --- cpmpy/expressions/globalconstraints.py | 2 +- xcsp3/executable/callbacks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpmpy/expressions/globalconstraints.py b/cpmpy/expressions/globalconstraints.py index 9cc88b9ce..d1556b1eb 100644 --- a/cpmpy/expressions/globalconstraints.py +++ b/cpmpy/expressions/globalconstraints.py @@ -1266,7 +1266,7 @@ def decompose(self): args, precedence = self.args if not isinstance(args, NDVarArray): - args = cpm_array(args) + args = cpm_array(args) #TODO i think we can do this in the init, also should go to master constraints = [] for s,t in zip(precedence[:-1], precedence[1:]): for j in range(len(args)): diff --git a/xcsp3/executable/callbacks.py b/xcsp3/executable/callbacks.py index f4c70c798..592f2626f 100644 --- a/xcsp3/executable/callbacks.py +++ b/xcsp3/executable/callbacks.py @@ -661,7 +661,7 @@ def ctr_clause(self, pos: list[Variable], neg: list[Variable]): # not in XCSP3- self._unimplemented(pos, neg) def ctr_circuit(self, lst: list[Variable], size: None | int | Variable): # size is None in XCSP3 competitions - self.cpm_model += cp.SubCircuitWithStart(lst, start_index=0) + self.cpm_model += cp.SubCircuitWithStart(self.get_cpm_vars(lst), start_index=0) # # # # # # # # # # # All methods about objectives to be implemented