Python: remove comments and start design document

This commit is contained in:
Rasmus Lerchedahl Petersen
2022-09-06 17:23:40 +02:00
parent 67c3a9b2f4
commit 4cd41c24c7
2 changed files with 24 additions and 2 deletions

24
python/ql/lib/design.md Normal file
View File

@@ -0,0 +1,24 @@
# The Python libraries
The Python libraries are a collection of libraries for analysing Python code.
Everythng can be imported by importing `python.qll`.
## The analysis layers
The analysis is built up in layers. the stack looks like this:
- AST (coms from the extractor)
- Control flow graph (CFG) (built by the extractor)
- SSA
- Call graph
- Data flow
## Avoiding non-monotonic recursion
Given the many interactivg layers, it is imprtant to decie which predicates are allowed to be mutually recursive in order to avoid non-monotonic recursion when negation is used to express the predicates.
As an example, we have defined local source as those whcih do not receive local flow. This means that the local flow relation is not allowed to be recursive with anything depending on local sources.
Some particular reatrictions to keep in mind:
- Typetracking needs to use a local flow step not including summaries
- Typetracking needs to use a call graph not including summaries

View File

@@ -67,8 +67,6 @@ private class SummarizedCallableMap extends SummarizedCallable {
}
}
// Typetracking needs to use a local flow step not including summaries
// Typetracking needs to use a call graph not including summaries
private class SummarizedCallableJsonLoads extends SummarizedCallable {
SummarizedCallableJsonLoads() { this = "json.loads" }