It looks like the propagator can behave strangely when the input and/or outputs of an execution_declare/5 constraint are connected to variables that are "defined" rather than "declared".
variable_declare(x,xin1,fromFacts).
variable_domain(xin1,val(int,0)).
variable_domain(xin1,val(int,1)).
variable_declare(x,xin2,fromFacts).
variable_domain(xin2,val(int,0)).
variable_domain(xin2,val(int,1)).
%variable_define(x,execution_input(constraint,in1),variable(xin1)). % alternative
variable_declare(x,execution_input(constraint,in1),fromFacts).
variable_domain(execution_input(constraint,in1),variable(xin1)).
%variable_define(x,execution_input(constraint,in2),variable(xin2)). % alternative
variable_declare(x,execution_input(constraint,in2),fromFacts).
variable_domain(execution_input(constraint,in2),variable(xin2)).
ensure(x,operation(eq,(variable(execution_output(constraint,out)),(variable(xout),())))).
%variable_define(x,xout,val(int,0)). % alternative
variable_declare(x,xout,fromFacts).
variable_domain(xout,val(int,0)).
execution_run(x,constraint).
execution_declare(x,constraint,assign(out,operation(add,(variable(in1),(variable(in2),())))),(in1,(in2,())),(out,())).
defaultEngine(propagator).
It looks like the propagator can behave strangely when the input and/or outputs of an
execution_declare/5constraint are connected to variables that are "defined" rather than "declared".Consider the example below of
constraintthat takes external inputs from variablesxin1andxin2and outputs their sum to external variablexout. Variablesxin1andxin2can both take values 0 or 1, butxoutis fixed to 0; so there is only a single solution where all external variables are set to 0.When the external variables are specified with
variable_declare/3andvariable_domain/2everything works fine, but when I usevariable_define/3I get different behaviour:xoutis specified withvariable_define/3then I get UNSAT.xin1orxin2are specified withvariable_define/3then it works, but if both are specified withvariable_define/3then I get UNSAT.