program verification in the presence of complex numbers
play

Program Verification in the presence of complex numbers, functions - PowerPoint PPT Presentation

Program Verification in the presence of complex numbers, functions with branch cuts etc. James Davenport (Bath) Thanks to Russell Bradford, Acyr Locatelli, Gregory Sankaran and David Wilson (Bath) and Scott McCallum (Macquarie) 28 September


  1. Program Verification in the presence of complex numbers, functions with branch cuts etc. James Davenport (Bath) Thanks to Russell Bradford, Acyr Locatelli, Gregory Sankaran and David Wilson (Bath) and Scott McCallum (Macquarie) 28 September 2012 Davenport Program Verification in the presence of complex numbers, functions

  2. Traditional Classification of Problems Davenport Program Verification in the presence of complex numbers, functions

  3. Traditional Classification of Problems blunder (of the coding variety) This is the sort of error traditionally addressed in “program verification”. Typically independent of the arithmetic. Davenport Program Verification in the presence of complex numbers, functions

  4. Traditional Classification of Problems blunder (of the coding variety) This is the sort of error traditionally addressed in “program verification”. Typically independent of the arithmetic. parallelism Issues of deadlocks or races occurring due to the parallelism of an otherwise correct sequential program. Again, arithmetic-independent. Davenport Program Verification in the presence of complex numbers, functions

  5. Traditional Classification of Problems blunder (of the coding variety) This is the sort of error traditionally addressed in “program verification”. Typically independent of the arithmetic. parallelism Issues of deadlocks or races occurring due to the parallelism of an otherwise correct sequential program. Again, arithmetic-independent. numerical Do truncation and round-off errors, individually or combined, mean that the program computes approximations to the “true” answers which are out of tolerance. Davenport Program Verification in the presence of complex numbers, functions

  6. Traditional Classification of Problems How often are they considered? Statistics from [CE05] Davenport Program Verification in the presence of complex numbers, functions

  7. Traditional Classification of Problems How often are they considered? Statistics from [CE05] blunder (of the coding variety) This is the sort of error (83%) traditionally addressed in “program verification”. Typically independent of the arithmetic. parallelism Issues of deadlocks or races occurring due to the (13%) parallelism of an otherwise correct sequential program. Again, arithmetic-independent. numerical Do truncation and round-off errors, individually or (3%) combined, mean that the program computes approximations to the “true” answers which are out of tolerance. Davenport Program Verification in the presence of complex numbers, functions

  8. Traditional Classification of Problems How often are they considered? Statistics from [CE05] blunder (of the coding variety) This is the sort of error (83%) traditionally addressed in “program verification”. Typically independent of the arithmetic. parallelism Issues of deadlocks or races occurring due to the (13%) parallelism of an otherwise correct sequential program. Again, arithmetic-independent. numerical Do truncation and round-off errors, individually or (3%) combined, mean that the program computes approximations to the “true” answers which are out of tolerance. To this, I wish to add a fourth kind Davenport Program Verification in the presence of complex numbers, functions

  9. “The bug that dares not speak its name” Davenport Program Verification in the presence of complex numbers, functions

  10. “The bug that dares not speak its name” manipulation A piece of algebra, which is “obviously correct”, (0%!) turns out not to be correct when interpreted, Davenport Program Verification in the presence of complex numbers, functions

  11. “The bug that dares not speak its name” manipulation A piece of algebra, which is “obviously correct”, (0%!) turns out not to be correct when interpreted, not as abstract algebra, but as the manipulation of functions R → R or C → C . Davenport Program Verification in the presence of complex numbers, functions

  12. A note on complex numbers Most of our examples involve complex numbers, and people say real programs don’t use complex numbers Davenport Program Verification in the presence of complex numbers, functions

  13. A note on complex numbers Most of our examples involve complex numbers, and people say real programs don’t use complex numbers However Davenport Program Verification in the presence of complex numbers, functions

  14. A note on complex numbers Most of our examples involve complex numbers, and people say real programs don’t use complex numbers However COMPLEX in Fortran II was the first computer data type not corresponding to a machine one Davenport Program Verification in the presence of complex numbers, functions

  15. A note on complex numbers Most of our examples involve complex numbers, and people say real programs don’t use complex numbers However COMPLEX in Fortran II was the first computer data type not corresponding to a machine one Even C99 introduced Complex Davenport Program Verification in the presence of complex numbers, functions

  16. A note on complex numbers Most of our examples involve complex numbers, and people say real programs don’t use complex numbers However COMPLEX in Fortran II was the first computer data type not corresponding to a machine one Even C99 introduced Complex Many examples, notably in fluid mechanics. Davenport Program Verification in the presence of complex numbers, functions

  17. Kahan’s example [Kah87] Flow in a slotted strip, transformed by � 5 z + 12 � � � 1 + 2 z w = g ( z ) := 2 arccosh − arccosh (1) 3 3( z + 4) Davenport Program Verification in the presence of complex numbers, functions

  18. Kahan’s example [Kah87] Flow in a slotted strip, transformed by � 5 z + 12 � � � 1 + 2 z w = g ( z ) := 2 arccosh − arccosh (1) 3 3( z + 4) Is this the same as � � � z + 3 w ? = q ( z ) := 2 arccosh 2( z + 3) ? (2) 27( z + 4) Davenport Program Verification in the presence of complex numbers, functions

  19. Kahan’s example [Kah87] Flow in a slotted strip, transformed by � 5 z + 12 � � � 1 + 2 z w = g ( z ) := 2 arccosh − arccosh (1) 3 3( z + 4) Is this the same as � � � z + 3 w ? = q ( z ) := 2 arccosh 2( z + 3) ? (2) 27( z + 4) Or possibly √ 3 z + 12 � √ z + 3 + √ z � � � 2 1 2 √ z + 3 + √ z w = h ( z ) := 2 ln ? (3) 3 Davenport Program Verification in the presence of complex numbers, functions

  20. g − q might look OK Davenport Program Verification in the presence of complex numbers, functions

  21. g − q might look OK Davenport Program Verification in the presence of complex numbers, functions

  22. g − q might look OK “OK apart from a slight glitch.” Davenport Program Verification in the presence of complex numbers, functions

  23. But if we look closer Definitely not OK Davenport Program Verification in the presence of complex numbers, functions

  24. But, in fact g = h Davenport Program Verification in the presence of complex numbers, functions

  25. But, in fact g = h Most computer algebra systems (these days!) will refuse to “simplify” g to q Davenport Program Verification in the presence of complex numbers, functions

  26. But, in fact g = h Most computer algebra systems (these days!) will refuse to “simplify” g to q But will also refuse to simplify g to h . Davenport Program Verification in the presence of complex numbers, functions

  27. But, in fact g = h Most computer algebra systems (these days!) will refuse to “simplify” g to q But will also refuse to simplify g to h . Indeed Maple’s coulditbe(g<>h); returns true , which ought to indicate that there is a counter-example. Davenport Program Verification in the presence of complex numbers, functions

  28. But, in fact g = h Most computer algebra systems (these days!) will refuse to “simplify” g to q But will also refuse to simplify g to h . Indeed Maple’s coulditbe(g<>h); returns true , which ought to indicate that there is a counter-example. � �� � √ d ( g − h ) z z + 3 z z + 4 z 3 / 2 − 2 z 3 / 2 + 2 = 2 z + 3 z + 4 · dz z + 4 � � � � √ √ √ z + 8 z + 3 z z + 3 z z + 4 z − z z + 3 + 4 z + 3 z + 4 · z + 4 z + 4 � � √ � -1 z + 4 − 6 √ z z + 3 + √ z z + 3 1 1 1 1 ( z + 4) − 2 � √ z + 3 √ z 2 � � z z +3 z +4 z +4 Davenport Program Verification in the presence of complex numbers, functions

  29. But, in fact g = h Most computer algebra systems (these days!) will refuse to “simplify” g to q But will also refuse to simplify g to h . Indeed Maple’s coulditbe(g<>h); returns true , which ought to indicate that there is a counter-example. � �� � √ d ( g − h ) z z + 3 z z + 4 z 3 / 2 − 2 z 3 / 2 + 2 = 2 z + 3 z + 4 · dz z + 4 � � � � √ √ √ z + 8 z + 3 z z + 3 z z + 4 z − z z + 3 + 4 z + 3 z + 4 · z + 4 z + 4 � � √ � -1 z + 4 − 6 √ z z + 3 + √ z z + 3 1 1 1 1 ( z + 4) − 2 � √ z + 3 √ z 2 � � z z +3 z +4 z +4 and it’s a bold person who would say “= 0” Davenport Program Verification in the presence of complex numbers, functions

  30. Challenges Davenport Program Verification in the presence of complex numbers, functions

  31. Challenges Challenge (1) Demonstrate automatically that g and q are not equal, by producing a z at which they give different results. Davenport Program Verification in the presence of complex numbers, functions

Recommend


More recommend