formal verification and digital filters
play

Formal Verification and Digital Filters Diane Gallois-Wong - PowerPoint PPT Presentation

Formal Verification and Digital Filters Diane Gallois-Wong supervised by Sylvie Boldo and Thibault Hilaire Universit e Paris-Sud, LRI (Orsay), Inria Saclay CICM Doctoral Program August 13, 2018 Diane Gallois-Wong (U-PSud, LRI)


  1. Formal Verification and Digital Filters Diane Gallois-Wong supervised by Sylvie Boldo and Thibault Hilaire Universit´ e Paris-Sud, LRI (Orsay), Inria Saclay CICM – Doctoral Program – August 13, 2018 Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 1 / 11

  2. ime ime Digital Filters Signal processing : audio, video, various physical measurements → communication, control systems in robotics, automotive, ֒ aeronautics, etc. Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 2 / 11

  3. Digital Filters Signal processing : audio, video, various physical measurements → communication, control systems in robotics, automotive, ֒ aeronautics, etc. T ime T ime Analog signal Digital signal continuous time t ∈ R discrete time k ∈ Z Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 2 / 11

  4. Digital Filters Signal processing : audio, video, various physical measurements → communication, control systems in robotics, automotive, ֒ aeronautics, etc. T ime T ime Analog signal Digital signal continuous time t ∈ R discrete time k ∈ Z u ( k ) y ( k ) Digital filter H : H output input Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 2 / 11

  5. LTI Filters u ( k ) y ( k ) Digital filter H : H output input Linear Time-Invariant (LTI) filter : compatible with addition H ( u 1 + u 2 ) = H ( u 1 ) + H ( u 2 ) scalar multiplication H ( λ u ) = λ H ( u ) delay H ( m �→ u ( m − K ))( k ) = H ( u )( k − K ) Example: y ( k ) = u ( k ) − 3 y ( k − 1) Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 3 / 11

  6. Theory and Practice: Finite Precision Theory : mathematical definition infinite precision ∀ k ∈ Z . y ( k ) = u ( k ) − 3 y ( k − 1) (real numbers R ) ↓ Practice : implementation foreach k do finite precision y ( k ) ← u ( k ) − 3 ∗ y ( k − 1) (floating- or fixed-point numbers) end → rounding errors ֒ Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 4 / 11

  7. Theory and Practice: Finite Precision Theory : mathematical definition infinite precision ∀ k ∈ Z . y ( k ) = u ( k ) − 3 y ( k − 1) (real numbers R ) ↓ Practice : implementation foreach k do finite precision y ( k ) ← u ( k ) − 3 ∗ y ( k − 1) (floating- or fixed-point numbers) end → rounding errors which propagate and may accumulate: ֒ y ∗ ( k ) ← u ( k ) ⊖ 3 ⊗ y ∗ ( k − 1) Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 4 / 11

  8. Theory and Practice: Finite Precision Theory : mathematical definition infinite precision ∀ k ∈ Z . y ( k ) = u ( k ) − 3 y ( k − 1) (real numbers R ) ↓ Practice : implementation foreach k do finite precision y ( k ) ← u ( k ) − 3 ∗ y ( k − 1) (floating- or fixed-point numbers) end → rounding errors which propagate and may accumulate: ֒ y ∗ ( k ) ← u ( k ) ⊖ 3 ⊗ y ∗ ( k − 1) y ∗ ( k ) ← ֓ y ∗ ( k − 1) ← ֓ y ∗ ( k − 2) ← ֓ ... Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 4 / 11

  9. Using Fixed-Point Numbers Fixed-point numbers : faster computations, less energy consumption than floating-point numbers ֒ → used for digital filters in embedded systems Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 5 / 11

  10. Using Fixed-Point Numbers Fixed-point numbers : faster computations, less energy consumption than floating-point numbers ֒ → used for digital filters in embedded systems They try to use as few significant digits as possible: bigger rounding errors than using floating-point numbers risk of overflow (exceeding the greatest representable value) Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 5 / 11

  11. Controlling Rounding Errors in Digital Filters But robotics, automotive, aeronautics etc. are critical domains How to ensure that rounding errors do not cause critical failures in digital filters? Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 6 / 11

  12. Controlling Rounding Errors in Digital Filters But robotics, automotive, aeronautics etc. are critical domains How to ensure that rounding errors do not cause critical failures in digital filters? Error analysis with pen-and-paper proofs [Hilaire, Lopez 2013] etc. Formal methods [Akbarpour, Tahar 2007] [Siddique, Mahmoud, Tahar 2018] etc. Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 6 / 11

  13. Objective of my PhD and First Contributions Objective : formal analysis of rounding errors in Coq Current formalization includes: Various algorithms for LTI filters and equivalences between them Theorem of the Error Filter to study propagation of errors Worst-Case Peak-Gain Theorem to bound the final error Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 7 / 11

  14. One Realization to Represent them all Filters can be defined under various forms, called realizations: n n y ( k ) = � b i u ( k − i ) − � a i y ( k − i ) i =0 i =1  n � e ( k ) ← u ( k ) − a i e ( k − i )  �  x ( k + 1) = Ax ( k ) + B u ( k )  i =1 n y ( k ) = Cx ( k ) + D u ( k ) y ( k ) ← � b i e ( k − i )    i =1 Coq definitions and proofs : Three realizations: Direct Forms I and II, and State-Space Corresponding filters are LTI Transformation functions between them that preserve the filter Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 8 / 11

  15. One Realization to Represent them all Filters can be defined under various forms, called realizations: n n y ( k ) = � b i u ( k − i ) − � a i y ( k − i ) i =0 i =1  n � e ( k ) ← u ( k ) − a i e ( k − i )  �  x ( k + 1) = Ax ( k ) + B u ( k )  i =1 n y ( k ) = Cx ( k ) + D u ( k ) y ( k ) ← � b i e ( k − i )    i =1 Coq definitions and proofs : Three realizations: Direct Forms I and II, and State-Space Corresponding filters are LTI Transformation functions between them that preserve the filter → we can choose one of them to do the error analysis ֒ Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 8 / 11

  16. Error Propagation: the Error Filter We can compute a filter H ε such that: u ( k ) y ( k ) H y ∗ ( k ) + ε ( k ) ∆ y ( k ) H ε y ( k ) : output of infinite-precision model filter H y ∗ ( k ) : output of actual implemented filter where ε ( k ) : vector of errors in individual computations at step k Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 9 / 11

  17. Error Propagation: the Error Filter We can compute a filter H ε such that: u ( k ) y ( k ) H y ∗ ( k ) + ε ( k ) ∆ y ( k ) H ε y ( k ) : output of infinite-precision model filter H y ∗ ( k ) : output of actual implemented filter where ε ( k ) : vector of errors in individual computations at step k Fixed-point norms: individual computations are correctly rounded ??? → bound on ε ( k ) − → bound on ∆ y ( k ) ֒ Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 9 / 11

  18. The Worst-Case Peak-Gain Theorem � = | D | + � ∞ � of filter H � � The Worst-Case Peak-Gain � �H� � CA k B k =0 verifies: ×� �H� � bound for the input − − − − − − − → bound for the output ∀ k . | u ( k ) | ≤ M ∀ k . | y ( k ) | ≤ � �H� � × M H The value of � �H� � is in R (it may be equal to + ∞ ) and it is optimal Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 10 / 11

  19. Conclusion and Future Work Formalized 1 in Coq: equivalence between forms of definition, theorem of the Error Filter, Worst-Case Peak-Gain theorem 1 www.lri.fr/~gallois/code/coq-digital-filters-CICM18.tgz Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 11 / 11

  20. Conclusion and Future Work Formalized 1 in Coq: equivalence between forms of definition, theorem of the Error Filter, Worst-Case Peak-Gain theorem To complete formal error analysis: Formalize two’s complement fixed-point arithmetic in Coq � can be well approximated � = | D | + � ∞ � CA k B � � Prove that � �H� k =0 Bound errors in correctly rounded individual computations 1 www.lri.fr/~gallois/code/coq-digital-filters-CICM18.tgz Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 11 / 11

  21. Conclusion and Future Work Formalized 1 in Coq: equivalence between forms of definition, theorem of the Error Filter, Worst-Case Peak-Gain theorem To complete formal error analysis: Formalize two’s complement fixed-point arithmetic in Coq � can be well approximated � = | D | + � ∞ � � CA k B � Prove that � �H� k =0 Bound errors in correctly rounded individual computations Longer-term goal: Automatically generate certified code together with formally proven error bound ...while reordering computations to minimize the rounding errors 1 www.lri.fr/~gallois/code/coq-digital-filters-CICM18.tgz Diane Gallois-Wong (U-PSud, LRI) Formal Verification and Digital Filters August 13, 2018 11 / 11

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend