An Application of Abstract Interpretation to Floating point

prototype level). Using Abstract data types. (ADT) for both ... Starting from a cancellation problem observed using simple precision on. CDC, (14 decimal digits).
104KB taille 2 téléchargements 342 vues
.

An Application of Abstract Interpretation to Floating point Arithmetic Yamine A¨ıt Ameur Patrice Cros Juan Jose´ Falcon ´ ´ Alicia Gomez ONERA/CERT-DERI, 2 Ave E. Belin BP 4025, 31055 Toulouse Cedex

Bordeaux, WSA’ 92

Controlling precision in arithmetic expressions

Plan – – – – –

Introduction and Model Formalization Abstract Interpretation Experiment and Prototype Conclusion

WSA’92

1

Bordeaux, September 23–25, 1992

A. Introduction

A Introduction This work was partially supported by CNES as an “Action d’accompagnement” in the AQUARELS project.

A.1 Framework

}

Algorithm

}

Formalization at discrete level

} WSA’92

2

Bordeaux, September 23–25, 1992

A. Introduction

A.2 Model

– Notations 

• Arithmetic at Algorithm level,   • Several Arithmetics at Machine level,

– Assumptions •

  

enriched by annotations describing precision constraints

– Correspondance



 

  

• analysis to define required precision.   • Precision control defined as choice.  • Arrow, ( ) as compilation mechanism.

WSA’92

3

Bordeaux, September 23–25, 1992

B.

B !

  

Formalization

Formalization

B.1 Formalism for – First order language without control structure – Arithmetic expression • Floating point number (as defined by Knuth) • Floating point operations (only "$#$%&#(')# * ) +

B.2 Formalism for

– IEEE754 Standard to take into account exceptions such as, • overflow • underflow • ...

B.3 Formalism for “



Such an arrow must contain, – Some control, in order to make a choice between ,-.0/1 , (static level). – ,--1 interpretation to define (non standard) calculation at precision level. – Mechanism allowing to fix the choice done, (for validation purpose at prototype level).

Using Abstract data types (ADT) for both and

WSA’92

4

2

Bordeaux, September 23–25, 1992

C. Abstract interpretation of

3 4546

C Abstract interpretation of

C.1 Normalized floating point numbers: Finite Set

.

Using base 10 for example, let 798

,;:=A@CBD1

be the floating point number set, (m and e stand for mantissa and exponent). – for all studied programs in ,--1 , there exists a theoretical “minimum” number of significant digits for mantissa and exponent, such that exceptions do not occur. – Let E and F be those values. .

8 ]

8

,
P&:RQTSVUPWQBYXW
P&:RQVSC_`PWQBaXb@XZ:RQVSc_d[eQB\1 7f8 ] 8 . g ,h:iA@kB\1

C.2 Concrete domain – Defined with, 7

• constants, • arithmetic expressions, ( [O>lP&>g)>^m ) • first order functions.

WSA’92

5

Bordeaux, September 23–25, 1992

C. Abstract interpretation of

3 4546

C.3 Abstract domain – Constants, (property) noqpr 7

Ps

:iL@tBaPsu

-

pVv > pVwx

s stands for size (number of significant digits which is the studied property, “precision”). – lower bound : u – upper bound : u

Sy>zS E{>zF

x x

– Powerset extension 7 - o|p rk} : BYPs -

– Equations n G~7 ,€€/1G } : B q‚tƒ„r -fP…s } : 7 B q‚kƒ„ : n B 8

,S1 7 ,t€/‡1

n 8 † u Sy>zS x n 8 u?E{>zF x n 8 u pv > pwˆx

8 n - o|p : | ‚tƒ„ : n BRB q‚kƒ„ :=- qo p t , €/1tBŠ‰,t€/1

WSA’92

6

Bordeaux, September 23–25, 1992

C. Abstract interpretation of

C.4 Lifted operations, ( ‹

‹

‹

‹

3 4546

)

– Addition uŒz@ x

[WuŽ