Analyse statique de programmes numériques avec calculs flottants

Size: px
Start display at page:

Download "Analyse statique de programmes numériques avec calculs flottants"

Transcription

1 Analyse statique de programmes numériques avec calculs flottants 4ème Rencontres Arithmétique de l Informatique Mathématique Antoine Miné École normale supérieure 9 février 2011 Perpignan 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 1 / 63

2 Outline Introduction 1 Introduction Main goals Theoretical background 2 Rational Abstractions Interval domain Polyhedra domain 3 Floating-Point Abstractions Floating-point semantics Floating-point interval domain Expression linearization Floating-point polyhedra 4 Conclusion 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 2 / 63

3 Introduction Introduction 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 3 / 63

4 Static analysis Introduction Main Goals Goal: static analysis [CousotCousot-ISP76] Static (automatic) discovery of dynamic (semantic) properties of programs. Applications: compilation and optimisation, e.g.: array bound check elimination alias analysis verification, e.g.: infer invariants prove the absence of run-time errors (division by zero, overflow, invalid array access) prove functional properties We focus here on numerical properties of numerical variables. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 4 / 63

5 Introduction Main Goals Example: discovering numerical invariants Insertion Sort for i=1 to 99 do p := T[i]; j := i+1; while j <= 100 and T[j] < p do T[j-1] := T[j]; j := j+1; end; T[j-1] := p; end; 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 5 / 63

6 Introduction Main Goals Example: discovering numerical invariants Interval analysis: Insertion Sort for i=1 to 99 do i [1, 99] p := T[i]; j := i+1; i [1, 99], j [2, 100] while j <= 100 and T[j] < p do i [1, 99], j [2, 100] T[j-1] := T[j]; j := j+1; i [1, 99], j [3, 101] end; i [1, 99], j [2, 101] T[j-1] := p; end; = there is no out of bound array access 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 5 / 63

7 Introduction Main Goals Example: discovering numerical invariants Linear inequality analysis: Insertion Sort for i=1 to 99 do i [1, 99] p := T[i]; j := i+1; i [1, 99], j = i + 1 while j <= 100 and T[j] < p do i [1, 99], i + 1 j 100 T[j-1] := T[j]; j := j+1; i [1, 99], i + 2 j 101 end; i [1, 99], i + 1 j 101 T[j-1] := p; end; 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 5 / 63

8 Theoretical background Introduction Theoretical Background Abstract interpretation: unifying theory of program semantics [CousotCousot-POPL77] Provide theoretical tools to design and compare static analyses that: always terminate are approximate (solve undecidability and efficiency issues) are sound by construction (no behavior is omitted) Analysis design roadmap: 1 concrete semantics 2 abstract domains 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 6 / 63

9 Concrete semantics Introduction Theoretical Background Concrete semantics: most precise mathematical expression of the program behavior Example: from programs (CFGs) to equation systems entry X 1 = D (initial states) 1 X:=?(0,10) X 2 = C X :=?(0, 10) X 1 2 X 3 = C Y := 100 X 2 Y:=100 loop 3 X<0 C Y := Y + 10 X 5 invariant X>=0 6 X 4 = C X 0 X 3 4 X 5 = C X := X 1 X 4 X:=X 1 Y:=Y+10 X 6 = C X < 0 X 3 5 V = {X, Y} variables D = P(V Q) sets of environments X i D reachable environments at location i C c X models the effect of command c on X 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 7 / 63

10 Introduction Concrete semantics (cont.) Theoretical Background Semantics of (non-deterministic) expressions and commands. E e : (V Q) P(Q) E c ρ E?(c, c ) ρ E V ρ E e ρ E e 1 e 2 ρ (expression semantics) = { c } = { x c x c } = { ρ(v) } = { v v E e ρ } = { v 1 + v 2 v 1 E e 1 ρ, v 2 E e 2 ρ } {+,,, /} ( / v 2 0) C c : P(V Q) P(V Q) C V :=e X C e 0 X (command semantics) = { ρ[ V v ] ρ X, v E e ρ } = { ρ ρ X, v E e ρ, v 0 } (can be extended to actual programming languages!) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 8 / 63

11 Introduction Concrete semantics (cont.) Theoretical Background equations have the form: X i = F i (X 1,..., X n ) (P(V Q),,, ) is a complete lattice all the F i are monotonic (A B = C c A C c B) Constructive version of Tarski s theorem by [Tarski-PJM55] and [CousotCousot-PJM79] the system has a least solution (least fixpoint of F i ) it is the limit of: X 0 i = X k+1 i = F i (X1 k,..., X n k ) for successor ordinals Xi o = δ<o X i δ for limit ordinals (many kinds of semantics can be expressed in fixpoint form [Cousot-ENTCS97]) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 9 / 63

12 Undecidability Introduction Theoretical Background elements in P(V Q) are not computer-representable C and are not computable least solutions of equations are not computable (requiring transfinite iterations) = we use computable abstractions i.e.: computable sound over-approximations 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 10 / 63

13 Abstract domains Introduction Theoretical Background Abstract elements: D set of computer-representable elements γ : D D concretization approximation order: X Y = γ(x ) γ(y ) Abstract operators: C c : D D and : (D D ) D soundness: (C c γ)(x ) (γ C c )(X ) γ(x ) γ(y ) γ(x Y ) Fixpoint extrapolation : (D D ) D widening soundness: γ(x ) γ(y ) γ(x Y ) termination: sequence (Y i ) i N the sequence X 0 = Y 0, X i+1 = X i Y i+1 stabilizes in finite time: n < ω, X n+1 = X n Both semantics and algorithmic aspects. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 11 / 63

