Understand and experiment with
- a strong parallel between the static analysis definition and its implementation
- how an abstract interpreter in a transitional style is constructed
- step-by-step process of an abstract interpreter
- different abstract domains and semantic operations
- Sparrow: https://github.com/ropas/sparrow/ (on Thursday)
- written in simple OCaml (avoiding functors, modules, etc)
- not optimized for efficiency
$ sudo apt-get install ocaml
$ git clone https://github.com/ropas/ssft19-ai
$ cd ssft19-ai
$ make
$ ./run -pponly ex0-parse-test
$ ./run ex1a-val-seq./run [-pponly] [target program]
Takes input program -> parse/label -> abstract interpretation
main.mlparser.mly,lexer.mll: for parsingsil.ml,sill.ml: (labelled) target languageval.ml,mem.ml: abstract value & memory domainsai.ml: abstract interpreter (core analyzer)
Simple imperative language (pgm in sil.ml, eaxmples in ex*)
- sign, const (const branch), interval (exercise, will cover on Thursday)
- replace
val.mlwith your own value abstraction, then modifylabels_of_valandcondinai.mlaccordingly
- variable -> value (
Mem.t)
- label -> memory (
Ai.state)
ex0*: parse & labelex1*: valueex2*: whileex3*: goto
- Add zero to the sign domain:
val.tasBOT | TOP | POS | ZERO | NEG - Implement abstract value as constants (in const branch)
- Add refinements in (
sat*inval.ml&condinai.ml) - Implement abstract value as intervals, and add widening fuction for the domain in
ai.ml
- Static Analysis: an Abstract Interpretation Perspective, Yi and Rival, MIT Press, 2019 (to be published)
- http://fm.csl.sri.com/SSFT19 (slides & supplementary note under Kwangkeun Yi)