A brief description of the PATO project is here. This repository is based on the ROSE compiler.
- Follow the instruction 1 and 2 to install EDG 4.x-based ROSE.
- Edit
set.rose
to set the correct PATH to your install and run. set.rose
. $ cd tools/onto-build-rose/
and runmake
- ontology/ - The owl files defining the used concepts (vocabularies, relations, etc) are put here. This is the core ontology and can be regarded as the meta-model for the program. It is not the generated ontology from programs.
- projects/ - It contains separate analysis projects. Currently they are prototyped with Prolog to implement different program analysis over the generated ontology of program. There are "canonical loop analysis" and "control flow graph"(CFG) analysis.
- test/ - Some benchmarks for testing.
- tools/onto-build-rose - It includes the frontend to build the knowledge from program, i.e., the ontology
generator. It's a parser for C program built on ROSE compiler. If you want to extend
the parser to cover more language features or structures, you can start with
rosePrgKnowledgeBuilder.h/cpp
. It essentially implements an AST traversal to extract information from the program. TheOntoGeneratorInterface.hpp
defines some interfaces for generating different format of the ontology (owl, ttl, pl).
-
Generate knowledge base from program, represented as ontology or linked data
$ rosePrgKnowledgeBuilder.exe -c -w -emit-owl out.owl input.c [-I/extra-include-dir]
-
Run a program analysis based on logic inference (as Prolog script)
Canonical Loop
$ swipl --nosignal --quiet projects/canonicalloop/run.pl out.owl report.txt
or CFG
$ swipl --nosignal --quiet projects/cfg/run.pl out.owl report.txt
Another sub-project implementing the pointer analysis is in repository. If you are interested in extending the project, that one is recommended. We shift the C program parser to more popular Clang.