Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


SSL safe_arith.pvs  Sprache: unbekannt

 
safe_arith : THEORY
BEGIN

% 
% The comparison interval operators defined in this theory return false when the interval 
% operand is empty. The arithmetic interval operators defined in this theory return an empty 
% interval when one of the operands is empty (or in the case of division a non-zero divisor).
%
% The theory symbols_as_safe defines the symbols <,<=,>,>=,+,-,*,/,^ using the functions in this theory
%

  IMPORTING interval

  X,Y : VAR Interval
  x,y : VAR real
  n   : VAR nat

  safe_Lt(X,x) : bool =
    Proper?(X) AND Lt(X,x)

  safe_Le(X,x) : bool =
    Proper?(X) AND Le(X,x)

  safe_Gt(X,x) : bool =
    Proper?(X) AND Gt(X,x)

  safe_Ge(X,x) : bool =
    Proper?(X) AND Ge(X,x)

  op1 : VAR [Interval->Interval]
  pre : VAR PRED[Interval]
  op2 : VAR [Interval,Interval->Interval]    

  Safe1(op1)(X) : Interval =
    IF Proper?(X) THEN op1(X)
    ELSE EmptyInterval
    ENDIF

  Proper_Safe1 : LEMMA
    Proper?(Safe1(op1)(X)) IMPLIES
      Proper?(X) AND 
      Safe1(op1)(X) = op1(X)

  Safe1(pre,op1)(X) : Interval =
    IF pre(X) THEN Safe1(op1)(X)
    ELSE EmptyInterval
    ENDIF

  Proper_Safe1_pre : LEMMA
    Proper?(Safe1(pre,op1)(X)) IMPLIES
      pre(X) AND Proper?(X) AND
      Safe1(pre,op1)(X) = op1(X)

  Safe2(op2)(X,Y): Interval =
    IF Proper?(X) AND Proper?(Y) THEN op2(X,Y)
    ELSE EmptyInterval
    ENDIF

  Proper_Safe2 : LEMMA
    Proper?(Safe2(op2)(X,Y)) IMPLIES
      Proper?(X) AND Proper?(Y) AND 
      Safe2(op2)(X,Y) = op2(X,Y)

  safe_Add :  [Interval,Interval->Interval] = Safe2(Add)

  safe_Sub :  [Interval,Interval->Interval] = Safe2(Sub)

  safe_Neg :  [Interval->Interval] = Safe1(Neg)

  safe_Abs:  [Interval->Interval] = Safe1(Abs)

  safe_Mult:  [Interval,Interval->Interval] = Safe2(Mult)

  safe_Sq: [Interval->Interval] = Safe1(Sq)

  safe_Pow(X,n) : Interval =
    IF Proper?(X) THEN Pow(X,n)
    ELSE EmptyInterval
    ENDIF

  safe_Div(X,Y) : Interval =
    IF Zeroless?(Y) THEN Safe2(Div)(X,Y)
    ELSE EmptyInterval
    ENDIF

END safe_arith

Messung
CHZG
8110010093

[Verzeichnis aufwärts0.117unsichere VerbindungÜbersetzung europäischer Sprachen durch Browser2026-11-24]

                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,187,963
#Domains=975,864