CertiCAN: A Tool for the Coq Certification of CAN Analysis Results

Pascal Fradet, Xiaojie Guo, Jean‐François Monin, Sophie Quinton2019 · DOI

TL;DR

This paper introduces CertiCAN, a novel tool built using the Coq proof assistant to formally certify the results of CAN (Controller Area Network) analysis. By combining precise and approximate analysis techniques, CertiCAN offers a practical and efficient way to ensure the correctness of real-time systems analysis, making it suitable for industrial applications.

What Problem Does This Paper Address?

Ensuring the reliability of real-time systems, especially those used in safety-critical applications like automotive and avionics, is paramount. Traditional pen-and-paper proofs for complex analyses can be error-prone, as evidenced by historical flaws in CAN analysis methods. While formal verification tools like proof assistants (e.g., Coq) can provide rigorous guarantees, certifying entire analysis tools is often prohibitively complex and resource-intensive due to their intricate nature and frequent updates. This paper addresses the need for a more practical approach: certifying the results of existing, potentially unverified, industrial analysis tools, rather than the tools themselves. This is particularly relevant for CAN analysis, a widely used protocol in the automotive industry.

Methods

The core of CertiCAN lies in its innovative approach to combining two types of CAN analysis techniques:

  • Precise Analysis: This method provides highly accurate (tight) bounds on worst-case response times (WCRT) but can be computationally expensive, especially for large systems.
  • Approximate Analysis: This technique is much faster but yields more pessimistic (looser) upper bounds on WCRT.

CertiCAN leverages these two analyses in a "combined RTA" (Response Time Analysis). The strategy is to first use the approximate analysis to quickly rule out many scenarios. If the approximate analysis suggests a WCRT that is sufficiently low, it can dominate a large set of precise scenarios, thus avoiding the need for explicit precise analysis for those scenarios. Only when the approximate analysis indicates a potentially high WCRT, or when a precise scenario is not dominated by any approximate one, is the precise analysis invoked. This hybrid approach aims to achieve the accuracy of precise analysis while benefiting from the speed of approximate analysis.

Furthermore, CertiCAN itself is built using the Coq proof assistant, meaning its own logic and correctness proofs are formally verified. This ensures that the certifier itself is trustworthy. The tool is then extracted from Coq into executable OCaml code.

Datasets

Not discussed in the paper. The authors generated synthetic test task sets using a homemade generator for their experiments.

Key Insights and Ideas

  • Result Certification vs. Tool Certification: The paper strongly advocates for certifying analysis results as a more practical and flexible approach for industrial adoption than certifying entire complex tools.
  • The Power of Approximation: Using a faster, approximate analysis as a filter can dramatically reduce the computational burden of formal verification by avoiding unnecessary precise calculations.
  • Domination Principle: The core idea that an approximate scenario can "dominate" multiple precise scenarios is key to the efficiency of the combined approach. If an approximate result is good enough, it implies the precise result for a whole set of scenarios is also bounded.
  • Formal Verification as a Practical Tool: The successful implementation and evaluation of CertiCAN demonstrate that formal methods, when applied strategically, can yield practical tools for critical industrial domains.

Key Results

  • CertiCAN, the certified result certifier, was successfully implemented and extracted into executable OCaml code.
  • The combined RTA approach was shown to be as accurate as the precise analysis but significantly faster.
  • Experiments demonstrated that CertiCAN is capable of certifying results from industrial CAN analysis tools like RTaW-Pegase, even for relatively large systems (up to 35 tasks per transaction, or systems with up to 200 tasks).
  • While CertiCAN is slower than the industrial RTaW-Pegase tool, its runtime was found to be "tractable" and its performance was comparable to the certified approximate analyzer.
  • The number of transactions was identified as the main factor influencing complexity growth, more so than the number of tasks or system utilization.

Limitations and Future Work

  • Performance Optimization: The authors acknowledge that CertiCAN's implementation is a "naive implementation" and that its efficiency could be improved by proving additional lemmas and optimizations, particularly for systems with harmonic periods.
  • Generalization: While the underlying technique is designed to be generalizable to other system models and analysis techniques with different levels of precision, the current work focuses specifically on CAN analysis.
  • Industrial Case Studies: The current evaluation uses synthetic test cases. The authors aim to convince industrial partners to provide real case studies to further validate the approach.
  • Extension to Networks of CAN Buses: Future work includes extending the approach to handle networks of CAN buses and other communication protocols.

Summary updated

Abstract

International audience
BibTeX
@misc{fradet2019certican,
  author = {Pascal Fradet and Xiaojie Guo and Jean‐François Monin and Sophie Quinton},
  title = {{CertiCAN: A Tool for the Coq Certification of CAN Analysis Results}},
  year = {2019},
  doi = {10.1109/rtas.2019.00023},
}
Figure