Search code examples
constraint-programmingminizinccoin-or-cbcgecodehighs

Constraint solver that can handle floating point exponentiation


Are there any constraint solvers that can understand exponentiation of potentially unbounded floats aka. real numbers?

Given this simple program,

var float: x;
constraint x^x = 27;
solve satisfy;

I have tried Gecode, HiGHS, COIN-BC, and Chuffed.

Chuffed just doesn't support floats:

Type var float is currently not supported by Chuffed.

The others don't understand the power operator:

Error: solver backend cannot handle constraint: float_pow

Ideally I am looking for a solver with a Zinc frontend, although this is not a must.


Solution

  • JaCoP solver generates the following solution.

    %% WARNING: constraint float_pow is not defined for negative numbers as first argument (decomposition x^y = exp(y*ln(x))); x::{-1.0E150..1.0E150} has minimal value negative (will be pruned).
    x = 3.0;
    ----------
    ==========