14 Abstract analysis Introduction Theoretical Background Principles: compute entirely in D replace C c with C c in equations iterate, using widening at loop heads W X i, 0 X i, k+1 = { F i (X 1, k,..., X n, k ) = X i, k F i (X 1, k,..., X n, k ) if i / W if i W Theorem: the iterations stabilize in finite time δ < ω: X i, δ+1 = X i, δ the result is sound: X i γ(x i, δ ) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 12 / 63

15 Introduction Theoretical Background Some existing numerical abstract domains Intervals Xi [a i, b i ] [CousotCousot-ISP76] Simple Congruences Xi a i [b i ] [Granger-JCM89] Linear Equalities i α ix i = β [Karr-AI76] Linear Congruences i α ix i β [γ] [Granger-TAPSOFT91] 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 13 / 63

16 Introduction Theoretical Background Some existing numerical abstract domains (cont.) Polyhedra i α ix i β [CousotHalbwachs-POPL78] Octagons ±Xi ± X j β [Miné-WCRE01] Ellipsoids αx 2 i + βx 2 j + γx i Y i δ [Feret-ESOP04] Varieties P( X) = 0, P R[V] [SankaranarayananAl-POPL04] 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 14 / 63

17 Introduction Precision vs. cost tradeoff Theoretical Background Example: three abstractions of the same set of points Worst-case time cost per operation wrt. number of variables: polyhedra: exponential octagons: cubic intervals: linear 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 15 / 63

18 Rational Abstractions Rational Numerical Abstract Domains 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 16 / 63

19 Rational Abstractions Interval Domain Interval Domain 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 17 / 63

20 Rational Abstractions Interval abstract elements Interval Domain Abstract elements: I = { (a, b) a Q { }, b Q {+ }, a b } (intervals as pairs of bounds) D Concretization: = (V I) { } γ( ) = γ(x ) = { ρ V, ρ(v) γ I (X (V)) } if X where γ I (a, b) = { x Q a x b } Order: X Y where (a, b) I (a, b ) { X = X, Y V, X (V) I Y (V) a a b b 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 18 / 63

21 Rational Abstractions Interval abstract operators Interval Domain Interval arithmetics in I I (a, b) (a, b) + I (c, d) (a, b) I (c, d) (a, b) I (c, d) (a, b) I (c, d). = ( b, a) = (a + c, b + d) = (a d, b c) = (min(ac, ad, bc, bd), max(ac, ad, bc, bd)) = (min(a, c), max(b, d)) Join in D X Y = X Y λv. X (V) I Y (V) if Y = if X = if X, Y (optimal, but not exact: γ(x ) γ(y ) γ(x Y )) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 19 / 63

22 Interval assignment Rational Abstractions Interval Domain E e : D I (abstract expression evaluation, X ) E c X E?(c, c ) X E V X E e X E e 1 e 2 X = (c, c) = (c, c ) = X (V) = I E e X = E e 1 X I E e 2 X C c : D D C V :=e X = (abstract command semantics) { if X = X [ V E e X ] if X 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 20 / 63

23 Interval test example Rational Abstractions Interval Domain C X + Y Z 0 X, with X = {X (0, 10), Y (2, 10), Z (3, 5)} X (0, 10) + (, + ) - (, + ) Y (2, 10) Z (3, 5) X (0, 10) + (2, 20) - ( 3, 17) Y (2, 10) Z (3, 5) X (0, 10) + (2, 20) - ( 3, 0) Y (2, 10) Z (3, 5) X (0, 3) + (2, 5) - ( 3, 0) Y (2, 5) Z (3, 5) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 21 / 63

24 Interval widening Rational Abstractions Interval Domain Classic widening in D X X Y where = (a, b) I (c, d) = Y λv. X (V) I Y (V) ({ a if a c otherwise, if Y = if X = if X, Y { b if b d + otherwise ) Unstable bounds are set to ± Widening with thresholds: Parametrized by a finite set T. If b < d, bump to the next value in T greater than d (or + ). 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 22 / 63

25 Rational Abstractions Interval analysis example Interval Domain Analysis example with W = {2} X< X:=0 X>=40 4 X:=X+1 l 1 2 = 0 = = 0 = 0 [0, 39] [0, 39] X 0 l More precisely, at the widening point: X 1 X 2 X 3 X 4 X 1 l X 2 l X 3 l X 4 l 2 = ([0, 0] ) = [0, 0] = [0, 0] 2 = [0, 0] ([0, 0] ) = [0, 0] [0, 0] = [0, 0] 2 = [0, 0] ([0, 0] [1, 1]) = [0, 0] [0, 1] = [0, + [ 2 = [0, + [ ([0, 0] [1, 40]) = [0, + [ [0, 40] = [0, + [ Note that the most precise interval abstraction would be X [0, 40] at 2, and X = 40 at 4. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 23 / 63 X 5 l

26 Rational Abstractions Polyhedra Domain Polyhedra Domain 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 24 / 63

27 Polyhedra domain Rational Abstractions Polyhedra Domain Domain proposed by [CousotHalbwachs-POPL78] to infer conjunctions of linear inequalities j ( n i=1 α ijv i β j ). Abstract elements: LinCons = linear constraints over V with coefficients in Q D Concretization: = P finite (LinCons) γ(x ) = { ρ V Q c X, ρ = c } γ(x ) is a closed convex polyhedron of (V Q) Q V γ(x ) may be empty, bounded, or unbounded γ is not injective 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 25 / 63

28 Polyhedra algorithms Rational Abstractions Polyhedra Domain Fourier-Motzkin elimination: Fourier(X, V k ) eliminates V k from all the constraints in X : Fourier(X, V k ) = { ( i α iv i β) X α k = 0 } { ( α k )c+ + α + k c c + = ( i α+ i V i β + ) X, α + k > 0, c = ( i α i V i β ) X, α k < 0 } Semantics γ(fourier(x, V k )) = { ρ[v k v] v Q, ρ γ(x ) } i.e., forget the value of V k 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 26 / 63

29 Polyhedra algorithms Rational Abstractions Polyhedra Domain Linear programming: [Schrijver-86] simplex(x, α) = min { i α iρ(v i ) ρ γ(x ) } Application: remove redundant constraints: for each c = ( i α iv i β) X if β simplex(x \ {c}, α), then remove c from X (e.g., Fourier causes a quadratic growth in constraint number, most of which are redundant) Note: calling simplex many times can be costly use fast syntactic checks first check against the bounding-box first use simplex as a last resort 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 27 / 63

30 Rational Abstractions Polyhedra abstract operators Polyhedra Domain Order: X Y X = Y ( i α iv i β) Y, simplex(x, α) β γ(x ) γ(y ) X Y Y X Join: [BenoyKing-LOPSTR96] We introduce temporaries V X j, V Y j, σ X, σ Y : = X Y Fourier( { ( j α jv X j βσ X 0) ( j α jv j β) X } { ( j α jv Y j βσ Y 0) ( j α jv j β) Y } { V j = V X j + V Y j V j V } { σ X 0, σ Y 0, σ X + σ Y = 1 }, { V X j, V Y j V j V } { σ X, σ Y } ) γ(x Y ) is the topological closure of the convex hull of γ(x ) and γ(y ) (optimal). 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 28 / 63

31 Rational Abstractions Polyhedra Domain Polyhedra abstract operators (cont.) Precise abstract commands: C i α iv i + β 0 X (exact) = X {( i α iv i + β 0)} C V j := [, + ] X = Fourier(X, V j )) C V j := i α iv i + β X = subst(v V i, Fourier((X {V = i α iv i + β}), V j )) Fallback abstract commands: C e 0 X = X (coarse but sound) C V j := e X = Fourier(X, V j ) alternate solution: apply interval abstract commands to the bounding box 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 29 / 63

32 Polyhedra widening Rational Abstractions Polyhedra Domain Classic widening in D X Y = { c X Y {c} } { c Y c X, X = (X \ c ) {c} } suppress unstable constraints c X, Y {c} add back constraints c Y equivalent to those in X i.e., when c X, X = (X \ c ) {c}. (X and Y must have no redundant constraint) Example: 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 30 / 63

33 Analysis example Rational Abstractions Polyhedra Domain Rate limiter Y:=0; while true do X:=?(-128,128); D:=?(0,16); S:=Y; Y:=X; R:=X-S; if R+D<=0 then Y:=S-D fi; if R-D>=0 then Y:=S+D fi od X: input signal Y: output signal S: last output R: delta Y-S D: max. allowed for R Polyhedra analysis: result: at, Y [ 128, 128] to prove, e.g., Y 128, the analysis needs to: represent the properties R = X S and R D combine them to deduce S X D, and then Y = S D X 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 31 / 63

34 Analysis example Rational Abstractions Polyhedra Domain Rate limiter Y:=0; while true do X:=?(-128,128); D:=?(0,16); S:=Y; Y:=X; R:=X-S; if R+D<=0 then Y:=S-D fi; if R-D>=0 then Y:=S+D fi od X: input signal Y: output signal S: last output R: delta Y-S D: max. allowed for R Interval analysis: iterations without widening: X,0 X,1 X,2... X,n Y = 0 Y 144 Y Y n i.e., not bound on Y can be found. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 31 / 63

35 Floating-point abstractions Floating-point abstractions 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 32 / 63

36 Floating-point abstractions Floating-point uses Two independent problems: Implement the analyzer using floating-point goal: trade precision for efficiency exact rational arithmetics can be costly coefficients can grow large (polyhedra) Analyze floating-point programs goal: catch run-time errors caused by rounding (overflow, division by 0,... ) Also: a floating-point analyzer for floating-point programs. Challenge: how to stay sound? 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 33 / 63

37 Floating-point abstractions Floating-point semantics Floating-point semantics 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 34 / 63

38 Floating-point abstractions Floating-point numbers Floating-point semantics IEEE standard is the most widespread format (supported by most processors and programming languages) IEEE Binary representation: a number is a triple s, e, f a 1-bit sign s a x-bit exponent e, with a bias (e represents e bias) a p-bit fraction f =.b 1... b p, (f represents i 2 i b i ) IEEE format examples given by the choice of x, bias, p: x = 8 32-bit single precision float: bias = 127 p = 23 Other widespread formats: 64-bit double, 80-bit double extended, 128-bit quad 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 35 / 63

39 Floating-point abstractions Floating-point representation Floating-point semantics Semantics s, e, f represents either: a normalized number: ( 1) s 2 e bias 1.f (if 1 e 2 x 2); a denormalized number: ( 1) s 2 1 bias 0.f (if e = 0, f 0); +0 or 0 (if e = 0, f = 0); + or (if e = 2 x 1, f = 0); an error code NaN (if e = 2 x 1, f 0). Visual representation (positive part) +0 mf Mf + mf Mf denormalized normalized = 2 1 bias p smallest positive = (2 2 p ) 2 2x bias 2 largest non- 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 36 / 63

40 Floating-point abstractions Floating-point computations Floating-point semantics The set of floating-point numbers is not closed under +,,, /: every result is rounded to a representable float, an overflow or division by 0 generates + or (overflow); small numbers are truncated to +0 or 0 (underflow); some operations are invalid (0/0, (+ ) + ( ), etc.) and return NaN. Simplified semantics: overflows and NaNs halt the program with an error Ω, rounding and underflow are not errors, we do not distinguish between +0 and 0. = variable values live in a finite subset F of Q, expression values live in F {Ω}. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 37 / 63

41 Floating-point abstractions Floating-point expressions Floating-point semantics Floating-point expressions exp f exp f ::= [c, c ] constant range c, c F, c c V variable V V exp f negation exp f r exp f operator {,,, } (we use circled operators to distinguish them from operators in Q) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 38 / 63

42 Floating-point abstractions Concrete semantics of expressions Floating-point semantics Semantics of rounding: R r : Q F {Ω}. 4 rounding modes r: towards +,, 0, or to nearest n. Example inition: R + (x) = R (x) = { min { y F y x } if x Mf Ω if x > Mf { max { y F y x } if x Mf Ω if x < Mf Notes: x, r, R (x) R r (x) R + (x) r, R r is monotonic 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 39 / 63

43 Floating-point abstractions Floating-point semantics Concrete semantics of expressions (cont.) E e f : (V F) P(F {Ω}) (expression semantics) E V ρ = { ρ(v) } E [c, c ] ρ = { x F c x c } E e f ρ = { x x E e f ρ F } ({Ω} E e f ρ) E e f r e f ρ = { R r (x y) x E e f ρ F, y E e f ρ F } { Ω if Ω E e f ρ E e f ρ } { Ω if 0 E e f ρ and = } C c : P(V F) P((V F) {Ω}) (command semantics) C X := e f X = { ρ[ X v ] ρ X, v E e f ρ F } ({Ω} E e f X ) C e f 0 X = { ρ ρ X, v E e f ρ F, v 0 } ({Ω} E e f X ) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 40 / 63

44 Floating-point abstractions Floating-point interval domain Floating-point interval domain 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 41 / 63

45 Floating-point abstractions Floating-point interval domain Floating-point interval abstract elements Goals: analyze floating-point programs abstracted using a floating-point implementation report infinities and NaN as errors Abstract elements: I = { (a, b) a, b F, a b } (floating-point bounds) D Concretization: = (V I) { } γ( ) = γ(x ) = { ρ V, ρ(v) γ I (X (V)) } if X where γ I (a, b) = { x F a x b } 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 42 / 63

46 Floating-point abstractions Floating-point interval domain Floating-point interval domain Interval arithmetics I (a, b) (a, b) I (a, b ) (a, b) I (a, b ) (a, b) I (a, b ) = ( b, a) = (a a, b + b ) = (a b, b + a ) = (min(a a, a b, b a, b b ), max(a + a, a + b, b + a, b + b )) (a, b) I (a, b ) = (min(a, a ), max(b, b )) I sets unstable bounds to ± Mf (we suppose r is unknown and assume a worst case rounding) Error management If some bound in E e f evaluates to ± or NaN, we report an alarm to the user and continue the evaluation with ( Mf, Mf ) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 43 / 63

47 Floating-point abstractions Floating-point interval domain Floating-point interval analysis example Filter with reinitialisation Z:=0; while true do if?(0,1) then Z:=?(-12,12) fi; Z:=(0.3? Z)??(-10,10) od in Q: Z < 10/0.7 ( 14.29). in F: Z B, with B = R + (10/0.7). Interval analysis: using a widening with thresholds T: Z min { x T x B }. = proof of absence of overflow if T has a value larger than B. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 44 / 63

48 Floating-point abstractions Expression linearization Expression linearization 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 45 / 63

49 Floating-point abstractions Expression linearization Floating-point issues in relational domains Relational domains assume many powerful properties on Q: associativity, distributivity,... that are not true on F! Example: Fourier-Motzkin elimination X Y c Y Z d = X Z c + d X n Y c Y n Z d X n Z c n d (X = 1, Y = 10 38, Z = 1, c = X n Y = 10 38, d = Y n Z = 10 38, c n d = 0, X n Z = 2 > 0) We cannot manipulate float expressions as easily as rational ones! Solution: keep representing and manipulating rational expressions abstract float expressions from programs into rational ones feed them to a rational abstract domain (optional) implement the rational domain using floats 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 46 / 63

50 Floating-point abstractions Affine interval forms Expression linearization We put expressions in affine interval form: [Miné-ESOP04] Semantics: exp l ::= [a 0, b 0 ] + k [a k, b k ] V k E e l ρ = { c 0 + k c k ρ(v k ) i, c i [a i, b i ] } (evaluated in Q) Advantages: affine expressions are easy to manipulate interval coefficients allow non-determinism in expressions, hence, the opportunity for abstraction intervals can easily model rounding errors easy to design algorithms for C X :=e l and C e l 0 in most domains 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 47 / 63

51 Floating-point abstractions Affine interval form algebra Expression linearization Operations on affine interval forms: adding and subtracting two forms multiplying and dividing a form by an interval Using interval arithmetics + I, I, I : (i 0 + k i k V k ) (i 0 + k i k V k) = (i 0 + I i 0 ) + k (i k + I i k ) V k i (i 0 + k i k V k ) = (i I i 0 ) + k (i I i k ) V k... Projection: π k : D exp l We suppose we are given an abstract interval projection operator π k such that: π k (X ) = [a, b] such that [a, b] { ρ(v k ) ρ γ(x ) }. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 48 / 63

52 Floating-point abstractions Linearization of rational expressions Expression linearization Intervalization: ι : (exp l D ) exp l Intervalization flattens the expression into a single interval: ι(i 0 + k i k V k, X ) = i 0 + I I, k (i k I π k (X )). Linearization without rounding errors: Defined by induction on the syntax of expressions: l(v, X ) = [1, 1] V l([a, b], X ) = [a, b] l(e 1 +e 2, X ) = l(e 1, X ) l(e 2, X ) l(e 1 e 2, X ) = l(e 1, X ) l(e 2, X ) l(e 1 /e 2, X ) = l(e 1, X ) ι(l(e 2, X ), X ) l(e 1 e 2, X ) = can be l : (exp D ) exp l { either ι(l(e1, X ), X ) l(e 2, X ) or ι(l(e 2, X ), X ) l(e 1, X ) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 49 / 63

53 Floating-point abstractions Expression linearization Linearization of floating-point expressions Rounding an affine interval form: if the result is normalized: we have a relative error ε with magnitude 2 23 : ε([a 0, b 0 ] + k [a k, b k ] V k ) = max( a 0, b 0 ) [ 2 23, 2 23 ] + k (max( a k, b k ) [ 2 23, 2 23 ] V k ) if the result is denormalized, we have an absolute error ω = [ 2 159, ]. = we sum these two sources of rounding errors Linearization with rounding errors: l : (exp f D ) exp l l(e 1 r e 2, X ) = l(e 1, X ) l(e 2, X ) ε(l(e 1, X )) ε(l(e 2, X )) ω l(e 1 r e 2, X ) = ι(l(e 1, X ), X ) (l(e 2, X ) ε(l(e 2, X ))) ω etc. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 50 / 63

54 Floating-point abstractions Expression linearization Applications of the floating-point linearization Soundness of the linearization e, X D, ρ γ(x ), if Ω / E e ρ, then E e ρ E l(e, X ) ρ Application: C V :=e X Note: check that Ω / E e ρ for ρ γ(x ) with interval arithmetic compute C V :=e X as C V :=l(e, X ) X (use C V :=[ Mf, Mf ] X if Ω E e ρ) I, I, I, I are sound abstractions of + I, I, I, / I = use I, etc. to get a sound approximation of l(e, X ) in floats 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 51 / 63

55 Floating-point abstractions Sound floating-point polyhedra Sound floating-point polyhedra 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 52 / 63

56 Floating-point abstractions Sound floating-point polyhedra Sound floating-point polyhedra Algorithms to adapt: [ChenAl-APLAS08] linear programming: simplex f (X, α) simplex(x, α) simplex(x, α) = min { k α kρ(v k ) ρ γ(x ) } Fourier-Motzkin elimination: Fourier f (X, V k ) = Fourier(X, V k ) Fourier(X, V k ) = { ( i α iv i β) X α k = 0 } { ( α k )c+ + α + k c c + = ( i α+ i V i β + ) X, α + k > 0, c = ( i α i V i β ) X, α k < 0 } 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 53 / 63

57 Floating-point abstractions Sound floating-point polyhedra Sound floating-point linear programming Guaranteed linear programming: [NeumaierShcherbina-MP04] Goal: under-approximate µ = min { c x M x b } knowing that x [ x l, x h ] (bounding-box for γ(x )). compute any approximation µ of the dual problem: µ µ = max { b y t M y = c, y 0 } and the corresponding vector y (e.g. using an off-the-shelf solver; µ may over-approximate or under-approximate µ) compute with intervals safe bounds [ r l, r h ] for A y c: [ r l, r h ] = ( t A I y) I c and then: ν = inf(( b I y) I ([ r l, r h ] I [ x l, x h ])) then: ν µ. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 54 / 63

58 Floating-point abstractions Sound floating-point polyhedra Sound floating-point Fourier-Motzkin elimination Given: c + = ( i α + i V i β + ) with α + k > 0 c = ( i α i V i β ) with α k < 0 a bounding-box of γ(x ): [ x l, x h ] We wish to compute i k α iv i β in F implied by ( α k )c+ + α + k c in γ(x ). normalize c + and c using interval arithmetics: { Vk + i k (α+ i I α + k )V i β + I α + k V k + i k (α i I ( α k ))V i β I ( α k ) (interval affine forms) add them using interval arithmetics: i k [a i, b i ]V i [a 0, b 0 ] where [a i, b i ] = (α + i I α + k ) I (α i I α k ), [a 0, b 0 ] = (β + I α + k ) I (β I α k ). 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 55 / 63

59 Floating-point abstractions Sound floating-point polyhedra Sound floating-point Fourier-Motzkin elimination (cont.) linearize the interval linear form into i k α iv i β where { αi [a i, b i ] β = sup ([a 0, b 0 ] I I, i k ( α i I [a i, b i ] ) I [ x l, x h ] ) Soundness: For all choices of α i [a i, b i ], i k α iv k β holds in Fourier(X, V k ). (e.g. α i = (a i n b i ) 2) 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 56 / 63

60 Floating-point abstractions Consequences of rounding Sound floating-point polyhedra Precision loss: Projection: γ(fourier(x, V k )) { ρ[v k v] v Q, ρ γ(x ) } = C V k := [, + ] γ(x ) Order: X Y = γ(x ) γ(y ) Join: ( ) γ(x Y ) ConvexHull(γ(X ) γ(y )) ( ) Efficiency loss: cannot remove all redundant constraints 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 57 / 63

61 Floating-point abstractions Floating-point polyhedra widening Sound floating-point polyhedra Widening : X Y = { c X Y {c} } (drop { c Y c X, X = (X \ c ) {c}} as X and Y may have redundant constraints) Stability improvement: robust strategies to choose α i [a i, b i ] during Fourier-Motzkin: choose simple α i (e.g., integer nearest (a i + b i )/2) reuse the same (or a multiple of) α i used for other variables 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 58 / 63

62 Conclusion Conclusion 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 59 / 63

63 Conclusion Abstraction summary Floating-point polyhedra analyzer for floating-point programs expression abstraction environment abstraction float expression e f linearization P(V F) affine form e l in Q abstract domain float implementation polyhedra in Q affine form e l in F float implementation polyhedra in F widening polyhedra in F 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 60 / 63

64 Conclusion Academic implementation Interproc: on-line analyzer for a toy language, using Apron. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 61 / 63

65 Conclusion Industrial application Astrée static analyzer: [BertraneAl-AIAA10] developed at ENS, now industrialized by analyzes embedded critical control/command C code checks for run-time errors (arithmetics, arrays, pointers) applied to industrial Airbus code, up to 1 M lines zero alarm, 14h computation time Based on abstract interpretation: uses intervals and octagons (no polyhedra) and many more abstract domains (some domain-specific) uses linearization of float expressions More information: 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 62 / 63

66 Conclusion The End 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 63 / 63

67 Bibliography Bibliography 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 64 / 63

68 Bibliography Bibliography [Tarski-PJM55] A. Tarski. A lattice theoretical fixpoint theorem and its applications. In Pacific J. Math., 5 (1995), [CousotCousot-ISP76] P. Cousot & R. Cousot. Static determination of dynamic properties of programs. In Proc. of the 2d Int. Symp. on Prog. Dunod, [CousotCousot-POPL77] P. Cousot & R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. of POPL 77, , ACM Press, [CousotCousot-PJM79] P. Cousot & R. Cousot. Constructive versions of Tarski s fixed point theorems. In Pacific J. Math., 82:1 (1979), [CousotHalbwachs-POPL78] P. Cousot & N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In Proc. of POPL 78, ACM Press, /02/2011 Analyse statique de programmes numériques Antoine Miné p. 65 / 63

69 Bibliography Bibliography (cont.) [Schrijver-86] A. Schrijver. Theory of linear and integer programming. John Wiley & Sons, Inc., [BenoyKing-LOPSTR96] F. Benoy & A. King. Inferring argument size relationships with CLP(R). In Proc. of LOPSTR 96, vol of LNCS, pp Springer, [Cousot-ENTCS97] P. Cousot. Constructive design of a hierarchy of semantics of a transition system by abstract interpretation. In ENTCS 6, 25 p., [Miné-AST01] A. Miné. The octagon abstract domain. In AST 01, pp IEEE CS Press, [Miné-ESOP04] A. Miné. Relational abstract domains for the detection of floating-point run-time errors. In Proc. of ESOP 04, vol of LNCS, pp Springer, /02/2011 Analyse statique de programmes numériques Antoine Miné p. 66 / 63

70 Bibliography Bibliography (cont.) [NeumaieShcherbina-MP04] A. Neumaier & O. Shcherbina. Safe bounds in linear and mixed-integer linear program ming. In Math. Program., 99(2): (2004). [Miné-ESOP04] A. Miné. Relational abstract domains for the detection of floating-point run-time errors. In Proc. of ESOP 04, vol of LNCS, pp Springer, [ChenAl-APLAS08] L. Chen, A. Miné & P. Cousot. A sound floating-point polyhedra abstract domain. In Proc. of APLAS 08, vol of LNCS, pp Springer, [BertraneAl-AIAA10] J. Bertrane, P. Cousot, R. Cousot, J. Feret, L. Mauborgne, A. Miné, X. Rival. Static Analysis and Verification of Aerospace Software by Abstract Interpretation. In AIAA Infotech@Aerospace (I@A 2010), 38 p. 9/02/2011 Analyse statique de programmes numériques Antoine Miné p. 67 / 63

A Static Analyzer for Large Safety-Critical Software. Considered Programs and Semantics. Automatic Program Verification by Abstract Interpretation

A Static Analyzer for Large Safety-Critical Software. Considered Programs and Semantics. Automatic Program Verification by Abstract Interpretation PLDI 03 A Static Analyzer for Large Safety-Critical Software B. Blanchet, P. Cousot, R. Cousot, J. Feret L. Mauborgne, A. Miné, D. Monniaux,. Rival CNRS École normale supérieure École polytechnique Paris

More information

Relational Abstract Domains for the Detection of Floating-Point Run-Time Errors

Relational Abstract Domains for the Detection of Floating-Point Run-Time Errors Relational Abstract Domains for the Detection of Floating-Point Run-Time Errors Antoine Miné DI-École Normale Supérieure de Paris, France, mine@di.ens.fr Abstract We present a new idea to adapt relational

More information

Numerology - A Case Study in Network Marketing Fractions

Numerology - A Case Study in Network Marketing Fractions Vers l analyse statique de programmes numériques Sylvie Putot Laboratoire de Modélisation et Analyse de Systèmes en Interaction, CEA LIST Journées du GDR et réseau Calcul, 9-10 novembre 2010 Sylvie Putot

More information

Static analysis of numerical programs

Static analysis of numerical programs Sylvie Putot with Eric Goubault, Franck Védrine and Karim Tekkal (Digiteo) Laboratory for the Modelling and Analysis of Interacting Systems, CEA LIST RAIM 09: 3es Rencontres Arithmétique de l Informatique

More information

InvGen: An Efficient Invariant Generator

InvGen: An Efficient Invariant Generator InvGen: An Efficient Invariant Generator Ashutosh Gupta and Andrey Rybalchenko Max Planck Institute for Software Systems (MPI-SWS) Abstract. In this paper we present InvGen, an automatic linear arithmetic

More information

A Static Analyzer for Large Safety-Critical Software

A Static Analyzer for Large Safety-Critical Software A Static Analyzer for Large Safety-Critical Software (Extended Abstract) Bruno Blanchet Patrick Cousot Radhia Cousot Jérôme Feret Laurent Mauborgne Antoine Miné David Monniaux Xavier Rival ABSTRACT We

More information

Astrée: Building a Static Analyzer for Real-Life Programs

Astrée: Building a Static Analyzer for Real-Life Programs Astrée: Building a Static Analyzer for Real-Life Programs Antoine Miné CNRS & École normale supérieure Paris, France Workshop on Learning From experience June 6th, 2010 LFX June 6th, 2010 Astrée: Building

More information

Fixpoint Computation in the Polyhedra Abstract Domain using Convex and Numerical Analysis Tools

Fixpoint Computation in the Polyhedra Abstract Domain using Convex and Numerical Analysis Tools Fixpoint Computation in the Polyhedra Abstract Domain using Convex and Numerical Analysis Tools Yassamine Seladji and Olivier Bouissou CEA LIST CEA Saclay Nano-INNOV Institut CARNOT 91 191 Gif sur Yvette

More information

RN-coding of Numbers: New Insights and Some Applications

RN-coding of Numbers: New Insights and Some Applications RN-coding of Numbers: New Insights and Some Applications Peter Kornerup Dept. of Mathematics and Computer Science SDU, Odense, Denmark & Jean-Michel Muller LIP/Arénaire (CRNS-ENS Lyon-INRIA-UCBL) Lyon,

More information

Measures of Error: for exact x and approximation x Absolute error e = x x. Relative error r = (x x )/x.

Measures of Error: for exact x and approximation x Absolute error e = x x. Relative error r = (x x )/x. ERRORS and COMPUTER ARITHMETIC Types of Error in Numerical Calculations Initial Data Errors: from experiment, modeling, computer representation; problem dependent but need to know at beginning of calculation.

More information

Numerical Matrix Analysis

Numerical Matrix Analysis Numerical Matrix Analysis Lecture Notes #10 Conditioning and / Peter Blomgren, blomgren.peter@gmail.com Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research

More information

µz An Efficient Engine for Fixed points with Constraints

µz An Efficient Engine for Fixed points with Constraints µz An Efficient Engine for Fixed points with Constraints Kryštof Hoder, Nikolaj Bjørner, and Leonardo de Moura Manchester University and Microsoft Research Abstract. The µz tool is a scalable, efficient

More information

A Static Analyzer for Large Safety-Critical Software

A Static Analyzer for Large Safety-Critical Software A Static Analyzer for Large Safety-Critical Software Bruno Blanchet Patrick Cousot Radhia Cousot Jérôme Feret Laurent Mauborgne Antoine Miné David Monniaux Xavier Rival ABSTRACT We show that abstract interpretation-based

More information

CS321. Introduction to Numerical Methods

CS321. Introduction to Numerical Methods CS3 Introduction to Numerical Methods Lecture Number Representations and Errors Professor Jun Zhang Department of Computer Science University of Kentucky Lexington, KY 40506-0633 August 7, 05 Number in

More information

CHAPTER 5 Round-off errors

CHAPTER 5 Round-off errors CHAPTER 5 Round-off errors In the two previous chapters we have seen how numbers can be represented in the binary numeral system and how this is the basis for representing numbers in computers. Since any

More information

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers This Unit: Floating Point Arithmetic CIS 371 Computer Organization and Design Unit 7: Floating Point App App App System software Mem CPU I/O Formats Precision and range IEEE 754 standard Operations Addition

More information

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015 CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Linda Shapiro Today Registration should be done. Homework 1 due 11:59 pm next Wednesday, January 14 Review math essential

More information

Proximal mapping via network optimization

Proximal mapping via network optimization L. Vandenberghe EE236C (Spring 23-4) Proximal mapping via network optimization minimum cut and maximum flow problems parametric minimum cut problem application to proximal mapping Introduction this lecture:

More information

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit Decimal Division Remember 4th grade long division? 43 // quotient 12 521 // divisor dividend -480 41-36 5 // remainder Shift divisor left (multiply by 10) until MSB lines up with dividend s Repeat until

More information

What is Linear Programming?

What is Linear Programming? Chapter 1 What is Linear Programming? An optimization problem usually has three essential ingredients: a variable vector x consisting of a set of unknowns to be determined, an objective function of x to

More information

RN-Codings: New Insights and Some Applications

RN-Codings: New Insights and Some Applications RN-Codings: New Insights and Some Applications Abstract During any composite computation there is a constant need for rounding intermediate results before they can participate in further processing. Recently

More information

Reducing Clocks in Timed Automata while Preserving Bisimulation

Reducing Clocks in Timed Automata while Preserving Bisimulation Reducing Clocks in Timed Automata while Preserving Bisimulation Shibashis Guha Chinmay Narayan S. Arun-Kumar Indian Institute of Technology Delhi {shibashis, chinmay, sak}@cse.iitd.ac.in arxiv:1404.6613v2

More information

9 More on differentiation

9 More on differentiation Tel Aviv University, 2013 Measure and category 75 9 More on differentiation 9a Finite Taylor expansion............... 75 9b Continuous and nowhere differentiable..... 78 9c Differentiable and nowhere monotone......

More information

IKOS: A Framework for Static Analysis based on Abstract Interpretation (Tool Paper)

IKOS: A Framework for Static Analysis based on Abstract Interpretation (Tool Paper) IKOS: A Framework for Static Analysis based on Abstract Interpretation (Tool Paper) Guillaume Brat, Jorge A. Navas, Nija Shi, and Arnaud Venet NASA Ames Research Center, Moffett Field, CA 94035 Abstract.

More information

Automatic Verification by Abstract Interpretation

Automatic Verification by Abstract Interpretation Automatic Verification by Abstract Interpretation (Invited tutorial) Patrick Cousot École normale supérieure, Département d informatique, 45 rue d Ulm, 75230 Paris cedex 05, France Patrick.Cousot@ens.fr

More information

ATheoryofComplexity,Conditionand Roundoff

ATheoryofComplexity,Conditionand Roundoff ATheoryofComplexity,Conditionand Roundoff Felipe Cucker Berkeley 2014 Background L. Blum, M. Shub, and S. Smale [1989] On a theory of computation and complexity over the real numbers: NP-completeness,

More information

6.2 Permutations continued

6.2 Permutations continued 6.2 Permutations continued Theorem A permutation on a finite set A is either a cycle or can be expressed as a product (composition of disjoint cycles. Proof is by (strong induction on the number, r, of

More information

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

More information

ECE 0142 Computer Organization. Lecture 3 Floating Point Representations

ECE 0142 Computer Organization. Lecture 3 Floating Point Representations ECE 0142 Computer Organization Lecture 3 Floating Point Representations 1 Floating-point arithmetic We often incur floating-point programming. Floating point greatly simplifies working with large (e.g.,

More information

Chair of Software Engineering. Software Verification. Assertion Inference. Carlo A. Furia

Chair of Software Engineering. Software Verification. Assertion Inference. Carlo A. Furia Chair of Software Engineering Software Verification Assertion Inference Carlo A. Furia Proving Programs Automatically The Program Verification problem: Given: a program P and a specification S = [Pre,

More information

Vector and Matrix Norms

Vector and Matrix Norms Chapter 1 Vector and Matrix Norms 11 Vector Spaces Let F be a field (such as the real numbers, R, or complex numbers, C) with elements called scalars A Vector Space, V, over the field F is a non-empty

More information

Contrôle dynamique de méthodes d approximation

Contrôle dynamique de méthodes d approximation Contrôle dynamique de méthodes d approximation Fabienne Jézéquel Laboratoire d Informatique de Paris 6 ARINEWS, ENS Lyon, 7-8 mars 2005 F. Jézéquel Dynamical control of approximation methods 7-8 Mar. 2005

More information

Geometrical Characterization of RN-operators between Locally Convex Vector Spaces

Geometrical Characterization of RN-operators between Locally Convex Vector Spaces Geometrical Characterization of RN-operators between Locally Convex Vector Spaces OLEG REINOV St. Petersburg State University Dept. of Mathematics and Mechanics Universitetskii pr. 28, 198504 St, Petersburg

More information

Pacific Journal of Mathematics

Pacific Journal of Mathematics Pacific Journal of Mathematics GLOBAL EXISTENCE AND DECREASING PROPERTY OF BOUNDARY VALUES OF SOLUTIONS TO PARABOLIC EQUATIONS WITH NONLOCAL BOUNDARY CONDITIONS Sangwon Seo Volume 193 No. 1 March 2000

More information

On strong fairness in UNITY

On strong fairness in UNITY On strong fairness in UNITY H.P.Gumm, D.Zhukov Fachbereich Mathematik und Informatik Philipps Universität Marburg {gumm,shukov}@mathematik.uni-marburg.de Abstract. In [6] Tsay and Bagrodia present a correct

More information

Modern Optimization Methods for Big Data Problems MATH11146 The University of Edinburgh

Modern Optimization Methods for Big Data Problems MATH11146 The University of Edinburgh Modern Optimization Methods for Big Data Problems MATH11146 The University of Edinburgh Peter Richtárik Week 3 Randomized Coordinate Descent With Arbitrary Sampling January 27, 2016 1 / 30 The Problem

More information

Static Program Transformations for Efficient Software Model Checking

Static Program Transformations for Efficient Software Model Checking Static Program Transformations for Efficient Software Model Checking Shobha Vasudevan Jacob Abraham The University of Texas at Austin Dependable Systems Large and complex systems Software faults are major

More information

YOU CAN COUNT ON NUMBER LINES

YOU CAN COUNT ON NUMBER LINES Key Idea 2 Number and Numeration: Students use number sense and numeration to develop an understanding of multiple uses of numbers in the real world, the use of numbers to communicate mathematically, and

More information

How To Develop A Static Analysis System For Large Programs

How To Develop A Static Analysis System For Large Programs Towards the Industrial Scale Development of Custom Static Analyzers John Anton, Eric Bush, Allen Goldberg, Klaus Havelund, Doug Smith, Arnaud Venet Kestrel Technology LLC 4984 El Camino Real #230 Los Altos,

More information

(Refer Slide Time: 01:11-01:27)

(Refer Slide Time: 01:11-01:27) Digital Signal Processing Prof. S. C. Dutta Roy Department of Electrical Engineering Indian Institute of Technology, Delhi Lecture - 6 Digital systems (contd.); inverse systems, stability, FIR and IIR,

More information

GenOpt (R) Generic Optimization Program User Manual Version 3.0.0β1

GenOpt (R) Generic Optimization Program User Manual Version 3.0.0β1 (R) User Manual Environmental Energy Technologies Division Berkeley, CA 94720 http://simulationresearch.lbl.gov Michael Wetter MWetter@lbl.gov February 20, 2009 Notice: This work was supported by the U.S.

More information

Numerical Analysis I

Numerical Analysis I Numerical Analysis I M.R. O Donohoe References: S.D. Conte & C. de Boor, Elementary Numerical Analysis: An Algorithmic Approach, Third edition, 1981. McGraw-Hill. L.F. Shampine, R.C. Allen, Jr & S. Pruess,

More information

Computing Cubic Fields in Quasi-Linear Time

Computing Cubic Fields in Quasi-Linear Time Computing Cubic Fields in Quasi-Linear Time K. Belabas Département de mathématiques (A2X) Université Bordeaux I 351, cours de la Libération, 33405 Talence (France) belabas@math.u-bordeaux.fr Cubic fields

More information

(Basic definitions and properties; Separation theorems; Characterizations) 1.1 Definition, examples, inner description, algebraic properties

(Basic definitions and properties; Separation theorems; Characterizations) 1.1 Definition, examples, inner description, algebraic properties Lecture 1 Convex Sets (Basic definitions and properties; Separation theorems; Characterizations) 1.1 Definition, examples, inner description, algebraic properties 1.1.1 A convex set In the school geometry

More information

Georgia Department of Education Kathy Cox, State Superintendent of Schools 7/19/2005 All Rights Reserved 1

Georgia Department of Education Kathy Cox, State Superintendent of Schools 7/19/2005 All Rights Reserved 1 Accelerated Mathematics 3 This is a course in precalculus and statistics, designed to prepare students to take AB or BC Advanced Placement Calculus. It includes rational, circular trigonometric, and inverse

More information

Indiana State Core Curriculum Standards updated 2009 Algebra I

Indiana State Core Curriculum Standards updated 2009 Algebra I Indiana State Core Curriculum Standards updated 2009 Algebra I Strand Description Boardworks High School Algebra presentations Operations With Real Numbers Linear Equations and A1.1 Students simplify and

More information

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test Math Review for the Quantitative Reasoning Measure of the GRE revised General Test www.ets.org Overview This Math Review will familiarize you with the mathematical skills and concepts that are important

More information

THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0

THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0 THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0 RICHARD J. MATHAR Abstract. We count solutions to the Ramanujan-Nagell equation 2 y +n = x 2 for fixed positive n. The computational

More information

Integer Factorization using the Quadratic Sieve

Integer Factorization using the Quadratic Sieve Integer Factorization using the Quadratic Sieve Chad Seibert* Division of Science and Mathematics University of Minnesota, Morris Morris, MN 56567 seib0060@morris.umn.edu March 16, 2011 Abstract We give

More information

Method To Solve Linear, Polynomial, or Absolute Value Inequalities:

Method To Solve Linear, Polynomial, or Absolute Value Inequalities: Solving Inequalities An inequality is the result of replacing the = sign in an equation with ,, or. For example, 3x 2 < 7 is a linear inequality. We call it linear because if the < were replaced with

More information

Høgskolen i Narvik Sivilingeniørutdanningen STE6237 ELEMENTMETODER. Oppgaver

Høgskolen i Narvik Sivilingeniørutdanningen STE6237 ELEMENTMETODER. Oppgaver Høgskolen i Narvik Sivilingeniørutdanningen STE637 ELEMENTMETODER Oppgaver Klasse: 4.ID, 4.IT Ekstern Professor: Gregory A. Chechkin e-mail: chechkin@mech.math.msu.su Narvik 6 PART I Task. Consider two-point

More information

Separation Properties for Locally Convex Cones

Separation Properties for Locally Convex Cones Journal of Convex Analysis Volume 9 (2002), No. 1, 301 307 Separation Properties for Locally Convex Cones Walter Roth Department of Mathematics, Universiti Brunei Darussalam, Gadong BE1410, Brunei Darussalam

More information

1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where.

1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where. Introduction Linear Programming Neil Laws TT 00 A general optimization problem is of the form: choose x to maximise f(x) subject to x S where x = (x,..., x n ) T, f : R n R is the objective function, S

More information

Static Analysis of Dynamic Properties - Automatic Program Verification to Prove the Absence of Dynamic Runtime Errors

Static Analysis of Dynamic Properties - Automatic Program Verification to Prove the Absence of Dynamic Runtime Errors Static Analysis of Dynamic Properties - Automatic Program Verification to Prove the Absence of Dynamic Runtime Errors Klaus Wissing PolySpace Technologies GmbH Argelsrieder Feld 22 82234 Wessling-Oberpfaffenhofen

More information

Tim Kerins. Leaving Certificate Honours Maths - Algebra. Tim Kerins. the date

Tim Kerins. Leaving Certificate Honours Maths - Algebra. Tim Kerins. the date Leaving Certificate Honours Maths - Algebra the date Chapter 1 Algebra This is an important portion of the course. As well as generally accounting for 2 3 questions in examination it is the basis for many

More information

arxiv:0906.4209v2 [math.nt] 8 Aug 2009

arxiv:0906.4209v2 [math.nt] 8 Aug 2009 On Larcher s theorem concerning good lattice points and multiplicative subgroups modulo p. N.G. Moshchevitin, D.M. Ushanov arxiv:0906.4209v2 [math.nt] 8 Aug 2009 Abstract. We prove the existence of two-dimensional

More information

FMA Implementations of the Compensated Horner Scheme

FMA Implementations of the Compensated Horner Scheme Reliable Implementation of Real Number Algorithms: Theory and Practice Dagstuhl Seminar 06021 January 08-13, 2006 FMA Implementations of the Compensated Horner Scheme Stef GRAILLAT, Philippe LANGLOIS and

More information

DNA Data and Program Representation. Alexandre David 1.2.05 adavid@cs.aau.dk

DNA Data and Program Representation. Alexandre David 1.2.05 adavid@cs.aau.dk DNA Data and Program Representation Alexandre David 1.2.05 adavid@cs.aau.dk Introduction Very important to understand how data is represented. operations limits precision Digital logic built on 2-valued

More information

a 1 x + a 0 =0. (3) ax 2 + bx + c =0. (4)

a 1 x + a 0 =0. (3) ax 2 + bx + c =0. (4) ROOTS OF POLYNOMIAL EQUATIONS In this unit we discuss polynomial equations. A polynomial in x of degree n, where n 0 is an integer, is an expression of the form P n (x) =a n x n + a n 1 x n 1 + + a 1 x

More information

Mathematics (MAT) MAT 061 Basic Euclidean Geometry 3 Hours. MAT 051 Pre-Algebra 4 Hours

Mathematics (MAT) MAT 061 Basic Euclidean Geometry 3 Hours. MAT 051 Pre-Algebra 4 Hours MAT 051 Pre-Algebra Mathematics (MAT) MAT 051 is designed as a review of the basic operations of arithmetic and an introduction to algebra. The student must earn a grade of C or in order to enroll in MAT

More information

CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e.

CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e. CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e. This chapter contains the beginnings of the most important, and probably the most subtle, notion in mathematical analysis, i.e.,

More information

Lecture 7: Finding Lyapunov Functions 1

Lecture 7: Finding Lyapunov Functions 1 Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.243j (Fall 2003): DYNAMICS OF NONLINEAR SYSTEMS by A. Megretski Lecture 7: Finding Lyapunov Functions 1

More information

The Heat Equation. Lectures INF2320 p. 1/88

The Heat Equation. Lectures INF2320 p. 1/88 The Heat Equation Lectures INF232 p. 1/88 Lectures INF232 p. 2/88 The Heat Equation We study the heat equation: u t = u xx for x (,1), t >, (1) u(,t) = u(1,t) = for t >, (2) u(x,) = f(x) for x (,1), (3)

More information

A new binary floating-point division algorithm and its software implementation on the ST231 processor

A new binary floating-point division algorithm and its software implementation on the ST231 processor 19th IEEE Symposium on Computer Arithmetic (ARITH 19) Portland, Oregon, USA, June 8-10, 2009 A new binary floating-point division algorithm and its software implementation on the ST231 processor Claude-Pierre

More information

Static Taint-Analysis on Binary Executables

Static Taint-Analysis on Binary Executables Static Taint-Analysis on Binary Executables Sanjay Rawat, Laurent Mounier, Marie-Laure Potet VERIMAG University of Grenoble October 2011 Static Taint-Analysis on Binary Executables 1/29 Outline 1 Introduction

More information

Correctly Rounded Floating-point Binary-to-Decimal and Decimal-to-Binary Conversion Routines in Standard ML. By Prashanth Tilleti

Correctly Rounded Floating-point Binary-to-Decimal and Decimal-to-Binary Conversion Routines in Standard ML. By Prashanth Tilleti Correctly Rounded Floating-point Binary-to-Decimal and Decimal-to-Binary Conversion Routines in Standard ML By Prashanth Tilleti Advisor Dr. Matthew Fluet Department of Computer Science B. Thomas Golisano

More information

Notes on Factoring. MA 206 Kurt Bryan

Notes on Factoring. MA 206 Kurt Bryan The General Approach Notes on Factoring MA 26 Kurt Bryan Suppose I hand you n, a 2 digit integer and tell you that n is composite, with smallest prime factor around 5 digits. Finding a nontrivial factor

More information

Notes from Week 1: Algorithms for sequential prediction

Notes from Week 1: Algorithms for sequential prediction CS 683 Learning, Games, and Electronic Markets Spring 2007 Notes from Week 1: Algorithms for sequential prediction Instructor: Robert Kleinberg 22-26 Jan 2007 1 Introduction In this course we will be looking

More information

NP-Hardness Results Related to PPAD

NP-Hardness Results Related to PPAD NP-Hardness Results Related to PPAD Chuangyin Dang Dept. of Manufacturing Engineering & Engineering Management City University of Hong Kong Kowloon, Hong Kong SAR, China E-Mail: mecdang@cityu.edu.hk Yinyu

More information

A Survey of Static Program Analysis Techniques

A Survey of Static Program Analysis Techniques A Survey of Static Program Analysis Techniques Wolfgang Wögerer Technische Universität Wien October 18, 2005 Abstract Computer program analysis is the process of automatically analysing the bahavior of

More information

Powers of Two in Generalized Fibonacci Sequences

Powers of Two in Generalized Fibonacci Sequences Revista Colombiana de Matemáticas Volumen 462012)1, páginas 67-79 Powers of Two in Generalized Fibonacci Sequences Potencias de dos en sucesiones generalizadas de Fibonacci Jhon J. Bravo 1,a,B, Florian

More information

Regression Verification: Status Report

Regression Verification: Status Report Regression Verification: Status Report Presentation by Dennis Felsing within the Projektgruppe Formale Methoden der Softwareentwicklung 2013-12-11 1/22 Introduction How to prevent regressions in software

More information

1. Prove that the empty set is a subset of every set.

1. Prove that the empty set is a subset of every set. 1. Prove that the empty set is a subset of every set. Basic Topology Written by Men-Gen Tsai email: b89902089@ntu.edu.tw Proof: For any element x of the empty set, x is also an element of every set since

More information

Some representability and duality results for convex mixed-integer programs.

Some representability and duality results for convex mixed-integer programs. Some representability and duality results for convex mixed-integer programs. Santanu S. Dey Joint work with Diego Morán and Juan Pablo Vielma December 17, 2012. Introduction About Motivation Mixed integer

More information

arxiv:1112.0829v1 [math.pr] 5 Dec 2011

arxiv:1112.0829v1 [math.pr] 5 Dec 2011 How Not to Win a Million Dollars: A Counterexample to a Conjecture of L. Breiman Thomas P. Hayes arxiv:1112.0829v1 [math.pr] 5 Dec 2011 Abstract Consider a gambling game in which we are allowed to repeatedly

More information

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any. Algebra 2 - Chapter Prerequisites Vocabulary Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any. P1 p. 1 1. counting(natural) numbers - {1,2,3,4,...}

More information

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z DANIEL BIRMAJER, JUAN B GIL, AND MICHAEL WEINER Abstract We consider polynomials with integer coefficients and discuss their factorization

More information

s-convexity, model sets and their relation

s-convexity, model sets and their relation s-convexity, model sets and their relation Zuzana Masáková Jiří Patera Edita Pelantová CRM-2639 November 1999 Department of Mathematics, Faculty of Nuclear Science and Physical Engineering, Czech Technical

More information

24. The Branch and Bound Method

24. The Branch and Bound Method 24. The Branch and Bound Method It has serious practical consequences if it is known that a combinatorial problem is NP-complete. Then one can conclude according to the present state of science that no

More information

Abstract Interpretation-based Static Analysis Tools:

Abstract Interpretation-based Static Analysis Tools: Abstract Interpretation-based Static Analysis Tools: Proving the Absence of Runtime Errors and Safe Upper Bounds on the Worst-Case Execution Time and Safe Upper Bounds on the Stack Usage Christian Ferdinand

More information

Introduction to Support Vector Machines. Colin Campbell, Bristol University

Introduction to Support Vector Machines. Colin Campbell, Bristol University Introduction to Support Vector Machines Colin Campbell, Bristol University 1 Outline of talk. Part 1. An Introduction to SVMs 1.1. SVMs for binary classification. 1.2. Soft margins and multi-class classification.

More information

Abstract Simulation: a Static Analysis of Simulink Models

Abstract Simulation: a Static Analysis of Simulink Models Abstract Simulation: a Static Analysis of Simulink Models Alexandre Chapoutot LIP6 Université Pierre et Marie Curie 4, place Jussieu F75252 Paris Cedex 05, France Email: alexandre.chapoutot@lip6.fr Matthieu

More information

Termination Checking: Comparing Structural Recursion and Sized Types by Examples

Termination Checking: Comparing Structural Recursion and Sized Types by Examples Termination Checking: Comparing Structural Recursion and Sized Types by Examples David Thibodeau Decemer 3, 2011 Abstract Termination is an important property for programs and is necessary for formal proofs

More information

Probability Generating Functions

Probability Generating Functions page 39 Chapter 3 Probability Generating Functions 3 Preamble: Generating Functions Generating functions are widely used in mathematics, and play an important role in probability theory Consider a sequence

More information

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics Undergraduate Notes in Mathematics Arkansas Tech University Department of Mathematics An Introductory Single Variable Real Analysis: A Learning Approach through Problem Solving Marcel B. Finan c All Rights

More information

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12 CONTINUED FRACTIONS AND PELL S EQUATION SEUNG HYUN YANG Abstract. In this REU paper, I will use some important characteristics of continued fractions to give the complete set of solutions to Pell s equation.

More information

Numerical methods for American options

Numerical methods for American options Lecture 9 Numerical methods for American options Lecture Notes by Andrzej Palczewski Computational Finance p. 1 American options The holder of an American option has the right to exercise it at any moment

More information

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson JUST THE MATHS UNIT NUMBER 1.8 ALGEBRA 8 (Polynomials) by A.J.Hobson 1.8.1 The factor theorem 1.8.2 Application to quadratic and cubic expressions 1.8.3 Cubic equations 1.8.4 Long division of polynomials

More information

CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA

CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA We Can Early Learning Curriculum PreK Grades 8 12 INSIDE ALGEBRA, GRADES 8 12 CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA April 2016 www.voyagersopris.com Mathematical

More information

Support Vector Machines Explained

Support Vector Machines Explained March 1, 2009 Support Vector Machines Explained Tristan Fletcher www.cs.ucl.ac.uk/staff/t.fletcher/ Introduction This document has been written in an attempt to make the Support Vector Machines (SVM),

More information

No: 10 04. Bilkent University. Monotonic Extension. Farhad Husseinov. Discussion Papers. Department of Economics

No: 10 04. Bilkent University. Monotonic Extension. Farhad Husseinov. Discussion Papers. Department of Economics No: 10 04 Bilkent University Monotonic Extension Farhad Husseinov Discussion Papers Department of Economics The Discussion Papers of the Department of Economics are intended to make the initial results

More information

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2. Chapter 1 LINEAR EQUATIONS 1.1 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,..., a n, b are given

More information

Introduction to Scheduling Theory

Introduction to Scheduling Theory Introduction to Scheduling Theory Arnaud Legrand Laboratoire Informatique et Distribution IMAG CNRS, France arnaud.legrand@imag.fr November 8, 2004 1/ 26 Outline 1 Task graphs from outer space 2 Scheduling

More information

Binary Multiplication

Binary Multiplication Binary Multiplication Q: How do we multiply two numbers? eg. 12, 345 6, 789 111105 987600 8641500 + 74070000 83, 810, 205 10111 10101 10111 00000 1011100 0000000 + 101110000 111100011 Pad, multiply and

More information

An Abstract Monte-Carlo Method for the Analysis of Probabilistic Programs

An Abstract Monte-Carlo Method for the Analysis of Probabilistic Programs Intended for submission to the 28th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages An Abstract Monte-Carlo Method for the Analysis of Probabilistic Programs David Monniaux École

More information

What Every Computer Scientist Should Know About Floating-Point Arithmetic

What Every Computer Scientist Should Know About Floating-Point Arithmetic What Every Computer Scientist Should Know About Floating-Point Arithmetic D Note This document is an edited reprint of the paper What Every Computer Scientist Should Know About Floating-Point Arithmetic,

More information

FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY

FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY LINDSEY R. BOSKO I would like to acknowledge the assistance of Dr. Michael Singer. His guidance and feedback were instrumental in completing this

More information

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives 6 EXTENDING ALGEBRA Chapter 6 Extending Algebra Objectives After studying this chapter you should understand techniques whereby equations of cubic degree and higher can be solved; be able to factorise

More information

Cartesian Factoring of Polyhedra in Linear Relation Analysis

Cartesian Factoring of Polyhedra in Linear Relation Analysis Cartesian Factoring of Polyhedra in Linear Relation Analysis N. Halbwachs and D. Merchat and C. Parent-Vigouroux Vérimag, Grenoble - France {Nicolas.Halbwachs,David.Merchat,Catherine.Parent}@imag.fr Abstract.

More information