class Program: (source)
Program instances describe program entities. This class ties together the CFG, the data flow graph (variables + bindings) as well as methods. We use this for issuing IDs: We need every CFG node to have a unique ID, and this class does the corresponding counting. Attributes: entrypoint: Entrypoint of the program, if it has one. (None otherwise) cfg_nodes: CFG nodes in use. Will be used for assigning node IDs. next_binding_id: The next id to assign to a Binding. Accessed through NextBindingId(). next_variable_id: The next id to assign to a variable. solver: the active Solver instance. default_data: Default value for data. variables: Variables in use. Will be used for assigning variable IDs.
Method | __init__ |
Initialize a new (initially empty) program. |
Method | calculate |
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method | is |
Whether a path exists (going forward) from node src to node dst. |
Method |
|
Undocumented |
Method |
|
Start a new CFG node. |
Method |
|
Create a new Variable. |
Instance Variable | cfg |
Undocumented |
Instance Variable | default |
Undocumented |
Instance Variable | entrypoint |
Undocumented |
Instance Variable | next |
Undocumented |
Instance Variable | next |
Undocumented |
Instance Variable | solver |
Undocumented |
Property | variables |
Undocumented |
Create a new Variable. A Variable typically models a "union type", i.e., a disjunction of different possible types. This constructor assumes that all the bindings in this Variable have the same origin(s). If that's not the case, construct a variable with bindings=[] and origins=[] and then call AddBinding() to add the different bindings. Arguments: bindings: Optionally, a sequence of possible data items this variable can have. source_set: If we have bindings, the source_set they *all* depend on. An instance of SourceSet. where: If we have bindings, where in the CFG they're assigned. Returns: A Variable instance.