Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
126 tokens/sec
GPT-4o
47 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
47 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

C Analyzer : A Static Program Analysis Tool for C Programs (2403.12973v1)

Published 28 Jan 2024 in cs.PL and cs.CL

Abstract: In our times, when the world is increasingly becoming more dependent on software programs, writing bug-free, correct programs is crucial. Program verification based on formal methods can guarantee this by detecting run-time errors in safety-critical systems to avoid possible adverse impacts on human life and save time and money. This project work tries to leverage Abstract Interpretation techniques for static analysis of C programs. C Analyzer is a tool developed for static analysis of C programs. This implementation of C Analyzer provides a plug-and-play domain architecture for multiple abstract domains to be used. C Analyzer supports four abstract domains - Interval, Octagon, Polyhedra, and Bit Vector. We use these different domains for required precision in program verification. C Analyzer tool uses LLVM C/C++ compiler frontend Clang API to generate and traverse the Control Flow Graph (CFG) of a given C program. This tool generates invariants in different abstract domains for statements in basic blocks of CFG during CFG traversal. Using these invariants, some properties of a program, such as dividing by zero, modulus zero, arithmetic overflow, etc., can be analyzed. We also use a source-to-source transformation tool, CIL (Common Intermediate language), to transform some C constructs into simpler constructs, such as transforming logical operators, switch statements, and conditional operators into if-else ladders and transforming do-while and for loops into while loops. Using C Analyzer, C program constructs such as declarations, assignments, binary operations (arithmetic, relational, bitwise shift, etc.), conditions (if-else), loops (while, do while, for loop), nested conditions, and nested loops can be analyzed. Currently, this tool does not support arrays, structures, unions, pointers, or function calls.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (18)
  1. Wikipedia for several conceptual articles, especially under chapter Literature Survey http://en.wikipedia.org/
  2. Patrick Cousot, Introduction to Abstract Interpretation http://www.di.ens.fr/~cousot/AI/IntroAbsInt.html.
  3. Examples of abstract-interpretation-based static analysis http://www.di.ens.fr/~cousot/AI/#tth_sEc4.
  4. Gregoire Sutre 2008, slides on Software Verification www.mpi-inf.mpg.de/vtsa08/slides/sutre1.pdf and www.mpi-inf.mpg.de/vtsa08/slides/sutre2.pdf
  5. Tutorial on Abstract Interpretation: https://ti.arc.nasa.gov/m/tech/rse/publications/papers/cglobalsurveyor/abs_int_tutorial.ppt
  6. Software Bugs http://www5.in.tum.de/~huckle/bugse.html.
  7. Static Program Analysis, http://www.irisa.fr/lande/jensen/spa.html
  8. Antoine Mine´´𝑒\acute{e}over´ start_ARG italic_e end_ARG: 2006, The Octagon Abstract Domain.
  9. Ctree - an implementation of AST generation using Flex/Bison based parser http://sourceforge.net/projects/ctool/files/ctree/.
  10. ANSI C Grammar - Lex http://www.lysator.liu.se/c/ANSI-C-grammar-l.html
  11. ANSI C Grammar - Yacc http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
  12. APRON http://apron.cri.ensmp.fr/library/
  13. The LLVM Compiler Infrastructure Umbrella Project http://llvm.org/.
  14. Clang - Static Analyzer Checker User Guide http://clang-analyzer.llvm.org/checker_dev_manual.html.
  15. Chris Lattner and Vikram Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In CGO'04: Proceedings of the International Symposium on Code Generation and Optimization: Feedback-directed and Run-time Optimization, 2004.
  16. LLVM: The Architecture of Open Source Applications Vol-I chapter-11 http://www.aosabook.org/en/llvm.html.
  17. Clang's Stmt class reference online at LLVM website: http://clang.llvm.org/doxygen/classclang_1_1Stmt.html
  18. Clang's RecursiveASTVisitor class reference: http://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html

Summary

We haven't generated a summary for this paper yet.

X Twitter Logo Streamline Icon: https://streamlinehq.com