/usr/share/swi-prolog/pack/clpBNR/prolog/clpBNR_toolkit.pl
All Application Manual Name SummaryHelp

  • clpBNR
    • prolog
      • clpBNR.pl -- clpBNR: Constraint Logic Programming over Continuous Domain of Reals
      • clpBNR_toolkit.pl -- clpBNR_toolkit: Toolkit of various utilities used for solving problems with clpBNR
        • iterate_until/3
        • mid_split_one/1
        • mid_split/1
        • cf_contractor/2
        • cf_solve/1
        • cf_solve/2
        • taylor_contractor/2
        • taylor_merged_contractor/2
        • lin_minimum/3
        • lin_maximum/3
        • lin_minimize/3
        • lin_maximize/3
        • local_minima/1
        • local_maxima/1
        • local_minima/2
        • local_maxima/2
 taylor_contractor(+Constraints, -Contractor) is semidet
Succeeds if a centre form contractor Contractor can be generated from one or more multivariate equality (== or =:=) constraints Constraints; otherwise fails. Example:
?- taylor_contractor({X**4-4*X**3+4*X**2-4*X+3==0},T).
T = cf_contractor([X], [_A]),
X::real(-1.509169756145379, 4.18727500493995),
_A::real(-1.0Inf, 1.0Inf).

Use the contractor with cf_solve to search for solutions, as in:

?- X::real,taylor_contractor({X**4-4*X**3+4*X**2-4*X+3==0},T), cf_solve(T).
T = cf_contractor([X], [_A]),
X:: 1.000000000...,
_A::real(-1.0Inf, 1.0Inf) ;
T = cf_contractor([X], [_A]),
X:: 3.00000000...,
_A::real(-1.0Inf, 1.0Inf) ;
false.

Multiple equality constraints are supported, as in this example of the Broyden banded problem (N=2):

?- taylor_contractor({2*X1+5*X1**3+1==X2*(1+X2), 2*X2+5*X2**3+1==X1*(1+X1)},T), cf_solve(T).
T = cf_contractor([X2, X1], [_A, _B]),
X1:: -0.42730462...,
X2:: -0.42730462...,
_B::real(-1.0Inf, 1.0Inf),
_A::real(-1.0Inf, 1.0Inf) ;
false.

Centre form contractors can converge faster than the general purpose builtin fixed point iteration provided by solve/1.

See also
- cf_solve/1