%% Comparison and arithmetic interl operators defined in this theory assume, without checking, %% that their operands are non-empty. Their correctness lemmas have as hypotheses that the operands %% are "proper", e.g., non-empty. Proper and safe versions arithmetic operators are defined in %% the theories proper_arith and safe_arith. %% %% Since version 6.0.5 of the NASA PVS Library, symbols <,<=,>,>=,+,-,*,/,^ are no longer used in %% the interval arithmetic library. For convenience and backward compatibility the following theories %% are provided: %% - symbols_as_interval: Defines those symbols as the basic interval operators defined in this theory. %% - symbols_as_proper: Defines those symbols as the interval operators defined in the theory proper_arith. %% - symbols_as_safe: Defines those symbols as the interval operators defined in the theory safe_arith. %% To avoid name clashes only one these 3 theories may be included in an imported chain.
IMPORTING reals@sq,reals@sigma_nat,ints@div_nat
%%------------------- %% Type and Notations %%-------------------
Interval : TYPE = [#
lb : real,
ub : real
#]
X,Y,Z : VAR Interval
x,y : VAR real
n : VAR nat
i : VAR int
p : VAR posnat
f : VAR [nat->real]
F : VAR [nat->Interval]
%%---------- %% Operators %%----------
;##(x,X) : bool =
lb(X) <= x AND x <= ub(X)
% membership
Member?(X)(x) : MACRO bool =
x ## X
CONVERSION Member?
% Type of reals in interval X
IntervalType(X) : TYPE = (Member?(X))
% Absolute value
Abs(X) : (NonNeg?) = if Zeroin?(X) then
[|0,max(abs(lb(X)),abs(ub(X)))|] else
[|min(abs(lb(X)),abs(ub(X))),max(abs(lb(X)),abs(ub(X)))|] endif
% pos * med
pXm(X,Y) : Interval =
[|ub(X)*lb(Y),ub(X)*ub(Y)|]
% med * pos
mXp(X,Y) : Interval =
pXm(Y,X)
% neg * med
nXm(X,Y) : Interval =
Neg(pXm(Neg(X),Y))
% med * neg
mXn(X,Y) : Interval =
nXm(Y,X)
% med * med
mXm(X,Y) : Interval =
[|min(lb(X)*ub(Y),ub(X)*lb(Y)),
max(lb(X)*lb(Y),ub(X)*ub(Y))|]
% Multiplication
Mult(X,Y) : Interval = IF Ge(X,0) AND Ge(Y,0) THEN pXp(X,Y) ELSIF Ge(X,0) AND Le(Y,0) THEN pXn(X,Y) ELSIF Ge(X,0) THEN pXm(X,Y) ELSIF Le(X,0) AND Le(Y,0) THEN nXn(X,Y) ELSIF Le(X,0) AND Ge(Y,0) THEN nXp(X,Y) ELSIF Le(X,0) THEN nXm(X,Y) ELSIF Ge(Y,0) THEN mXp(X,Y) ELSIF Le(Y,0) THEN mXn(X,Y) ELSE mXm(X,Y) ENDIF
% Square function
Sq(X) : (NonNeg?) = IF Ge(X,0) THEN [|sq(lb(X)),sq(ub(X))|] ELSIF Le(X,0) THEN [|sq(ub(X)),sq(lb(X))|] ELSE [|0,max(sq(lb(X)),sq(ub(X)))|] ENDIF
% Power by a natural number
Pow(X,n) : Interval = IF n = 0 THEN [|1|] ELSIF Ge(X,0) OR odd?(n) THEN [|lb(X)^n,ub(X)^n|] ELSIF Le(X,0) THEN [|ub(X)^n,lb(X)^n|] ELSE [|0,max(lb(X)^n,ub(X)^n)|] ENDIF
% Division
Div(X,Y) : Interval = IF ub(Y) /= 0 AND lb(Y) /= 0 then Mult(X,[|1/ub(Y),1/lb(Y)|]) ELSE EmptyInterval ENDIF
% Union
Union(X,Y) : Interval =
[|min(lb(X),lb(Y)),max(ub(X),ub(Y))|]
%%----------------- %% Fundamental Lemmas %%-----------------
X1,Y1 : VAR Interval
Add_fundamental : LEMMA
X1 << X AND Y1 << Y IMPLIES
Add(X1,Y1) << Add(X,Y)
Sub_fundamental : LEMMA
X1 << X AND Y1 << Y IMPLIES
Sub(X1,Y1) << Sub(X,Y)
Abs_fundamental : LEMMA
Proper?(X) AND
X << Y IMPLIES
Abs(X) << Abs(Y)
Neg_fundamental : LEMMA
X << Y IMPLIES
Neg(X) << Neg(Y)
pXp_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Ge(X,0) AND Ge(Y,0) AND
X1 << X AND Y1 << Y IMPLIES
Mult(X1,Y1) << Mult(X,Y)
pXpm_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Ge(X,0) AND Zeroin?(Y) AND
X1 << X AND Y1 << Y AND Ge(Y1,0) IMPLIES
Mult(X1,Y1) << Mult(X,Y)
pXmm_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Ge(X,0) AND Zeroin?(Y) AND
X1 << X AND Y1 << Y AND Zeroin?(Y1) IMPLIES
Mult(X1,Y1) << Mult(X,Y)
pX_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Ge(X,0) AND
X1 << X AND Y1 << Y IMPLIES
Mult(X1,Y1) << Mult(X,Y)
nX_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Le(X,0) AND
X1 << X AND Y1 << Y IMPLIES
Mult(X1,Y1) << Mult(X,Y)
pmXpm_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Zeroin?(X) AND Zeroin?(Y) AND
X1 << X AND Y1 << Y AND Ge(X1,0) AND Ge(Y1,0) IMPLIES
Mult(X1,Y1) << Mult(X,Y)
pmXmm_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Zeroin?(X) AND Zeroin?(Y) AND
X1 << X AND Y1 << Y AND Ge(X1,0) AND Zeroin?(Y1) IMPLIES
Mult(X1,Y1) << Mult(X,Y)
mmXmm_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Zeroin?(X) AND Zeroin?(Y) AND
X1 << X AND Y1 << Y AND Zeroin?(X1) AND Zeroin?(Y1) IMPLIES
Mult(X1,Y1) << Mult(X,Y)
mX_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
Zeroin?(X) AND X1 << X AND Y1 << Y IMPLIES
Mult(X1,Y1) << Mult(X,Y)
Mult_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
X1 << X AND Y1 << Y IMPLIES
Mult(X1,Y1) << Mult(X,Y)
Sq_p_fundamental : LEMMA
Proper?(X1) AND
X1 << X AND Ge(X,0) IMPLIES
Sq(X1) << Sq(X)
Sq_pm_fundamental : LEMMA
Proper?(X1) AND
X1 << X AND Zeroin?(X) AND Ge(X1,0) IMPLIES
Sq(X1) << Sq(X)
Sq_fundamental : LEMMA
Proper?(X1) AND
X1 << X IMPLIES
Sq(X1) << Sq(X)
Div_fundamental : LEMMA
Proper?(X1) AND Proper?(Y1) AND
X1 << X AND Y1 << Y AND Zeroless?(Y) IMPLIES
Div(X1,Y1) << Div(X,Y)
Pow_p_fundamental : LEMMA
Proper?(X1) AND
X1 << X AND n > 0 AND (odd?(n) OR Ge(X,0)) IMPLIES
Pow(X1,n) << Pow(X,n)
Pow_pm_fundamental : LEMMA
Proper?(X1) AND
X1 << X AND n > 0 AND even?(n) AND Zeroin?(X) AND Ge(X1,0) IMPLIES
Pow(X1,n) << Pow(X,n)
Pow_m_fundamental : LEMMA
Proper?(X1) AND
X1 << X AND n > 0 AND even?(n) AND Zeroin?(X) IMPLIES
Pow(X1,n) << Pow(X,n)
Pow_fundamental : LEMMA
Proper?(X1) AND
X1 << X IMPLIES
Pow(X1,n) << Pow(X,n)
Union_fundamental : LEMMA
X1 << X AND
Y1 << Y IMPLIES
Union(X1,Y1) << Union(X,Y)
Includes?(x)(X:Interval) : bool = x ## X
Inclusion?(Pre:PRED[Interval],f:[real->real])(F:[Interval->Interval]):bool = FORALL(x:real,X:(Pre)): x ## X IMPLIES f(x) ## F(X)
Fundamental?(Pre:PRED[Interval])(F:[Interval->Interval]):bool = FORALL(X1:ProperInterval,X:(Pre)): X1 << X IMPLIES F(X1) << F(X)
Precondition?(Pre:PRED[Interval]):bool = FORALL (X1:ProperInterval,X:Interval): X1 << X AND Pre(X) IMPLIES Pre(X1)
Mult_Strict_r2i : LEMMA
StrictInterval?(X) AND
x /= 0 IMPLIES
StrictInterval?(Mult([|x|],X))
Mult_r2i_Strict : LEMMA
StrictInterval?(X) AND
x /= 0 IMPLIES
StrictInterval?(Mult([|x|],X))
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.18Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.