1:- module(interval, [interval/2, interval/3, op(150, xfx, ...)]).
interval(sqrt(A), Res)
'interval(sqrt1(A), Res)
'interval(A^atomic(N), Res)
' or 'interval(A**atomic(N), Res)
' with N being a natural numberinterval(exp(A))
, Res)'interval(abs(A), Res)
'interval(sin(A), Res)
'interval(+(A), Res)
'interval(-(A), Res)
'interval(max(A, B), Res)
'interval(min(A, B), Res)
'atomic(2)
), Res)'32:- set_prolog_flag(float_overflow, infinity). 33:- set_prolog_flag(float_undefined, nan). 34:- set_prolog_flag(float_zero_div, infinity). 35 36:- nb_setval(digits, 2). 37 38:- consult(['../inst/prolog/lib/interface', 39 '../inst/prolog/lib/op', 40 '../inst/prolog/lib/eval', 41 '../inst/prolog/lib/utility']).
Perform arithmetic operations with intervals.
An interval is represented as L...U, where L stands for the lower bound and U for the upper bound. If the upper bound is a negative number, it has to be written with an additional space, e.g., -3... -2, or in the infix notation, ...(-3, -2). The choice of using consult and not the module system is motivated by need for more flexibility. */